Persistent project knowledge files that give AI agents instant context across sessions
ai-servicers.com
AI agents lose project context between sessions.
Every new session, Claude re-discovers architecture, re-learns gotchas, and re-makes decisions that were already settled. Subagents spawned mid-task have zero project knowledge.
CLAUDE.md is for directives (what to do), not knowledge (what IS). We need a separate system for persistent project facts.
docs/ first instinctivelydocs/context/ existsEvery entry is prefixed with its implementation status. Agents must clearly distinguish fact from plan.
| Condition | Hook Response | Agent Impact |
|---|---|---|
docs/context/ already updated |
Silent | None — agent finishes immediately |
stop_hook_active: true |
Silent | Prevents infinite loop |
No docs/context/ directory |
Silent | Project not opted in |
| No changes at all | Soft one-liner | "If significant decisions were made, update decisions.md" |
| Small code change (<15 lines diff) | Soft reminder | "If changes affect architecture/security/ops, update docs" |
| Significant code change, no docs update | Strong reminder | "You changed code. Update relevant docs/context/ files." |
Detection uses git diff — deterministic, no LLM cost, <100ms
[IMPLEMENTED] / [PLANNED] markersWhen unsure which file to update, ask: "Which question does this answer?" Each file answers exactly one question. If torn between two files, pick the more specific one.
/project-context init
Creates docs/context/ with all 7 files from templates. Populates with known project info.
/project-context
Reads all context files, compares against current state, updates stale info, prunes outdated entries.
Stop / SubagentStop hooks
Smart git diff reminds agents to update after significant changes. Zero config per project.
User-level infrastructure, project-level opt-in.
Hooks are global but only fire when docs/context/ exists.
Any project opts in by running /project-context init.
7 terse markdown files in docs/context/ give every agent
instant project understanding without re-discovery.
Stop + SubagentStop hooks ensure updates happen automatically. Smart git diff keeps noise near zero — silent when docs are already current.
CLAUDE.md = directives. docs/context/ = knowledge. Clean separation. Both committed to git. Both available to every agent.
ai-servicers.com