PromptHub
Developer Tools AI Engineering

Stop Losing AI Context: continues Rescues Your Coding Sessions

B

Bright Coding

Author

12 min read
17 views
Stop Losing AI Context: continues Rescues Your Coding Sessions

Stop Losing AI Context: continues Rescues Your Coding Sessions

You were this close. Thirty messages deep into debugging that authentication flow. File changes scattered across src/auth.ts, src/api/routes.ts, and tests/auth.test.ts. The AI finally understood your architecture — then bam. Rate limit. Four hours until reset. Your choices? Sit and fume, or start from zero in another tool and re-explain everything.

Sound familiar? This is the dirty secret of AI-assisted development in 2025. We're juggling Claude Code, GitHub Copilot, Gemini, Cursor, Codex — sometimes in the same afternoon — and none of them talk to each other. Your context, your reasoning chain, your hard-won architectural decisions? Trapped in silos.

Enter continues — a ruthlessly practical CLI tool that grabs your entire AI coding session from whichever tool you were using and hands it off to another one, intact. Conversation history, file changes, working state, even the AI's own reasoning. All of it comes along. No re-explaining. No starting over. Just npx continues and keep shipping.

What is continues?

continues is an open-source session transfer utility built by Yigit Konur that solves one of modern development's most infuriating friction points: AI tool lock-in through context fragmentation. It reads the native session formats of 16 different AI coding agents — from Claude Code's JSONL logs to OpenCode's SQLite databases — and generates structured handoff documents that let you resume work in any other supported tool.

The project exploded from a 7-tool prototype into a 240 cross-tool handoff path powerhouse thanks to rapid community contributions. Factory Droid support came first. Cursor AI followed with smart slug-to-path resolution. Then a flood of additions: Amp, Kiro, Crush, Cline, Roo Code, Kilo Code, Antigravity, Kimi CLI, and Qwen Code — reverse-engineered from mnemo's Go adapters and rebuilt in TypeScript.

Why it's trending now? AI coding tools are proliferating faster than standards can form. Developers are tool-agnostic by necessity — Claude for reasoning, Cursor for UI work, Codex for quick scripts — but each switch costs 15-30 minutes of context rebuilding. continues eliminates that tax entirely. With MIT licensing, zero install friction (npx continues), and read-only safety guarantees, it's becoming the connective tissue of the AI coding ecosystem.

Key Features That Make continues Essential

Any-to-Any Handoff Architecture — The core magic. Pick any of 16 source tools, pick any of 16 destinations. That's 240 possible transfers, all working out of the box. The tool doesn't just copy-paste chat logs; it reconstructs actionable context that the receiving agent can immediately work with.

Native Format Parsing — Each AI tool stores sessions differently. Claude Code uses JSONL in ~/.claude/projects/. Copilot splits between YAML and JSONL. OpenCode hides everything in SQLite. Crush uses its own .db file. continues reverse-engineered all of them:

Tool Format Location
Claude Code JSONL ~/.claude/projects/
Codex JSONL ~/.codex/sessions/
Copilot YAML + JSONL ~/.copilot/session-state/
Gemini CLI JSON ~/.gemini/tmp/*/chats/
OpenCode SQLite ~/.local/share/opencode/storage/
Cursor JSONL ~/.cursor/projects/*/agent-transcripts/
Crush SQLite ~/.crush/crush.db

Tool Activity Reconstruction — This is where continues transcends simple log copying. The handoff includes a structured Tool Activity section showing what was done, not just what was said:

## Tool Activity
- **Bash** (×47): `$ npm test → exit 0` · `$ git status → exit 0`
- **Edit** (×12): `edit src/auth.ts` · `edit src/api/routes.ts`
- **Grep** (×8): `grep "handleLogin" src/` · `grep "JWT_SECRET"`

Smart Verbosity Control — Four presets (minimal, standard, verbose, full) let you tune handoff depth based on your target tool's context window and your current needs. Token-constrained target? Use minimal with 3 messages. Debugging a complex multi-file refactor? full captures 50 messages and all subagent detail.

Read-Only Safety Guaranteecontinues never modifies your source session files. All reads are non-destructive, with an index cached at ~/.continues/sessions.jsonl (5-minute TTL, auto-refresh). Your original data stays pristine.

Environment Awareness — Running from a project directory? Sessions from that directory get prioritized. Supports custom config paths via CLAUDE_CONFIG_DIR, CODEX_HOME, GEMINI_CLI_HOME, and XDG_DATA_HOME overrides.

Real-World Use Cases Where continues Shines

The Rate Limit Escape Hatch

You're 30 messages into a Claude Code session, debugging a race condition in your token refresh logic. Claude hits the limit. Previously: four-hour wait or painful context rebuild. With continues:

continues resume abc123 --in gemini

Your full context — the edge case you were exploring, the files you'd modified, the failed test runs — transfers to Gemini CLI instantly. You keep debugging while Claude cools down.

The Multi-Tool Workflow Optimization

Different AI tools excel at different tasks. Start architecture discussions in Claude Code for its reasoning depth, switch to Cursor for UI component generation, finish with Codex for deployment script automation. continues makes this fluid instead of fractured.

The Team Handoff Scenario

You were pairing with GitHub Copilot CLI on a feature branch. Need to pass the session to a teammate who prefers Cline in VS Code? Export the structured context, they import and continue. No "let me explain what I was doing" meetings.

The CI/CD Pipeline Integration

Use continues list --json and continues dump all ./sessions --json to programmatically capture AI-assisted development sessions for compliance, auditing, or training data collection. The JSONL and JSON outputs integrate cleanly with existing data pipelines.

The Debugging Deep-Dive

Hit a wall with one tool's model? Transfer to another with different reasoning patterns. The --debug-prompt flag lets you inspect exactly what context would be injected before committing to the handoff:

continues resume abc123 --in codex --debug-prompt

Step-by-Step Installation & Setup Guide

Prerequisites

  • Node.js 22.5+ (required for built-in node:sqlite support used by OpenCode and Crush parsers)
  • At least one of the 16 supported AI coding tools installed

Installation Options

Zero-install (recommended for first try):

npx continues

This downloads and runs the latest version without leaving artifacts on your system. Perfect for evaluating whether continues fits your workflow.

Global install (for regular use):

npm install -g continues

This provides both the continues and cont commands globally. The cont shorthand saves keystrokes for frequent use.

Initial Verification

After installation, verify discovery is working:

continues scan

You should see output listing detected tools and session counts. If a tool you have installed isn't detected, check that its default session directory exists and that continues has read permissions.

Per-Project Configuration

For team consistency or personal preferences, create .continues.yml in your project root:

preset: verbose
recentMessages: 15
shell:
  maxSamples: 10
  stdoutLines: 20

Configuration resolution order (first match wins):

  1. --config <path> flag
  2. .continues.yml in current working directory
  3. ~/.continues/config.yml
  4. Built-in standard preset

See .continues.example.yml in the repository for the complete configuration reference.

Rebuilding the Session Index

If sessions seem stale or a newly-installed tool isn't appearing:

continues scan --rebuild
# or
continues rebuild

This forces a complete re-index of all discovered session directories.

REAL Code Examples from the Repository

Example 1: Basic Interactive Session Transfer

The simplest way to use continues is its interactive TUI. Just run:

npx continues

This launches the session picker interface:

┌  continues — pick up where you left off
│
│  Found 1842 sessions across 16 CLI tools
│    claude: 723  codex: 72  cursor: 68  copilot: 39  ...
│
◆  Select a session
│  [claude]   2026-02-19 05:28  my-project    Debugging SSH tunnel config   84a36c5d
│  [copilot]  2026-02-19 04:41  my-project    Migrate presets from Electron c2f5974c
│  [codex]    2026-02-18 23:12  my-project    Fix OpenCode SQLite parser    a1e90b3f
│  ...
└

◆  Continue in:
│  ○ Gemini   ○ Codex   ○ Amp   ○ Kiro   ...
└

What's happening under the hood: The tool scans all known session directories, builds an index with metadata (timestamp, project, description snippet, session ID), and presents a fuzzy-searchable list. When you select a destination, it generates the handoff document in the appropriate format and injects it into the target tool's session initialization. Running from within a project directory automatically surfaces sessions from that project first.

Example 2: Quick Resume Without the Picker

For speed, skip the TUI entirely and resume directly:

continues claude        # latest Claude session
continues codex 3       # 3rd most recent Codex session
continues amp           # latest Amp session
continues cline         # latest Cline session
continues kiro          # latest Kiro session
continues crush         # latest Crush session
continues kimi          # latest Kimi session
continues qwen-code     # latest Qwen Code session

Critical distinction: This uses native resume — same tool, full history, no context injection. It's not a cross-tool transfer; it's a faster way to re-enter a recent session in the tool that created it. The [n] parameter is 1-indexed (omit for 1, specify for Nth). This is perfect when you just need to get back to work quickly without any transformation overhead.

Example 3: Cross-Tool Handoff with Flag Passthrough

The flagship feature — transferring between different AI tools:

# Hit the Claude rate limit? Hand it off to Gemini:
continues resume abc123 --in gemini

# Pass flags through to the destination tool:
continues resume abc123 --in codex --yolo --search --add-dir /tmp

# Inspect the handoff prompt without launching:
continues resume abc123 --in codex --debug-prompt

Deep dive on flag mapping: continues maintains a mapping of common flags across tools. --yolo (auto-approve dangerous operations), --search (enable web search), --add-dir (include additional directories) — these get translated to each destination tool's equivalent syntax. Unrecognized flags pass through as-is, so you can use tool-specific options even during handoff.

The --debug-prompt flag is invaluable for understanding what the receiving AI will actually see. It writes the handoff file and prints the exact prompt, then exits without launching. Use this to verify context quality before committing to a transfer, or to debug why a handoff isn't working as expected.

Example 4: Bulk Export for Analysis and Backup

# Export all sessions to markdown (default)
continues dump all ./sessions

# Export specific tool's sessions
continues dump claude ./sessions/claude
continues dump gemini ./sessions/gemini

# Export as JSON for programmatic processing
continues dump all ./sessions --json

# Full verbosity for complete archival
continues dump all ./sessions --preset full

# Limit export to recent sessions
continues dump all ./sessions --limit 50

Output format: Files are named {source}_{id}.md or {source}_{id}.json depending on format. The --preset full option ensures nothing is lost — critical for compliance scenarios or when you're about to wipe a tool's storage. The --limit flag helps manage export size when you only need recent activity.

Example 5: Diagnostic Inspection

continues inspect abc123                              # diagnostic view
continues inspect abc123 --preset full --write-md handoff.md   # dump full markdown
continues inspect abc123 --truncate 50                # compact one-liner view

When to use each: Standard inspect shows parsed structure and what would be included in a handoff. --write-md generates the actual handoff document for external review or manual editing. --truncate 50 compresses everything to 50-character lines for quick scanning when you're hunting for a specific session among hundreds.

Advanced Usage & Best Practices

Optimize for Token Windows — Targeting a tool with tight context limits? Use --preset minimal and trim with .continues.yml:

recentMessages: 3
shell:
  maxSamples: 0  # omit tool execution samples entirely

Chain Handoffs Strategically — Complex debugging spanning multiple rate limits? Plan your tool sequence. Claude → Gemini → Codex gives you three model perspectives on the same problem without losing thread.

Version Your Session Exports — Use continues dump in CI to snapshot AI-assisted development for audit trails. The JSON output integrates with standard log aggregation:

continues dump all ./sessions --json --preset full
git add ./sessions && git commit -m "ai-session-snapshot: $(date -u +%Y%m%d%H%M%S)"

Leverage Native Resume for Speed — Same-tool resumption (continues claude) is faster than cross-tool handoff because it skips context transformation. Use it when you're not rate-limited.

Monitor Index Health — The 5-minute TTL cache means very recent sessions might not appear immediately. Use continues scan --rebuild if you're working across tools rapidly and need instant visibility.

Comparison with Alternatives

Approach Context Preservation Cross-Tool Speed Safety Setup
continues ✅ Full (messages, files, tool activity, reasoning) ✅ 16 tools, 240 paths ⚡ Instant ✅ Read-only npx continues
Manual copy-paste ❌ Chat only, no file state ✅ Any 🐢 Slow ✅ Safe None
Tool-native export/import ✅ Varies by tool ❌ Same tool only ⚡ Fast ✅ Safe Tool-specific
Custom scripts ⚠️ Fragile, breaks on format changes ⚠️ Limited ⚡ Fast ⚠️ Risk of writes High
Screen recording + AI summary ❌ Lossy reconstruction ✅ Any 🐢 Very slow ✅ Safe None

Why continues wins: It's the only solution that combines complete context fidelity with genuine cross-tool portability and zero setup friction. Manual methods lose file state and tool activity. Native exports trap you in one ecosystem. Custom scripts break when AI tools update their storage formats — continues handles this centrally with community-maintained parsers.

FAQ

Does continues modify my original session files?

No. All reads are strictly read-only. The tool builds its own index at ~/.continues/sessions.jsonl and never writes to source tool directories.

What happens if the target tool isn't installed?

continues generates the handoff document and attempts to launch the target tool. If it's not found, you'll get a clear error with installation guidance. Use --debug-prompt to inspect the handoff without launching.

How fresh is the session index?

Five-minute TTL with auto-refresh. For immediate visibility of very recent sessions, run continues scan --rebuild.

Can I use continues without installing it globally?

Yes — npx continues runs the latest version with zero persistent installation. Perfect for one-off transfers or evaluating the tool.

Does it work with self-hosted or enterprise AI tools?

The 16 supported tools cover the major public offerings. Enterprise variants using the same session storage formats should work, but custom enterprise builds may need parser contributions. The project welcomes PRs — see the Development section in the README.

What Node.js version do I need?

Node.js 22.5+ is required for the built-in node:sqlite module used by OpenCode and Crush parsers. Earlier versions will fail on these tools.

Can I automate continues in scripts?

Absolutely. Use continues list --json, continues list --jsonl -n 10, and continues dump for programmatic access. The JSON/JSONL outputs are stable and documented by example.

Conclusion

AI coding tools are finally powerful enough to transform how we build software. But they're still walled gardens, and every wall costs you context, momentum, and sanity. continues demolishes those walls — not by replacing your favorite tools, but by making them interoperable.

I've watched developers lose 30 minutes reconstructing context for a simple tool switch. Multiply that by daily switches across a team, across a month, across a year. The productivity tax is massive and invisible until you eliminate it.

continues is the elimination. One command. Full context. Any tool. Any time.

Stop starting over. Stop explaining twice. Stop letting rate limits dictate your workflow.

Get continues on GitHubnpx continues and never lose your place again.

Comments (0)

Comments are moderated before appearing.

No comments yet. Be the first to share your thoughts!

Recommended Prompts

View All
Support us! ☕