Hw to make sure AI Agents neer forget the Work? A developer released two open-source templates for Claude Code and OpenAI Codex that prevent AI coding agents from forgetting project context by storing rules and decisions in files and automatically injecting them via hooks. The templates address common failures like context loss between sessions, silent errors, and repeated mistakes by forcing recall at session start, on every message, and before edits. This ensures agents consistently follow project-specific rules without relying on model memory. A coding agent forgets. Halfway through a build the context compacts, and suddenly it's re-asking things you settled an hour ago or quietly ignoring a rule you set on day one. These are two drop-in templates — one for Claude Code, one for Codex — that fix that by keeping the project's memory in files and feeding it back to the agent automatically. ai-coding-project-templates/ ├─ claude-project-template/ for Claude Code rulebook = CLAUDE.md, hook via .claude/settings.json └─ codex-project-template/ for OpenAI Codex rulebook = AGENTS.md, hook via .codex/hooks.json Both folders are the same system. The only differences are the rulebook filename and how each agent registers hooks. What problem do these solve? what-problem-do-these-solve Pick your agent pick-your-agent Install per project install-per-project How recall is forced, not hoped-for how-recall-is-forced-not-hoped-for Looking things up by meaning recall looking-things-up-by-meaning-recall Staying pointed at the goal staying-pointed-at-the-goal The decision tree see it, and roll back to it the-decision-tree What's inside each template whats-inside-each-template Optional companion: graphify optional-companion-graphify License license Four things that go wrong on any long-running agent session, and what the template does about each: Without With ─────── ──── Forgets between sessions; you Every message, decision and change lands in DOCS/, re-explain the project constantly. so a fresh session reloads the full context. "Done" means "the code exists," "Done" means a passing test or a real run E0–E5 , even if it never ran. not just code that imports. Same error retried forever. Three strikes on the same failure → stop and diagnose. Silent fallbacks; lost reasoning. Fallbacks must be stated. Decisions and failures are logged with the test that stops them returning. | You use | Open this folder | Rulebook | |---|---|---| | Claude Code CLI / VS Code / desktop | claude-project-template/ | CLAUDE.md | | OpenAI Codex CLI / VS Code / desktop | codex-project-template/ | AGENTS.md | Do this once per project, when you copy the template in: - Copy your folder's contents into the project root. - Fill in the