ctx is a local CLI toolchain for context engineering around coding agents. It indexes the session transcripts and tool-call records that agents such as Claude Code, Codex, Cursor, Pi, and Gemini CLI already leave on your machine, so a new session can search earlier decisions, failed approaches, and assumptions instead of repeating the work. Unlike agent memory that compacts history into summaries, it returns the original record with citations.
Setup discovers each agent's history files, reads them without modifying them, and converts every provider's format into consistent records for sessions, messages, tool calls, relationships between parent sessions, subagents, and forks, and repository activity. It needs no hooks inside the agent process and keeps the index current automatically. Search uses BM25 lexical ranking by default, with optional semantic search on locally computed embeddings, and the index is built on Tantivy. Each result carries a stable ID that retrieves the exact event or full transcript.
ctx blame extends git blame to agents: starting from a file and line range, a commit, or a pull request, it finds the agent session that produced the change and cites the transcript and tool calls behind it, and it says so when it cannot prove an attribution. ctx graph is a Rust reimplementation of the Graphify code graph, stored in SQLite, that answers who calls a symbol, what depends on it, and what a change might break, and it reads existing Graphify indexes. ctx sift compacts noisy command output before the agent reads it, reversibly when original retention is on.
Everything runs locally by default. An optional ctx server backs up history or shares selected sessions with a team, and SDKs expose history search to TypeScript, Python, Rust, Go, JVM, Swift, and .NET code.
Features
- Agent history search: lexical and optional semantic search across local transcripts from Claude Code, Codex, Cursor, Pi, Gemini CLI, and more
- Cited retrieval: every session and event has a stable ID for retrieving the exact event, the full transcript, or its source
- Session relationships: links parent sessions, subagents, and forks so agents recover a whole chain of work
- Agent blame: trace a line range, commit, or pull request to the agent session that produced it, with citations
- Code graph: callers, callees, dependency paths, and impact queries over a SQLite-backed symbol graph
- Incremental graph updates: only changed files are re-indexed, and each update publishes as one complete generation
- Output compaction: sift trims repeated paths, logs, and formatting from tool output, with optional recovery of the original
- Agent integrations: a skill, an MCP server, and hooks for supported agents
- History sharing (beta): back up history or share selected sessions through a ctx server you control
- SDKs and plugins: history search from several languages, plus custom adapters for unsupported agent formats

