TL;DR: Governance framework for Claude Code sessions — persistent memory, decision trail, dual agent roles. Ran it 2.5 weeks on a real project: 176 stories, 177 decisions. Tool-agnostic, open-source. If you’ve used Claude Code for more than a few sessions on the same project, you’ve probably hit this: the agent forgets what it decided yesterday, re-implements something differently, or makes an architectural call you didn’t authorize. Context evaporation. I built a governance framework called GAAI to fix this. It’s tool-agnostic (it’s just a .gaai/ folder with markdown files — any agent that reads files can use it), but I’ve been running it on Claude Code for 2.5 weeks straight on a real project. How it works in practice with Claude Code: Before any session, the agent loads context from .gaai/project/contexts/memory/ — decisions, conventions, patterns from previous sessions. It reads the backlog to know what to build. It reads a skill file to know how to build it. No improvisation. Two agent roles, strict separation: Discovery: I run this when thinking through a problem. It creates artefacts, logs decisions (DEC-NNN format), defines stories. It never writes code. Delivery: I run this when building. It picks a story from the backlog, implements it, opens a PR. It never makes architectural decisions. I switch between them manually. Same Claude Code CLI, different .gaai/ agent loaded. The framework enforces the boundary — if Delivery tries to make an architectural call, the rules say stop. What this changed for me: Session 5 is faster than session 1 (context compounds, 96.9% cache reads) Zero “why did it build it this way?” surprises — every decision is in the trail 177 decisions logged, all queryable — I can trace any line of code to the decision that authorized it What it caught: 19 PRs accumulated unmerged → cascading conflicts → 2+ hours lost. One rule added to conventions.md: merge after every QA pass. Framework enforces it now. Problem gone. Works with Claude Code today. Should work with any coding agent that reads project files — the governance is in the folder, not in the tool. How are you managing persistent context in your Claude Code projects? Would love to hear what’s working for others. submitted by /u/Fred-AnIndieCreator
Originally posted by u/Fred-AnIndieCreator on r/ClaudeCode
