The promotion pathway
.agents.local.md) is where knowledge starts. It’s experimental, personal, and gitignored. AGENTS.md is where knowledge ends up — proven, shared, committed. The agent handles the writing and flagging. You handle the final promotion decision.
The four-phase workflow
Write — agent logs learnings at session end
At the end of each session, the agent appends an entry to
.agents.local.md (or to the daily log in .agents/logs/YYYY-MM-DD.md if you’re using the memory system). The entry records what changed, what worked, what didn’t, decisions made, and patterns noticed.The agent shows you the proposed entry before writing it. It does not append without your approval.A session log entry looks like this:Compress — scratchpad compresses at 300 lines
When
.agents.local.md hits 300 lines, the agent compresses it: deduplicating entries, merging related notes, and removing noise. The scratchpad stays tight and useful rather than growing into an unmanageable log.The agent logs each compression in the ## Compression Log section of the scratchpad so you have a record of what was consolidated and when.Flag — recurring patterns get marked 'Ready to Promote'
During compression, the agent looks for patterns that have appeared across 3 or more separate sessions. When it finds one, it flags it in the scratchpad’s The agent flags candidates. It does not touch
## Ready to Promote section, formatted in the pipe-delimited shorthand that AGENTS.md expects:AGENTS.md without your explicit action.Promote — move stable patterns to AGENTS.md
Once the agent has flagged patterns, you decide what gets promoted. Run Promoted items move from your personal, experimental scratchpad into the committed, shared source of truth that every agent on your team reads.
agent-context promote to review flagged items interactively, or use --autopromote to automatically append all flagged items to AGENTS.md.Session logging reality
Agents don’t have session-end hooks. A session ends when you stop talking — there’s no automatic trigger that fires the logging step. Logging happens in one of two ways:- You prompt it. Say “log this session” or “update the scratchpad” before closing the window. This is the reliable path for most agents.
- The agent proactively logs. Some agents follow the rule in
AGENTS.mdthat says to log at session end. This is less reliable without the explicit prompt.
~/.claude/projects/<project>/memory/ and loads them at session start automatically — essentially the .agents.local.md concept built into the tool. If you use Claude Code exclusively, you get session-to-session learning without prompting.
For every other agent, build the habit: when meaningful work was done, ask for the log before you close the session.
Personal memory vs. project memory
The system maintains a clear line between two kinds of knowledge:Personal memory
Lives in
.agents.local.md and .agents/. Gitignored. Contains what the agent has learned about you — your preferences, your workflow, your project’s quirks as you’ve encountered them. Never shared with your team.Project memory
Lives in
AGENTS.md. Committed and shared. Contains what every agent needs to know about your project — the rules, the patterns, the architecture decisions that apply to everyone working on the codebase.AGENTS.md should only hold what’s proven, settled, and universally applicable to anyone touching the project.
What gets promoted
Not everything in your scratchpad belongs inAGENTS.md. Promote a pattern when it meets all three criteria:
- It has appeared across 3 or more separate sessions (the agent’s threshold for flagging)
- It applies to anyone working on the project, not just to your personal workflow
- It fits within the 120-line budget —
AGENTS.mdmust stay lean