# ctx

> Local context manager for Claude Code and Codex that keeps exact conversation bindings, enables clean work resumption, and supports safe context branching with SQLite storage.

ctx is a local-first context manager for Claude Code and Codex that solves transcript drift and context loss between AI coding sessions. It binds each workstream to the exact Claude and/or Codex conversation it originated from, so later pulls stay on the correct conversation instead of jumping to the newest chat on disk. Everything runs locally with no API keys required — data is stored in plain SQLite plus local files.

- **Exact transcript binding**: each internal ctx session binds to the precise Claude and/or Codex conversation it came from, preventing drift across sessions.
- **Safe branching**: use `ctx branch source-stream target-stream` to create a new workstream seeded from the current saved state of another without sharing future transcript pulls or hijacking the source conversation.
- **Workstream management**: start, resume, rename, delete, and list workstreams via `/ctx` slash commands in Claude Code or `ctx` subcommands in Codex.
- **Curated memory loads**: pin saved entries so they always load, exclude entries to keep them searchable without passing them back to the model, or delete them entirely via the `ctx curate` terminal UI.
- **Indexed retrieval**: saved workstreams, sessions, and entries are indexed for fast `ctx search` lookup across all stored context.
- **Local browser frontend**: run `ctx web --open` to browse, search, and copy continuation commands from an optional local browser UI.
- **Multiple install paths**: clone and run `./setup.sh` for a project-local setup, use `./setup.sh --global` for a shared global install, or bootstrap via `curl` for agent shell environments.
- **Multi-repo support**: set `ctx_DB` to a shared path so multiple repos can share the same context database.
- **No external dependencies**: no API keys, no hosted service — plain SQLite and local files only, with MIT license.

## Features
- Exact transcript binding to Claude and Codex conversations
- Safe workstream branching without mixing context streams
- Workstream start, resume, rename, delete, and list commands
- Curated memory loads with pin, exclude, and delete controls
- Indexed full-text search across saved workstreams and entries
- Local browser frontend via ctx web --open
- Compressed context loads with --compress flag
- Multi-repo support via shared SQLite DB path
- No API keys required — fully local-first
- Terminal curation UI for reviewing saved entries
- Agent shell bootstrap scripts for Claude Code and Codex terminals

## Integrations
Claude Code, OpenAI Codex, SQLite

## Platforms
WEB, API, CLI

## Pricing
Open Source

## Links
- Website: https://github.com/dchu917/ctx
- Documentation: https://github.com/dchu917/ctx/blob/main/README.md
- Repository: https://github.com/dchu917/ctx
- EveryDev.ai: https://www.everydev.ai/tools/ctx-context-manager
