Shared Knowledge Layer
An organization-wide store of decisions, conventions and lessons that every coding agent and engineer reads, with sources, ownership and access rules.
Problem
A project memory file works for one repository, but most engineering knowledge spans many: architecture decisions, security rules, API conventions, lessons from incidents. Copied into each repo, it drifts out of date. Left in wikis and chat threads, agents never see it. Agents then re-make decisions the organization already settled, or treat an old opinion as current policy.
- Knowledge spans many repositories and teams.
- Agents need it in context, but only the relevant part.
- Stale or unsourced knowledge is worse than none.
- Some knowledge is restricted to certain teams.
Solution
Keep a shared, versioned knowledge layer that agents can query, separate from any single repository. Each entry has an owner, a source (the decision record, incident review or PR it came from), a date, and a label saying whether it is a fact (“service X owns refunds”) or an interpretation (“we prefer events over polling”). Access is scoped, so agents only see what their team may see. Agents retrieve only the entries relevant to the current task, and each repo’s project memory file links to the layer instead of copying it. Entries past their review date are flagged, and contradictions go to the owner to resolve.
Diagram
Each repo keeps a short memory file and draws the rest from one shared, sourced layer, filtered by task and by access.
When to use
Use it when
- Many repositories share conventions and decisions
- Agents keep re-deciding settled questions
- Incident lessons need to reach every team
- Some knowledge must stay within certain teams
Avoid it when
- A single repository, where a project memory file is enough
- No one is willing to own and review entries
- Knowledge that changes daily; it belongs in live systems, not a store
Trade-offs
Gains
- One source of truth across repositories
- Agents see why a rule exists, not just the rule
- Incident lessons reach every team
Costs
- Needs owners and a review cycle
- Access rules add setup work
- Poor retrieval floods context with irrelevant entries
Worked example
An engineering group of 40 repositories where agents kept proposing direct database reads across service boundaries, against a decision made a year earlier.
- SeedArchitects add 60 entries from existing decision records, each with owner, source link, date and fact or interpretation label.
- LinkEach repo’s CLAUDE.md drops its copied rules and adds a pointer to the layer, plus repo-specific notes.
- AgentAsked to add a refund report, the agent retrieves 4 relevant entries, including the fact “Billing owns invoice data; read it through the Billing API” with its source decision.
- IncidentA production feedback loop adds a new entry on exchange rate handling; within a day, agents in three other repos follow it.
- ReviewA quarterly check flags 7 entries past their review date. Owners retire 2 and update 5.
Failure modes
| Failure | Symptom | Mitigation |
|---|---|---|
| Stale entries | Agents follow a rule the org abandoned | Review dates; flag and expire unreviewed entries |
| Opinion as fact | One engineer's preference becomes policy | Label fact versus interpretation; show the source |
| Context flood | Dozens of entries loaded for a small change | Retrieve by task and repo; cap the entries per task |
| Leaking restricted knowledge | Agents see entries outside their team's scope | Enforce access scopes at retrieval, not in the prompt |