Extensions

Capabilities you add to the AI.

The kernel gives the AI structure: nodes, notes, conversations. Extensions give it everything else. New tools. New knowledge. New ways to think. Install what you need. Remove what you don't. Build your own.

What Extensions Actually Do

An extension is a folder with two files. It plugs into the kernel and changes what the AI can do, what it knows, or how it thinks. Three categories cover almost everything.

New Tools

Give the AI abilities it didn't have. A tool is a function the AI can call.food-log-entry parses "ate a banana" into protein, carbs, fats and writes it to the tree.fitness-log-workout records sets, tracks progressive overload, detects PRs.create-node-note writes a note. Without the extension, the tool doesn't exist.

New Knowledge

Inject context into what the AI sees. When you talk to the AI, extensions add data to its awareness through a hook called enrichContext. The food extension injects today's macros. The fitness extension injects your current program. The recovery extension injects your sleep and energy. The AI reads all of it. It knows because extensions told it.

New Behaviors

Change how the AI thinks. Extensions register "modes," each with a different system prompt and tool set. A food-log mode knows how to parse meals. A food-coach mode asks about your goals. A food-review mode analyzes patterns. Navigate to a node and the right mode activates. The AI's personality and capability shift based on where you are in the tree.

A Simple Extension

llm-response-formatting cleans up how the AI talks. It listens to one hook: beforeResponse. Every time the AI is about to reply, this extension strips markdown artifacts, fixes broken formatting, and normalizes the output. One hook. No tools. No modes. No data. Just a filter on the AI's voice.

What it provides

1 hook listener0 tools0 modes0 routes0 data

This is the lightest kind of extension. It doesn't store anything. It doesn't give the AI new tools. It just intercepts the response on the way out and fixes it. Every extension starts this simple. Most of the interesting ones grow from here.

A Rich Extension

food turns the tree into a nutrition tracker. You say "ate chicken and rice." The AI estimates macros, logs them, updates your running totals, places the meal in the right time slot, and tells you where you stand for the day. One message. Everything handled.

Tree structure it creates

Food
Log -- where you talk. "ate a banana"
Protein -- today: 65g, goal: 200g
Carbs -- today: 120g, goal: 300g
Fats -- today: 28g, goal: 80g
Daily -- the advisor. "how am I doing?"
Profile -- calorie target, restrictions
History -- daily + weekly summaries
Meals
Breakfast, Lunch, Dinner, Snacks

What it provides

4 modeslog, coach, review, daily
3 toolslog-entry, save-profile, adopt-node
5 hooksenrichContext, afterNote, onCascade...
3 API routesdaily, history, weekly

Where data lives

No database tables. Every number lives in node metadata. The Protein node has metadata.values.today = 65 and metadata.goals.today = 200. History is a sequence of JSON notes on the History node. The Profile is a JSON note. Meals are notes on slot nodes.

When you talk at the Food tree, the enrichContext hook assembles all of this into the AI's context. The AI sees: "Protein: 65/200g. Carbs: 120/300g. Last meal: chicken and rice at 12:30pm." It didn't look this up. The extension injected it.

Extensions Create Everything

Every feature you see in TreeOS is an extension. The dashboard, notifications, the chat interface, fitness coaching, billing, federation. Here are a few more examples of what extensions look like at different scales.

consoleFormats log output in the terminal. Colors, timestamps, alignment. One file, no tools, no data.
navigationTracks where users go. Adds cd and ls commands. Stores recent roots in user metadata.
notificationsPush notifications across channels. Registers a socket handler and a background job.
personaGives the AI a custom identity per node. Stores personality in metadata. Injects it through enrichContext.
tree-orchestratorReplaces the entire conversation flow. Routes messages to the right extension's mode based on content and position. The most powerful extension type.
gatewayOpens the tree to external channels. Discord, Telegram, Slack, email, SMS. Each channel type is its own sub-extension. Together they form the rain layer.

Bundles

Extensions group into bundles. Install a bundle and you get a coordinated set of capabilities. Remove one extension and the rest keep working. Four bundles cover the major systems.

treeos-cascade 8 extensions

The nervous system. When content is written, signals propagate through the tree. Each node can filter what it receives. Signals compress into shared vocabulary. Missing capabilities surface automatically. Health is monitored. Flow is visible.

propagation, perspective-filter, sealed-transport, codebook, gap-detection, long-memory, pulse, flow

treeos-connect 8 extensions

External channels. Discord messages become tree conversations. Telegram chats reach specific nodes. Email through any SMTP. SMS through Twilio. Slack, Matrix, webhooks. Each channel registers with the gateway and gets access control, energy metering, and queue management automatically.

gateway, gateway-telegram, gateway-discord, gateway-email, gateway-sms, gateway-slack, gateway-matrix, gateway-webhook

treeos-intelligence 14 extensions

Self-awareness. The tree compresses what it's learned upward. Contradictions surface. User behavior is modeled. Structure evolves based on what works. Semantic search connects related content. The tree tracks where its knowledge ends. Intent synthesizes all of this into autonomous actions the tree takes on its own.

tree-compress, contradiction, inverse-tree, evolution, intent, embed, scout, explore, trace, boundary, competence, reflect, evolve, rings

treeos-maintenance 5 extensions

Hygiene. Dead nodes get pruned. Content gets reorganized based on semantic similarity. Changes get narrated. Daily briefings assemble from every installed extension. Stuck work gets matched to available people.

prune, reroot, changelog, digest, delegate

Review every extension before you install it.

Extensions run in the same process as the kernel. They can access your file system, make network calls, and execute shell commands. A malicious extension with the right tools can do real damage. Read the code. Check what hooks it listens to, what tools it registers, what services it declares.

Use spatial scoping to confine dangerous extensions to specific branches. ext-allow shell at /DevOps gives it access there only. The rest of your tree never sees it.

How Extensions Work

Two files. A manifest declares dependencies and capabilities. An init function wires everything in.

manifest.js

needs: models, services, other extensions. optional: graceful degradation if missing. provides: CLI commands, env vars, energy actions. The loader reads it before calling any code. Unmet needs = extension skipped.

init(core)

Receives the core services bundle. Returns any combination of: router (HTTP routes), tools (MCP tools for the AI), jobs (background tasks), exports (for other extensions). Registers hooks, modes, orchestrators through core.

Five Registries

Same pattern across all five. Extensions register. The kernel resolves.

HooksLifecycle events. 30 kernel hooks. before hooks can cancel. after hooks react. Extensions fire their own.
ModesAI conversation modes. How the AI thinks at each position. Per-node overrides let you change behavior anywhere.
OrchestratorsConversation flow. The entire chat pipeline is replaceable. Swap it and you control every AI interaction.
Socket HandlersReal-time events. Extensions add WebSocket features without touching kernel code.
Auth StrategiesAuthentication methods. JWT is built-in. API keys, share tokens, public access are all extensions.

Position Determines Capability

Block an extension at a node and it disappears from that node and every child. Tools, hooks, modes, metadata writes. All gone. Allow a confined extension at a specific branch and it activates only there.

Global (opt-out)

Active everywhere by default. ext-block shell removes it at a node and all descendants. Most extensions work this way.

Confined (opt-in)

Active nowhere by default. ext-allow solana activates it at a node and all descendants. For dangerous or specialized capabilities.

An Operating System Is Just Extensions Working Together

The Seedstructure, intelligence, extensibility, communication
Extensionscapabilities, tools, modes, hooks, jobs, orchestrators
Treesapplications (food, fitness, CRM, journal, anything)

Enough extensions built on a kernel form an operating system. Swap any of them and you get a different OS. A medical OS. A coding OS. A research OS. The kernel stays the same. The extensions define the experience.