Continuum

Inspiration

Every AI coding session starts from zero.

Close a tab, reach a context limit, switch from Claude to ChatGPT, or move to a new laptop, and everything the AI learned about your project can disappear:

  • Why you chose one approach over another
  • What you already tried
  • What failed and why
  • Which constraints must be preserved
  • What has already been completed
  • What still needs to be done

Developers end up explaining the same project context repeatedly instead of continuing their work.

We built Continuum around one principle:

A change of session should never force valuable work to begin again.


What It Does

Continuum is a local-first CLI and MCP server that captures an AI session, extracts the state that actually matters, and transfers it into a brand-new AI session without manual copy-pasting.

Capture

Import transcripts from:

  • Claude
  • ChatGPT
  • Codex 5.6, Claude Code, and other generic AI agents local session logs
  • Live session events captured while you work

Extract

Continuum analyzes raw conversation history and identifies structured project state, including:

  • Objectives
  • Decisions
  • Requirements
  • Constraints
  • Failed attempts
  • Completed work
  • Current progress
  • Next steps

Transfer

Continuum generates a layered, token-budgeted context package designed for the receiving model.

The context is organized into multiple levels:

  • L0: Immediate project orientation
  • L1: Current objectives and next actions
  • L2: Important decisions and constraints
  • L3: Detailed project history
  • L4: Full session archive

This allows users and models to load only the amount of context they need.

Resume Through MCP

A brand-new AI session can call the context.resume MCP tool and retrieve prior project state automatically.

No transcript copying, manual summaries, or context-file pasting is required.

Verify

Continuum checks whether the receiving session retained critical facts from the original session.

When important information is missing, Continuum can identify the gaps and generate repair context.

Protect

Before context leaves the local machine, Continuum scans it for sensitive information.

Users can choose to:

  • Redact secrets
  • Exclude sensitive content
  • Replace sensitive values with references

Scope

Continuum can resume:

  • The complete aggregated history of a project
  • A specific session selected by its session ID

Install

Continuum is published and installable from npm:

npm install -g @dhruv-techdev/continuum-cli

How We Built It

Continuum is built as a TypeScript monorepo managed with pnpm.

packages/
├── core/
├── cli/
├── mcp/
└── web/

packages/core

The core package contains:

  • Append-only event ledger
  • State extraction
  • Context generation
  • Verification
  • Capsule export and import
  • Transcript normalization
  • Timeline and search functionality

packages/cli

The CLI package provides the continuum command used to:

  • Import transcripts
  • Capture sessions
  • List projects and sessions
  • Generate context
  • Resume previous work
  • Verify transferred context
  • Export and import capsules

packages/mcp

The MCP package exposes Continuum functionality as tools that AI clients can call directly.

This includes tools such as:

context.resume

The receiving AI session can retrieve its own context instead of requiring the user to paste it manually.

packages/web

The web package provides the foundation for visualizing sessions, project state, timelines, and future shared-workspace features.


Storage Architecture

Continuum stores events in an append-only, hash-verified JSONL ledger.

Events are:

  • Never overwritten
  • Always ordered
  • Hash-verified
  • Preserved as an auditable history

This reduces the risk of information being silently removed or modified.

A SQLite database operates alongside the ledger to provide:

  • Fast search
  • Timeline queries
  • Session filtering
  • Project filtering
  • Full-text search

The JSONL ledger remains the source of truth, while SQLite acts as the query and indexing layer.


State Extraction

Continuum currently uses heuristic extraction to convert raw conversations into structured project facts.

It identifies information such as:

Objective
Decision
Constraint
Requirement
Failed attempt
Completed work
Next step

This process does not require an additional LLM call.

The goal is to preserve useful working state without introducing extra API cost, latency, or external data transfer.


Provider Adapters

AI providers expose transcripts in significantly different formats.

Continuum uses provider-specific adapters to normalize those formats into one canonical event schema.

Current adapters support:

  • Claude API exports
  • ChatGPT exports
  • Codex 5.6, Claude Code, and other generic AI agents local JSONL logs

Each adapter handles its provider's unique message structure, metadata, and bookkeeping events before producing standardized Continuum events.


Challenges We Ran Into

Format Archaeology

Codex 5.6, Claude Code, and other generic AI agents' local session logs use a completely different structure from Anthropic API exports.

The local logs contain JSONL records mixed with bookkeeping events such as:

queue-operation
file-history-snapshot
sidechain subagent turns

We had to reverse-engineer the format directly from real Codex 5.6, Claude Code, and other generic AI agents session files and separate actual conversation events from internal system records.

IDE Noise in Extracted State

Codex 5.6, Claude Code, and other generic AI agents embed tags such as the following directly inside user messages:

<ide_selection>
<system-reminder>

Our extractor initially interpreted some of this metadata as project decisions.

We identified the issue through live testing and added preprocessing to remove IDE-generated noise before extraction.

Disconnected Sources of Completed Work

Extracted completion statements and the explicit task tracker were stored in two separate systems.

The context builder originally read only from the task tracker, which meant completed work discovered by the extractor was silently excluded from generated context.

This bug appeared only when testing a real session resume.

Publishing pnpm Workspace Dependencies

The monorepo uses pnpm's workspace protocol:

workspace:*

Publishing packages with plain npm publish preserved the workspace dependency range and produced broken packages in the registry.

We corrected the publishing process, bumped the affected package versions, and republished using the appropriate pnpm workflow.

GitHub Secret Scanning

Some test fixtures contained fake Stripe and Slack keys.

GitHub push protection detected them as real secrets because its scanner identifies secret formats rather than validating whether credentials are active.

We restructured the fixture strings so secret-like patterns never appeared as contiguous values in the Git diff.

SQLite Test Segmentation Faults

better-sqlite3 caused segmentation faults under Vitest's default parallel worker configuration.

The problem was related to parallel test execution rather than application logic.

We fixed it by disabling file-level parallelism for the affected tests.


Accomplishments We Are Proud Of

Real Cross-Session Resume

We demonstrated a brand-new Codex 5.6, Claude Code, and other generic AI agents session calling the Continuum MCP server and correctly restoring context from a session it had never seen.

This was a working end-to-end resume, not a mockup or scripted simulation.

Zero-Copy-Paste Codex 5.6, Claude Code, and Other Generic AI Agents Capture

Continuum can import Codex 5.6, Claude Code, and other generic AI agents' local session logs directly.

Users do not need to manually export, summarize, or paste their conversations.

Published npm Packages

Continuum is available as real npm packages:

@dhruv-techdev/continuum-core
@dhruv-techdev/continuum-cli
@dhruv-techdev/continuum-mcp

We verified the published packages using clean installations in fresh environments rather than relying only on the development workspace.

Extensive Test Coverage

Continuum includes 988 passing tests covering:

  • Event ledger behavior
  • Provider adapters
  • State extraction
  • Verification
  • Context generation
  • CLI behavior
  • End-to-end subprocess execution

Session-Scoped Resume

Continuum originally resumed an entire project's aggregated history.

We added session-scoped resume so users can restore exactly one session instead of loading unrelated project history.


What We Learned

Memory Depends on Capture Quality

Continuum cannot preserve work that was never captured.

When a developer changes code manually without recording the event, the next resumed session may contain outdated state.

This is a real limitation of any system that reconstructs context from observable activity.

Transcript Formats Require Proper Abstractions

Transcript formats vary significantly across providers.

They can even differ between products from the same provider, such as Claude API exports and Codex 5.6, Claude Code, and other generic AI agents local logs.

A provider-adapter architecture is more reliable and maintainable than a single hardcoded parser.

Workspace Dependencies Require Careful Publishing

pnpm's workspace:* protocol is effective for monorepo development but requires the correct publishing workflow.

pnpm publish and npm publish do not handle internal workspace dependencies in the same way.

Real Sessions Reveal Different Bugs

Synthetic fixtures are useful, but they cannot reproduce every form of metadata, noise, incomplete state, or provider-specific behavior found in real sessions.

Testing Continuum against active development conversations exposed bugs that the synthetic test suite did not catch.


What Is Next

Additional Provider Adapters

We plan to improve support for ChatGPT export edge cases and add adapters for:

  • Cursor
  • Windsurf
  • OpenAI Codex
  • Additional AI development tools

Automatic Capture Hooks

Continuum currently supports explicit imports and live event capture.

Future versions will add automatic hooks that continuously record session activity without requiring a manual import after the session ends.

Team and Shared Workspace Sync

Continuum currently stores data locally under:

~/.continuum

The current implementation is machine-specific and does not automatically synchronize across devices or team members.

Future versions will support shared project workspaces and controlled team context synchronization.

Smarter State Extraction

The current extractor uses deterministic heuristics.

We plan to add an optional LLM-assisted extraction pass for long, ambiguous, or unstructured conversations while keeping local heuristic extraction as the default.

Optional Hosted Sync

We plan to introduce an optional hosted synchronization layer for securely sharing Continuum capsules across devices and teams.

Local-first operation will remain the default, and users will retain control over what information is synchronized.

Built With

  • aes-256-gcm
  • better-sqlite3
  • chatgpt
  • claude-code
  • cli
  • codex-5.6
  • commander.js
  • eslint
  • json-schema
  • jsonl
  • model-context-protocol-(mcp)
  • monorepo
  • node.js
  • npm
  • pnpm
  • prettier
  • sha-256
  • sqlite
  • tsx
  • typescript
  • vitest
  • zod
Share this project:

Updates