← all repositories
ctxrs/ctx

A local SQLite index for coding agent amnesia

ctx turns months of local agent transcripts into a searchable, offline database so your next coding agent doesn't have to start from zero.

1k stars Rust Coding Assistants
ctx
Not currently ranked — collecting fresh signals.
star history

What it does ctx is a Rust CLI that imports local history files from coding agents—Claude Code, Codex, Cursor, and several others—into a local SQLite database. It lets you or your current agent search past sessions, events, and touched files with plain-language queries or read-only SQL. The whole thing runs offline with no background service, cloud upload, or API key.

The interesting bit Instead of compressing history into summaries or vector embeddings that strip away nuance, ctx keeps the original session and event structure intact. The project claims this is roughly 50× more token-efficient than feeding raw transcripts into context, which makes prior history actually retrievable rather than too bulky to use.

Key highlights

  • Discovers and imports histories from Claude Code, Codex, Cursor, Pi, OpenCode, Antigravity/Gemini CLI, Factory AI Droid, and Copilot CLI.
  • Searches run entirely offline against a local SQLite index; no network calls or model APIs required.
  • Returns ranked, cited matches with stable IDs, so agents can pull exact transcript snippets or full sessions on demand.
  • Ships with SDKs for TypeScript, Python, Go, Rust, JVM, Swift, and .NET.
  • Includes built-in docs, man-page generation, and a read-only SQL interface for inspecting the index.

Caveats

  • The index preserves raw transcript text, including local file paths and anything that looks like a secret, so you must review output before sharing it outside the machine.
  • Source builds and package-manager installs do not receive the signed self-upgrades available to official installer-managed binaries.

Verdict Worth a look if you juggle multiple agent harnesses and are tired of re-explaining context to every new session. Skip it if you already have a centralized memory pipeline you trust, or if you rarely generate local agent history to begin with.

Frequently asked

What is ctxrs/ctx?
ctx turns months of local agent transcripts into a searchable, offline database so your next coding agent doesn't have to start from zero.
Is ctx open source?
Yes — ctxrs/ctx is open source, released under the Apache-2.0 license.
What language is ctx written in?
ctxrs/ctx is primarily written in Rust.
How popular is ctx?
ctxrs/ctx has 1k stars on GitHub.
Where can I find ctx?
ctxrs/ctx is on GitHub at https://github.com/ctxrs/ctx.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.