Skip to content

ctx

Instant recall for coding agents. Search the history already on your machine. Git blame, but for agent sessions.

Install

$git clone https://github.com/ctxrs/ctx

Install command taken from the project's README or registry entry. Always review code before running it.

You already have months of coding agent history on your machine. ctx lets you search it and blame code to the sessions that wrote it. ctx graph maps relationships across your codebase, and ctx sift cuts noisy tool output before your agent reads it.

Together it is an open, local, fast CLI toolchain for context engineering.

Install and set up ctx

macOS and Linux:

curl -fsSL https://ctx.rs/install | sh

Windows PowerShell:

irm https://ctx.rs/install.ps1 | iex

or prompt your agent:

Please install and set up ctx CLI (see github.com/ctxrs/ctx)

Building from source? See the source-build instructions.

Search your agent history

Coding agents have git history, but their own session transcripts and tool call records remain sequestered away in verbose log files. Those log files are a treasure trove of useful data, but they aren't accessible in a legible format for agents.

If you give your agents fast, easy access to search and retrieve these transcripts, your agents can:

  • surface decisions, constraints, and assumptions from earlier work
  • find investigations, solutions, and failed approaches already explored in previous sessions
  • audit previous sessions in detail
  • pick up where previous work left off, even across multiple threads

That means less repeated agent work, lower token spend, and better task outcomes because each new session can use the history already on your machine.

ctx also understands how parent sessions, subagents, and forks relate to one another, so agents can recover the whole chain of work no matter how aggressively you orchestrate.

This is different from “agent memory,” which usually compacts what happened into facts or summaries that can become stale. ctx gives agents instant recall of the real record without a lossy memory step.

Your past coding agent sessions already live on your machine, usually in JSONL files or SQLite databases under directories such as ~/.claude and ~/.codex.

ctx setup discovers those sources and reads them without modifying them. It converts each provider’s format into consistent local records for sessions, messages, tool calls, relationships, and repository activity, then stores and indexes those records locally.

ctx does not require hooks or any code running inside the agent process. Automatic indexing is on by default and keeps the index current as those history sources change. Each update is completed before it becomes visible, so commands never read a partially built index.

Every session and event receives a stable ctx ID and retains its complete transcript content and source information. ctx search finds the relevant history, ctx show retrieves the exact event or full transcript, and ctx locate identifies where it came from. Semantic search and Blame use those same records.

# Index all of your existing local agent sessions
ctx setup

# Your agent can search prior work with normal language
ctx search "failed migration"

# Search sessions and events that touched a file
ctx search --file crates/foo/src/lib.rs

# Or search multiple terms
ctx search --term "failed migration" --term rollback --term "cursor rename"

# Results include matching sessions, snippets, and ctx IDs
# evt_01h...  ses_01h...  codex  "migration expected the old cursor name" ...

# Print the matching part of the old transcript
ctx show event <ctx-event-id> --window 3

Similar plugs

Turn any codebase, with its docs, SQL schemas, configs, and PDFs, into a queryable knowledge graph. A /graphify skill for Claude Code, Cursor, Codex, and Gemini CLI: local…

Why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.

The 1st Collaborative AI Design Agent Workspace. Local-first and open source. Create prototypes, websites, apps, dashboards, presentations, images, and videos with your team…