Agent Context Files
Structure the files a long-running agent reads so its instructions stay current instead of going stale.
Structure the files a long-running agent reads so its instructions stay current instead of going stale.
What this skill does
A long agent run rarely fails because the context window filled up. It fails because the agent cannot tell which of the things in its context is still true — and a capable model obeys a stale rule as effectively as a fresh one.
This skill covers the file layout that prevents that: four kinds of context separated by how often they change, what belongs in each, and the session loop that carries state from one run to the next.
Inside: SKILL.md, three references (the AGENTS.md format, a session loop, a review checklist), two dependency-free scripts — one that audits a repo and one that scaffolds the four files — and a test suite covering both.
The audit script flags the two failures that do not announce themselves: a conventions file that has started collecting plan-shaped lines, and a progress log that is being rewritten rather than appended to.
Built from primary sources — Anthropic's published guidance on long-running agent harnesses and context engineering, and the open AGENTS.md format. h/t Nate B Jones, whose coverage of how these teams structure agent context pointed us at the topic.
Get Agent Context Files
Free to download — drops straight into .claude/skills/.