Context Engine

Every agent starts smart.

When an agent begins work in TeamX, it already knows which files to touch, which conventions to respect, and which decisions matter — without you having to re-explain them each session.

When it fires

Three ways an agent gets briefed.

You pick a task

When an agent hits begin_task in the MCP server, TeamX assembles a briefing from the docs you linked, the docs the parent epic links, and any docs matched by title or feature slug. The agent sees all of it in its first message.

You DM the Claude Code bot

Open a DM with the Claude Code bot in Messages. Anything you say gets a context briefing prepended automatically before your message is relayed to the agent. The agent answers with the briefing already in its head.

You run Claude Code in a terminal

Your local Claude Code session talks to TeamX via the MCP server. The first time you call begin_task, the context briefing lands in the tool's response. Claude Code's own file-search still runs — the briefing adds team state that grep can't find.

What the agent sees

A layered briefing, not a data dump.

Explicit doc links

Docs you or the Brain manually attached to this task or epic. These always win — they are facts, not guesses.

Inherited epic docs

Any doc linked to the task's parent epic gets propagated onto the task automatically. One link on the epic, N briefings for free.

Keyword + feature matches

Trigram match against every user and tech doc in the team, plus a feature-slug match that pulls in the right release notes when a feature name appears in the task.

Recent commits

The last handful of commit activities touching the files this task is likely to affect — so the agent knows what just shipped nearby.

Captured decisions

The latest decisions on the parent epic (captured by complete_task). "Why did we pick approach A over B?" is answered before the question is asked.

How to wield it

Link once. Brief forever.

1

Link a doc to a task or epic

Open any task, epic, or plan detail. Hit "+ Attach" under Attached docs. A suggest list appears with your most-relevant published docs — click one and it is linked instantly.

2

Accept auto-suggestions at creation

When you create a new task or epic and start typing a title, 3 relevant doc chips appear under the description. Click the ones you want to attach. Nothing auto-attaches — surprises from AI suggestions should always be opt-in.

3

Let the Brain propose links

In Acting mode, the Brain can propose a link_docs_to_work_item action_card when it notices a task is missing context. You approve; the link lands with source=brain for audit.

4

Watch inheritance do the work

Attach docs to an epic once. Every existing open task under it gets a copy. Every new task created under it inherits automatically. Unlinking an inherited doc on a specific task scopes the unlink to that task — the epic stays intact.

5

Refresh stale docs with one click

When an epic linked to a doc closes, TeamX knows the doc may be out of date. The /docs list shows a Refresh badge on stale entries; click it and the generator re-runs on the next cron tick.

Powered by Auto Docs

The docs your agents read write themselves.

The Context Engine is a pure consumer of the Auto Docs layer. Every time you close an epic or ship a feature version, a fresh tech doc and user doc land automatically. Those are the docs the briefing retrieves from.

If Auto Docs are off for your team, the Context Engine still works — but the briefing falls back to trigram matches against whatever docs exist. Keep both enabled for the full picture.

FAQ

Honest answers.

Doesn't Claude Code already read files on demand?

Yes — and it keeps doing that. What Claude Code can't search for is team state: decisions captured in TeamX, docs that describe why a module exists, conventions enforced by a doc you wrote last month. The Context Engine injects that layer; Claude Code still does the fine-grained file reading for anything the briefing doesn't cover.

Can I see which docs are load-bearing for which epics?

Yes. Open any doc in /docs. A "Referenced by" section lists every work_item_docs and plan_docs row pointing at it, grouped open vs closed. If the last epic closed 60+ days ago and the doc has not regenerated, it gets a refresh suggestion.

What happens if I unlink an inherited doc on a task?

The unlink is scoped to that task only. The parent epic link and every other child task keep their copy. This way an outlier task can opt out of an epic-wide link without breaking the rest.

Does the Brain see my docs?

Only when it runs as a team member with proper RLS. search_docs_for_context is SECURITY DEFINER and checks is_team_member, so Brain — and every other caller — can only read docs for teams the user actually belongs to.

How do I turn off auto-suggestions in the create dialog?

You don't need to. Suggestions never auto-link. They appear as chips, and nothing is attached until you click one. The flow is: type a title → see chips → click the ones that match → create. If none match, just create — no chip ever converts without a click.

Is there a CLI for linking docs?

Not yet. The MCP tool set will get a link_docs_to_task helper in a future version so agents can self-attach mid-session when they realise a doc was missing.

Stop re-briefing your agents.

Open any epic in TeamX, attach the two or three docs that define it, and every task under it ships with that context baked in.