{"slug": "claude-code-and-codex-have-a-nasty-habit-of-treating-your", "title": "Claude Code and Codex have a nasty habit of treating your", "summary": "A new open-source tool called Qarinah reduces LLM coding agent context from over 442k tokens to about 5.6k tokens—a 98% reduction—by treating project knowledge as typed events with explicit relations like supersedes or blocks, rather than relying on standard RAG embeddings. The tool, created by AjnasNB, integrates with Codex and Claude Code to provide structured, evidence-linked memory that prevents agents from using deprecated or superseded information.", "body_md": "# Claude Code and Codex have a nasty habit of treating your\n\n## Why standard [RAG](/en/tags/rag/) fails coding agents\n\nMost people think a bigger window or basic embeddings solve memory. They don't. Embeddings find \"similar\" text, but similarity isn't the same as authority. A snippet from a deprecated README is \"similar\" to your current task, but it's functionally a lie. You need to know if a newer decision superseded an old one, and you need a citation to prove it.\n\nQarinah treats project knowledge as \"typed events\" (decisions, approvals, tool outcomes) with explicit relations like *supersedes* or *blocks*. Instead of dumping the whole history into the prompt, it builds a compact, evidence-linked pack specifically for the task at hand.\n\n## Real-world performance\n\nThe math on this is actually wild. In an evaluator covering things like TS refactoring and production debugging, the input context dropped from over 442k tokens to about 5.6k. That's a ~98% reduction in repeated context. While your actual bill won't drop by exactly 98% (thanks to output tokens and caching), it's a massive win for speed and accuracy.\n\n## AI workflow: Getting it running\n\nIf you want to stop the token bleed, here is the practical tutorial for setting it up.\n\n1. Install and init in your project:\n\n```\nnpm install --save-dev qarinah\nnpx qarinah init . --capture content\nnpx qarinah scan\nnpx qarinah doctor\n```\n\n2. Record a decision so the agent doesn't ask you for the 50th time:\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\n## Integrating with your tools\n\nYou can plug this directly into your LLM agent setup. It stays local, so you aren't uploading your whole repo to some random backend.\n\nFor Codex:\n\n```\ncodex plugin marketplace add AjnasNB/qarinah --ref v0.1.1\ncodex plugin add qarinah@qarinah\n```\n\nFor [Claude](/en/tags/claude/) Code:\n\n```\nclaude plugin marketplace add AjnasNB/[email protected] --scope user\nclaude plugin install qarinah@qarinah --scope user\n```\n\nThis turns your project memory into a structured database rather than a giant, expensive scroll of text. Your wallet (and your agent's sanity) will thank you.\n\n[Next PWA Caching: Why I'm skeptical of standard Service Workers →](/en/threads/3664/)", "url": "https://wpnews.pro/news/claude-code-and-codex-have-a-nasty-habit-of-treating-your", "canonical_source": "https://promptcube3.com/en/threads/3672/", "published_at": "2026-07-26 12:01:05+00:00", "updated_at": "2026-07-26 12:09:26.883718+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "large-language-models", "ai-tools"], "entities": ["Qarinah", "AjnasNB", "Codex", "Claude Code", "RAG"], "alternates": {"html": "https://wpnews.pro/news/claude-code-and-codex-have-a-nasty-habit-of-treating-your", "markdown": "https://wpnews.pro/news/claude-code-and-codex-have-a-nasty-habit-of-treating-your.md", "text": "https://wpnews.pro/news/claude-code-and-codex-have-a-nasty-habit-of-treating-your.txt", "jsonld": "https://wpnews.pro/news/claude-code-and-codex-have-a-nasty-habit-of-treating-your.jsonld"}}