{"slug": "i-stopped-replaying-my-entire-codebase-to-codex-and-claude-code", "title": "I stopped replaying my entire codebase to Codex and Claude Code", "summary": "Developer AjnasNB built Qarinah, an open-source local project-memory compiler for coding agents that reduces repeated context by 98.71% compared to full-history replay. The tool stores typed events with citations and retrieves bounded evidence packs for tasks, addressing issues of cost and irrelevance in long Codex and Claude Code sessions.", "body_md": "I kept hitting the same problem in long Codex and Claude Code sessions: the agent was capable, but the project memory was expensive.\n\nA new task would trigger another repository scan. Decisions from older sessions had to be explained again. Tool results were buried in transcripts. A summary was smaller, but I could not always tell which source supported a statement or whether a newer decision had replaced it.\n\nSo I built Qarinah, an Apache-2.0 local project-memory compiler for coding agents.\n\nA large context window can hold more text, but it does not answer four important questions:\n\nReplaying the full history preserves information, but it also sends large amounts of irrelevant material. A single generated summary is smaller, but it becomes another authority that can omit or blur evidence. Ordinary embedding retrieval finds similar text, but similarity is not the same as authority, recency, or approval.\n\nQarinah keeps the source record and the context pack separate.\n\nPermitted decisions, tool outcomes, approvals, project structure, and evidence become typed events. Relations connect records such as supersedes, supports, blocks, and produced-by. Deterministic Markdown and JSON views remain inspectable in the repository. When a task begins, Qarinah retrieves a bounded pack and includes citations back to event IDs, hashes, and sources.\n\nThe result is not one giant memory prompt. It is a small evidence-linked pack built for the current task.\n\n| Approach | Useful for | What remains difficult |\n|---|---|---|\n| Full-history replay | Maximum raw recall | Repeated tokens, noise, stale decisions |\n| AGENTS.md or CLAUDE.md | Stable instructions | Tool outcomes and changing decisions |\n| Embedding retrieval | Similar passages | Authority, supersession, exact provenance |\n| Generated summary | Small handoff | Verifying omissions and source claims |\n| Qarinah | Compact project memory | Requires explicit workspace opt-in and capture policy |\n\nInstall it inside one project:\n\n```\nnpm install --save-dev qarinah\nnpx qarinah init . --capture content\nnpx qarinah scan\nnpx qarinah doctor\n```\n\nRecord a decision:\n\n```\nnpx qarinah record --kind decision \\\n  --title \"Use additive database migrations\" \\\n  --body \"Add, backfill, switch, then remove. Never rename a production column in place.\"\n```\n\nThen Codex, Claude Code, a CLI workflow, or an MCP client can request the smallest cited pack relevant to a task. The project owns the files. Qarinah does not require uploading the repository to a hosted Qarinah backend.\n\nThe committed evaluator compared full-history input with bounded Qarinah packs across six software tasks covering React editing, database migration, TypeScript refactoring, web research, production debugging, and governed release work.\n\nThe compared input changed from 442,113 estimated input-context tokens to 5,682. That is 98.71% less repeated context, or 77.81:1 compression, while every required target ranked in the top five. The repository includes the inputs, arithmetic, methodology, and machine-readable result.\n\nThis is a result for that task set, not a promise that every repository or total provider bill drops by exactly 98.71%. Output tokens, caching, tool calls, and provider pricing are separate.\n\nQarinah ships installable plugins for both hosts.\n\nCodex:\n\n```\ncodex plugin marketplace add AjnasNB/qarinah --ref v0.1.1\ncodex plugin add qarinah@qarinah\n```\n\nClaude Code:\n\n```\nclaude plugin marketplace add AjnasNB/qarinah@v0.1.1 --scope user\nclaude plugin install qarinah@qarinah --scope user\n```\n\nBoth can read the same opted-in local project memory. This does not copy private provider chat history between services. It gives both agents access to the same project-owned evidence.\n\nQarinah is open source and early. I am looking for real failure cases, especially:\n\nWebsite: [https://qarinah.io/](https://qarinah.io/)\n\nSource: [https://github.com/AjnasNB/qarinah](https://github.com/AjnasNB/qarinah)\n\nTechnical paper: [https://qarinah.io/paper/](https://qarinah.io/paper/)\n\nIf you test it, I would rather receive one reproducible failure than ten generic compliments. That is the fastest way to make the project useful.", "url": "https://wpnews.pro/news/i-stopped-replaying-my-entire-codebase-to-codex-and-claude-code", "canonical_source": "https://dev.to/ajnasnb7717/i-stopped-replaying-my-entire-codebase-to-codex-and-claude-code-5ha0", "published_at": "2026-07-25 14:13:03+00:00", "updated_at": "2026-07-25 14:32:09.714463+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "large-language-models"], "entities": ["AjnasNB", "Qarinah", "Codex", "Claude Code"], "alternates": {"html": "https://wpnews.pro/news/i-stopped-replaying-my-entire-codebase-to-codex-and-claude-code", "markdown": "https://wpnews.pro/news/i-stopped-replaying-my-entire-codebase-to-codex-and-claude-code.md", "text": "https://wpnews.pro/news/i-stopped-replaying-my-entire-codebase-to-codex-and-claude-code.txt", "jsonld": "https://wpnews.pro/news/i-stopped-replaying-my-entire-codebase-to-codex-and-claude-code.jsonld"}}