Your Coding Agent Finally Has a Memory — And It's Open Source
The Problem: Every Agent Session Starts from Zero
How ctx Works: Local, Private, and Blazingly Fast
If you've been using AI coding agents for any serious length of time, you've felt the pain. Your agents start every single session with a blank slate — no memory of the decisions made last week, the failed approaches they tried yesterday, or the specific constraints you laid out in the conversation before last. It's like hiring a brilliant engineer who suffers total amnesia every time they blink.
Enter ctx — an open-source CLI that does something so obvious in hindsight it's almost frustrating no one built it sooner: it indexes your entire coding agent history into a searchable local database and lets your current agent query it like an experienced senior dev tapping into years of institutional knowledge.
Launched last week by developer Luca C. and already sitting at 367 GitHub stars with active contributions, ctx is the kind of tool that makes you wonder how you tolerated the memory-less agent workflow for so long.
The beauty of ctx is that it doesn't try to reinvent the wheel. Your past agent sessions are already sitting on your machine — Claude Code stores transcripts locally, Codex keeps history files, Cursor archives everything. ctx simply discovers those sources, imports the real persisted records, and normalizes them into a structured SQLite database optimized for retrieval. No cloud sync, no API keys, no background daemon.
The numbers speak for themselves. According to the project's benchmarks, a raw transcript search blows through roughly 45,000 tokens to find what you need. ctx accomplishes the same task with just 917 tokens — a 50x efficiency gain. When you're paying per token on frontier models, that's not just a convenience improvement; it's a budget game-changer.
Here's what ctx supports out of the box:
- Supports Claude Code, Codex, Cursor, Pi, OpenCode, and more
- Indexes all past sessions into a local SQLite database
- 50x more token-efficient than raw transcript search
- Written in Rust — searches are instant, even across thousands of sessions
- Fully local and private — no cloud calls, no API keys needed
The CLI itself is refreshingly simple. A few commands and you're up and running:
- ctx search "failed migration" — finds every past attempt
- ctx search --file src/lib.rs — finds sessions touching that file
- ctx show event
— replays the exact context from a past session - ctx sql — run your own queries on the entire agent history
What makes this genuinely exciting isn't just the tool itself — it's what it signals about the maturation of the agentic coding ecosystem. We're moving past the phase where every agent is a standalone island, past the era of "vibes-based development" where agents produce code without context. The next phase — the one ctx is ushering in — is about agents that build on the work of their predecessors.
Think about what happens when every coding agent in your workflow can share a persistent, searchable institutional memory. The agent you run today can learn from the failed experiments of the agent you ran last week. The PR review agent can check whether a particular architectural decision was discussed and rejected in a past session. The onboarding agent can surface the exact conversation where your senior dev explained the database migration strategy.
Coding agent developers should be paying close attention. When the community starts treating agent history as a first-class resource — something to be indexed, searched, and referenced — the quality ceiling for automated code generation rises across the board. Tools like ctx aren't just nice-to-haves; they're the infrastructure layer that agentic coding has been missing.
The project is fully open-source under what appears to be a permissive license, hosted at github.com/ctxrs/ctx. Installation is a single curl command, and it takes about 30 seconds to index your first session. If you're running coding agents in any serious capacity, do yourself a favor: give them the memory they deserve.
Comments