AI Developer Tools
ctx
An open-source CLI for fast local search across your past coding agent sessions.
What is ctx?
ctx is an open-source command-line tool that indexes local coding agent history into a SQLite database, enabling fast, token-efficient search through past sessions, events, and file interactions.
ctx vs Similar AI Tools
| Pricing Model | Free | Free | Custom Pricing | Free, Paid |
| Free Credits | ||||
| Key Features |
|
|
|
|
| Pros |
|
|
|
|
| Cons |
|
|
|
|
| Best For |
|
|
|
|
How to use ctx?
- 1Install: curl -fsSL https://ctx.rs/install | sh
- 2Initialize and index existing sessions: ctx setup
- 3Search: ctx search "your query"
- 4Explore results: ctx show event <event-id> or ctx show session <session-id>
- 5(Optional) Install agent skill: npx skills add ctxrs/ctx
ctx Key Features
- Indexes local agent history from Claude Code, Codex, Cursor, Pi, OpenCode, and more
- Local SQLite storage for fast, private, scriptable search
- Token-efficient: returns ranked cited matches using 50x fewer tokens than raw transcript search
- Supports natural language queries and file-based search
- Read-only SQL access to indexed data
- Self-upgrading via official installer; open-source (Rust)
ctx Use Cases
- Recover decisions, constraints, and rejected approaches from past agent sessions
- Find previous failed attempts or bug investigations to avoid repeating them
- Search for commands, patches, or file paths agent touch in earlier work
- Provide current agent with context from historical sessions using cited IDs
ctx Pricing & Free Credits
ctx currently operates on a Free model.
This tool is completely free to use
ctx Pros & Cons
Pros
- Completely local and private by default
- Supports multiple coding agent harnesses out of the box
- Significant token savings compared to raw transcript search
- Open-source and scriptable (SQL queries, JSON output)
- No API keys or cloud service required
Cons
- Requires initial setup and indexing (new sessions only after indexing)
- Limited to supported agent history sources
- Transcript text is stored in plain text (caution with sensitive data when sharing)
- Only indexes sessions on the local machine
What is ctx best for?
- Developer teams using coding agents who need to retain context across sessions
- Individual developers wanting to avoid repeating mistakes or rediscover past decisions
- AI agent workflows that benefit from cited historical evidence