Qarinah tool cuts AI coding agent context tokens by 98% using typed memory packs
A developer built Qarinah, an open-source local memory compiler for AI coding agents like Codex and Claude Code, to address the high cost and inefficiency of replaying entire codebases in long sessions. Instead of sending full project history or relying on generated summaries, Qarinah organizes project knowledge into typed events — decisions, tool outcomes, approvals — linked by relations such as supersedes and supports. When a new task begins, the tool retrieves a small, citation-linked context pack relevant only to that task, keeping source records and context packs separate. In a test across six software tasks, this approach reduced estimated input-context tokens from roughly 442,000 to about 5,700 — a compression ratio of nearly 78:1 — while maintaining retrieval accuracy. Qarinah is available as an npm package under the Apache-2.0 license and ships with plugins for both Codex and Claude Code.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in