ctxrs/ctx
Search the coding agent history already on your machine
What it solves
Coding agents often lack memory of previous sessions, meaning they cannot recover the specific decisions, failed attempts, and commands used in earlier work. This leads to agents repeating mistakes or losing track of the intent and constraints established in prior discussions.
How it works
ctx is a Rust-based CLI tool that discovers and imports local history files from various coding agent harnesses (such as Cursor, Claude Code, and Windsurf). It normalizes this data into a local SQLite database optimized for retrieval. This allows current agents to search through past sessions using natural language, specific files, or terms, and then retrieve the exact event or session transcript for context.
Who it’s for
Developers using AI coding agents who want to provide their agents with a persistent, token-efficient way to access their historical project context.
Highlights
- Broad Agent Support: Supports a wide range of agent harnesses including Claude Code, Cursor, Windsurf, and GitHub Copilot CLI.
- Token Efficiency: Significantly reduces token usage compared to raw transcript search by returning ranked, cited matches rather than full transcripts.
- Local and Private: All indexing and search occur locally on the machine via SQLite, with no data sent to cloud services or model APIs.
- Agent-Ready: Provides a CLI that agents themselves can use to search and recover context from previous sessions.