cli-continues
CLAUDE.md1.6k starsChanged 8 months agoMITView on GitHub
continues is a CLI tool that lets users resume AI coding sessions across Claude Code, GitHub Copilot CLI, Gemini CLI, Codex CLI, OpenCode, Factory Droid, and Cursor AI. It reads each tool's native session storage (read-only), extracts context (messages, file changes, tool activity, AI reasoning), and injects it into a different tool as a structured markdown handoff document. Run a single test file: Requires Node.js 22+ (uses built-in node:sqlite for OpenCode parsing). src/types/index.ts
- Installs packages
Trending
Quiet since June.thin dataabout the whole repository
Who's talking about yigitkonur/cli-continues
- A Hacker News story“Show HN:`npx continues` – resume same session Claude, Gemini, Codex when limited”Hacker News · Feb 19, 2026 · 15 points
- @camilleroux.com“Un CLI pour transférer une session de coding IA d'un outil à l'autre : passez de Claude à Copilot ou Gemini …”Bluesky · Feb 26, 2026 · 5 likes
- hodanov/my-pde“[scan:scripts] ai-bridge にリクエスト履歴の永続化と `replay` サブコマンドを追加する”GitHub · Jun 28, 2026
The biggest 3 of 3 mentions linking to the repository that our crawl found. Each line is their own headline.
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Run a single test file:
- Distinctive: line 68
Add the new tool name to the union type:
- Very specific: line 81
Import shared utilities: import { cleanSummary, extractRepoFromCwd, homeDir } from '../utils/parser-helpers.js'.
- Very specific: line 84
Use SummaryCollector.add(category, summary, filePath?, isWrite?) to accumulate tool usage and track modified files.
- Very specific: line 85
Keep only the last ~10 messages in recentMessages for the handoff, but ensure at least one user message is included.
- Distinctive: line 90
Add an entry to the registry with all metadata, parser functions, and resume commands:
- Very specific: line 112
Create a createNewtoolFixture(): FixtureDir function that:
- Distinctive: line 125
Every code change should follow TDD discipline:
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What This Project Is
continues is a CLI tool that lets users resume AI coding sessions across Claude Code, GitHub Copilot CLI, Gemini CLI, Codex CLI, OpenCode, Factory Droid, and Cursor AI. It reads each tool's native session storage (read-only), extracts context (messages, file changes, tool activity, AI reasoning), and injects it into a different tool as a structured markdown handoff document.
Build & Development Commands
pnpm install # Install dependencies
pnpm run build # TypeScript compile (tsc) → dist/
pnpm run dev # Run with tsx (no build step)
pnpm test # Run unit tests (vitest)
pnpm run test:watch # Watch mode
pnpm run link # Build + pnpm link --global (local testing as `continues` / `cont`)Run a single test file:
npx vitest run src/__tests__/unit-conversions.test.tsRequires Node.js 22+ (uses built-in node:sqlite for OpenCode parsing).
Architecture
Core Flow
CLI (src/cli.ts) → Registry (src/parsers/registry.ts) → Index (src/utils/index.ts) → Parsers (src/parsers/*.ts) → Markdown (src/utils/markdown.ts) → Resume (src/utils/resume.ts)- Adapter Registry (
src/parsers/registry.ts): CentralToolAdapterinterface andadaptersrecord. Every supported CLI tool is registered here with its parser functions, resume commands, color, label, and storage path. All other modules derive their behavior from the registry — no manual switch statements or hardcoded tool lists. - CLI (
src/cli.ts): Commander-based CLI with interactive TUI (@clack/prompts). Handleslist,resume,scan,rebuild,pick, and per-tool quick-resume subcommands. Quick-resume commands and source colors are generated from the registry automatically. - Session Index (
src/utils/index.ts): Builds and caches a unified JSONL index at~/.continues/sessions.jsonl(5-min TTL). Calls all parsers in parallel viaPromise.allSettled(one broken parser won't crash the CLI), merges and sorts byupdatedAt. - Parsers (
src/parsers/*.ts): One file per tool. Each exportsparse<Tool>Sessions()(discovery + metadata) andextract<Tool>Context()(full conversation + tool activity extraction). Formats vary:claude.ts— JSONL files under~/.claude/projects/, streamed withreadlinecodex.ts— JSONL files under~/.codex/sessions/, streamed withreadlinecopilot.ts— YAML workspace + JSONL events under~/.copilot/session-state/gemini.ts— JSON files under~/.gemini/tmp/*/chats/opencode.ts— SQLite DB at~/.local/share/opencode/opencode.db(vianode:sqlite), with JSON file fallbackdroid.ts— JSONL + companion.settings.jsonunder~/.factory/sessions/<workspace-slug>/cursor.ts— JSONL agent transcripts under~/.cursor/projects/*/agent-transcripts/
- Shared Utilities (
src/utils/parser-helpers.ts): Common functions shared by parsers —cleanSummary(),extractRepoFromCwd(),homeDir(). - Tool Summarizer (
src/utils/tool-summarizer.ts):SummaryCollectorclass + formatting helpers (shellSummary,fileSummary,grepSummary, etc.) shared by all parsers to produce consistent one-line tool activity summaries. - Markdown Generator (
src/utils/markdown.ts):generateHandoffMarkdown()takes parsed session data and produces the structured handoff document with overview table, tool activity, key decisions, recent conversation, files modified, and pending tasks. - Resume (
src/utils/resume.ts): Handles both native resume (same tool) and cross-tool handoff. Uses the adapter registry for CLI binary names and argument patterns. For cross-tool: extracts context, saves.continues-handoff.mdto project dir, then spawns the target CLI with the inline or reference prompt.
Types
src/types/index.ts defines: SessionSource (union of 7 tool names), UnifiedSession, ConversationMessage, ToolCall, ToolUsageSummary, SessionNotes, SessionContext, HandoffOptions.
Adding a New Platform
Adding support for a new AI coding CLI (e.g. "newtool") requires changes in 3 files. Use codex.ts as the simplest reference parser.
1. Add to the SessionSource type — src/types/index.ts
Add the new tool name to the union type:
export type SessionSource = 'codex' | 'claude' | 'copilot' | 'gemini' | 'opencode' | 'droid' | 'cursor' | 'newtool';2. Create the parser — src/parsers/newtool.ts
Export two functions following the established pattern:
parseNewtoolSessions(): Promise<UnifiedSession[]>— Discovers session files from the tool's storage directory, reads metadata (id, cwd, repo, branch, timestamps, summary), and returnsUnifiedSession[]sorted byupdatedAtdescending.extractNewtoolContext(session: UnifiedSession): Promise<SessionContext>— Reads the full session, extractsConversationMessage[], usesSummaryCollectorfromtool-summarizer.tsto collect tool activity, and callsgenerateHandoffMarkdown()fromutils/markdown.tsto produce the final markdown. Returns aSessionContext.
Key patterns from existing parsers:
- Import shared utilities:
import { cleanSummary, extractRepoFromCwd, homeDir } from '../utils/parser-helpers.js'; - Session discovery: walk the tool's storage directory, filter by file extension/naming pattern.
- For JSONL formats: stream with
readline.createInterfaceto avoid loading entire files into memory. - Use
SummaryCollector.add(category, summary, filePath?, isWrite?)to accumulate tool usage and track modified files. - Keep only the last ~10 messages in
recentMessagesfor the handoff, but ensure at least one user message is included. - Silently skip files/sessions that fail to parse (
catch {}blocks).
3. Register in the adapter registry — src/parsers/registry.ts
Add an entry to the registry with all metadata, parser functions, and resume commands:
import { parseNewtoolSessions, extractNewtoolContext } from './newtool.js';
register({
name: 'newtool',
label: 'NewTool',
color: chalk.hex('#FF6600'),
storagePath: '~/.newtool/sessions/',
binaryName: 'newtool',
parseSessions: parseNewtoolSessions,
extractContext: extractNewtoolContext,
nativeResumeArgs: (s) => ['--resume', s.id],
crossToolArgs: (prompt) => [prompt],
resumeCommandDisplay: (s) => `newtool --resume ${s.id}`,
});That's it — the registry automatically wires the new tool into the CLI (quick-resume commands, source colors, help text, session index, resume logic). No switch statements or hardcoded arrays to update.
4. Add test fixtures — src/__tests__/fixtures/index.ts
Create a createNewtoolFixture(): FixtureDir function that:
- Creates a temp directory matching the tool's storage layout.
- Writes minimal but realistic session data (at least 2 user messages + 2 assistant messages).
- Returns
{ root, cleanup }.
Then add conversion test cases in src/__tests__/unit-conversions.test.ts covering the new tool as both source and target (N-1 new conversion paths for each direction).
Testing
Tests live in src/__tests__/. The vitest config (vitest.config.ts) excludes several test files by pattern: e2e*, real-e2e*, stress*, injection*, parsers.test*, conversions.test* (legacy file; the active suite is unit-conversions.test.ts). The primary test suite is unit-conversions.test.ts, which uses fixture data from src/__tests__/fixtures/index.ts to test all 42 cross-tool conversion paths (7 tools × 6 targets each) without requiring real session files on the machine.
Test-Driven Development
Every code change should follow TDD discipline:
- Write the test first — parser changes, new features, and bug fixes all start with a failing test.
- Ground fixtures in real schemas — before creating fixture data, read a real session file to verify field names and data structure. Use the Read tool or MCP to inspect the actual storage paths (
~/.claude/projects/,~/.codex/sessions/,~/.copilot/session-state/,~/.gemini/tmp/*/chats/,~/.local/share/opencode/,~/.factory/sessions/,~/.cursor/projects/*/agent-transcripts/). - If real session data isn't available — ask the user to provide a sample or point to the storage directory. Don't invent schemas from imagination.
Test file conventions
- Parser/conversion tests:
src/__tests__/unit-conversions.test.ts— the primary test suite (fixture-based, all conversion paths) - Utility tests: dedicated files (e.g.
src/__tests__/cwd-matching.test.ts) - Fixtures:
src/__tests__/fixtures/index.ts— onecreateXxxFixture()factory per tool
Minimum test coverage for PRs
- New parser: fixture factory + low-level parsing tests + all N-1 conversion paths in each direction
- New utility function: dedicated test file with edge cases
- Bug fix: regression test that reproduces the bug before the fix is applied
Key Conventions
- ESM-only (
"type": "module"in package.json). All local imports use.jsextensions. process.exitCodeis set instead of callingprocess.exit()directly.- The tool suppresses
ExperimentalWarningfromnode:sqliteat the top ofcli.ts. - Session data is read-only — the tool never modifies source session files.
- The index cache and handoff contexts are stored under
~/.continues/.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

