Truss blog5 October 2026

Blog

Context engineering for teams

For one agent, context engineering is a prompt problem. For a team it is a repository problem. Put reasoning next to the code, type it, and let CI catch drift.

Context is a team asset, not a prompt

Most writing about context engineering is about one person and one agent. Pick the right files, trim the system prompt, order the examples. Useful, and beside the point for a team.

A team's agents start cold dozens of times a day, in different editors, on different branches, driven by different people. Whatever one engineer learned to paste into a prompt is not available to the next session. The context a team needs is not a prompt. It is an asset, and assets need a home, an owner and a way to notice when they go stale.

The question changes from "what should I tell the agent" to "where does the team keep what every agent needs to know, and how does it stay true".

Put the context next to the code

The answer that holds up is the repository.

Every alternative splits the truth. A wiki that explains the code drifts from the code because nothing forces them to move together. A vector index over your Slack history finds the thread where you discussed the decision, and the thread where you reversed it, and cannot tell you which one won. A hosted copy kept in sync with the repo turns every edit into a reconciliation problem.

Code already has the properties context needs. It is versioned, reviewed, branchable and owned. If the docs live in the same commits, a change to behaviour and the reasoning behind it land together or not at all. A session starts from the repo, so it starts with the context. If something is not in a commit, it does not exist, and that is a feature.

Type it so agents can query it

A folder of markdown is a start. Agents are good at reading prose, but they are much better at reading structure, and a team needs to ask questions that prose cannot answer.

Give every document a type and a schema. A product requirement, a decision, a piece of research, a support topic, a change. Give each one a stable id. Let documents declare what they carry, so a change can say which decisions it rests on and a decision can say which evidence it rests on.

truss/changes/CHG-0142-invite-links.mdyaml
type: change
id: CHG-0142
title: Invite teammates by link
carries:
  - PRD-0142
  - DEC-0036
  - DEC-0034

Now "what does this change depend on" is a query, not a search. The agent working on invite expiry gets the PRD, the two decisions, the nine interviews and the two support topics that matter, and nothing else. Six documents instead of a wiki. Typed context is smaller context, and smaller context is better context.

Docs change in the same PR as the code

Drift is the failure mode of every documentation system. The code moves, the explanation does not, and after a while nobody trusts the explanation at all.

The usual fix is a bot that notices later and opens a separate PR to update the docs. That splits one change across two PRs and loses the why in between. By the time the bot's PR arrives, the person who understood the change has moved on.

Do it in the session instead. When an agent changes behaviour, the same session updates the decision it contradicts, or records a new one, in the same branch. Drift caused by a change surfaces while the change is being made, when the reasoning is still in context. A human reviews one diff with the code and the docs side by side.

Drift with no session is a different, smaller problem. Evidence arrives while nobody is working, a decision ages past its review date, a change bypasses the tooling. That is a job for a quiet worker that records what it finds, marks a decision as contested and lets the next session deal with it. A bot PR is the fallback, not the plan.

Let the docs fail CI

None of this holds without enforcement, and the enforcement that works for code works for docs: a check that runs on every PR and blocks the merge when it fails.

The check is simple. Every doc matches its schema. Every link resolves. Every change names what it carries. A user-facing change updates the feature doc it touches. Each check warns or blocks, as the team chooses. Humans review the diff. Agents do the typing.

sh
$ truss check
  truss/decisions/DEC-0036-invite-expiry.md   ok
  truss/changes/CHG-0142-invite-links.md      ok
  src/invites/expiry.ts:14                    carries DEC-0036, updated in this PR
  0 errors

Treat a red check the way you treat a failing test. It is not a request to write more documentation. It is the build telling you the explanation and the code no longer agree, and that is exactly the moment to fix it.

What this buys you

Decisions stop being re-litigated, because the agent reads the decision before it writes the code. Onboarding an agent, or a new teammate, becomes one command, because the context is in the repo they just cloned. Support, research and product stop living in five tools behind five MCP servers, because the parts a change depends on are next to the change.

It is not a new idea. It is the old idea, docs with the code, finally with a reader that never skips them and a check that never lets them rot.

This is what Truss is: typed markdown in your repo, read and written by agents, checked in CI. If your team is already shipping this way and losing the why, request early access.