cc-continue
v1.4.0
Published
Switch context between AI coding agents — extract sessions from Claude Code, Codex, or OpenCode and generate handoff prompts
Maintainers
Readme
cc-continue
This package is being renamed to
ctx-switch. Installctx-switchfor the latest version.cc-continuewill continue to work but will no longer receive updates.
Switch context between AI coding agents. Extract sessions from Claude Code, Codex, or OpenCode and generate a handoff prompt you can paste into any other AI agent to keep going.
The Problem
You're deep in a coding session — the agent is editing files, running commands, making progress — and then:
Usage limit reached. Please wait before sending more messages.
Your work is half-done. You can't continue. You switch to another AI agent but now you have to explain everything from scratch.
The Solution
npx cc-continuePick your source agent, and it reads the session, captures the current git state, and produces a structured continuation prompt that another agent can pick up immediately.
Features
- Multi-source: Extract sessions from Claude Code, Codex, or OpenCode
- Interactive picker: Choose your source agent, or pass
--source claude|codex|opencode - Smart session discovery: Finds the latest session for the current project directory
- Filters noise from user messages (confirmations, short replies, interruptions)
- Tracks only unresolved errors — skips errors that were later fixed
- Captures recent commits, committed diffs, staged/unstaged changes, and untracked files
- Extracts key decisions and pivots from the previous agent
- Produces a priority-ordered prompt: Task → Errors → Decisions → Completed Work → Current State → Instructions
- Supports target-specific prompts with
--target codex|cursor|chatgpt|generic - Auto-copies to clipboard on macOS, Linux, and Windows
- Optional LLM refinement via
--refine(uses OpenRouter) sessionscommand to list recent sessionsdoctorcommand for diagnostics
Install
# Recommended: use the new package name
npm i -g ctx-switch
# Or the legacy name (still works)
npm i -g cc-continue
npx cc-continueUsage
cd my-project
# Interactive source picker (choose Claude/Codex/OpenCode)
cc-continue
# Specify the source directly
cc-continue --source claude
cc-continue --source codex
cc-continue --source opencode
# Target a specific agent for the output prompt
cc-continue --source claude --target codex
# Refine via OpenRouter LLM (optional)
cc-continue --refine
# List recent sessions
cc-continue sessions --source claude --limit 5
# Write to a file
cc-continue --output ./handoff.md
# Run diagnostics
cc-continue doctor --source codexLLM Refinement (Optional)
If you want the prompt refined by an LLM, use --refine. On first use, it'll ask for your OpenRouter API key:
Enter your OpenRouter API key: sk-or-v1-...
Saved to ~/.ctx-switch.jsonGet a free key at openrouter.ai/keys. You can also set it via environment variable:
export OPENROUTER_API_KEY=sk-or-v1-...Key Flags
--source <name>Session source:claude,codex, oropencode(interactive if omitted)--target <name>Tailor the prompt forgeneric,codex,cursor, orchatgpt--output <file>Write the prompt to a file--session <id|path>Use a specific session--refineRefine the prompt via an LLM provider--provider <name>Refinement provider (default:openrouter)--model <name>Override the provider model (default:openrouter/free)--api-key <key>Override the API key for a single run
Session Storage
| Source | Storage | Format |
|--------|---------|--------|
| Claude Code | ~/.claude/projects/<encoded-cwd>/*.jsonl | JSONL |
| Codex | ~/.codex/sessions/<year>/<month>/<day>/*.jsonl | JSONL |
| OpenCode | ~/.local/share/opencode/opencode.db | SQLite |
Requirements
- Node.js >= 18
- At least one of: Claude Code, Codex, or OpenCode (must have been used in the current directory)
- sqlite3 (only needed for OpenCode sessions)
- OpenRouter API key (only needed with
--refine)
Migrating to ctx-switch
npm uninstall -g cc-continue
npm i -g ctx-switchBoth ctx-switch and cc-continue commands work after installing either package.
License
MIT
