Repository files navigation

Continuum

Continuum gives coding agents durable, workspace-scoped memory. It stores complete observations, decisions, preferences, and lessons so later agents can recover useful context instead of repeating investigation.

MCP is the primary interface. The CLI exposes the same product behavior for scripting, testing, and recovery.

Continuum is intentionally not a task manager, session archive, generated Markdown memory system, summarization pipeline, embedding service, deletion interface, or cross-workspace search service.

Requirements and installation

Continuum requires Bun 1.4 or newer and the Git executable. A workspace need not itself be a Git repository: Git repositories are identified across clones and worktrees, while ordinary directories use path identity.

bun install
bun run setup
continuum --help

bun run setup installs dependencies and links the local continuum executable. During development, commands can also be run without a global link:

bun run continuum --help

MCP

Start the stdio server with:

continuum mcp

A typical MCP client configuration is:

{
"mcpServers": {
"continuum": {
"command": "continuum",
"args": ["mcp"]
}
}
}

The server exposes exactly five tools:

ToolPurposeKey annotations
continuum_guideReturn version-matched usage guidance.readOnlyHint: true, idempotentHint: true
continuum_summaryReturn the newest current records and logical workspace metadata.readOnlyHint: false, idempotentHint: true; may register the workspace
continuum_memory_recordStore one complete immutable record, optionally superseding older records.readOnlyHint: false, idempotentHint: false
continuum_memory_searchSearch by ordinary text or browse chronologically with filters and pagination.readOnlyHint: true, idempotentHint: true
continuum_memory_getRetrieve several exact record IDs and report missing IDs.readOnlyHint: true, idempotentHint: true

All tools have destructiveHint: false and openWorldHint: false. Inputs and successful structured outputs have strict schemas. The memory inputs are:

continuum_summary({ workspace,limit? })continuum_memory_record({ workspace, content,kind?,tags?,supersedes? })continuum_memory_search({
workspace,query?,tags?,kinds?,includeHistory?,limit?,cursor?,})continuum_memory_get({ workspace, ids })

MCP workspace is an absolute existing directory path. Successful calls return their data in structuredContent. Application failures set isError: true and return a compact safe JSON error envelope in text content; this avoids the pinned MCP SDK validating an error against the tool's success-only output schema. Invalid tool arguments use the MCP SDK's standard validation error result.

Practical workflow

  1. Call continuum_guide when orienting to the installed contract.
  2. Call continuum_summary with the absolute checkout path to recover recent current context.
  3. Search for concepts relevant to the work before and during investigation.
  4. Record concise, self-contained durable knowledge at useful checkpoints.
  5. When knowledge changes, record the replacement with the old IDs in supersedes.
  6. Browse chronologically when targeted search is insufficient, and use continuum_memory_get to follow exact historical references.

CLI

Successful product commands write one compact JSON value and a newline to stdout. Failures write one safe JSON error envelope to stderr and exit nonzero. Help and version output remain human-readable.

The CLI exposes exactly these commands:

continuum guide
continuum summary [--cwd <path>] [--limit <number>]
continuum record --content <text> [--cwd <path>] [--kind <kind>]
[--tag <tag>]... [--supersedes <id>]...
continuum search [--cwd <path>] [--query <text>] [--tag <tag>]...
[--kind <kind>]... [--include-history]
[--limit <number>] [--cursor <cursor>]
continuum get [--cwd <path>] <ids...>
continuum mcp

--cwd defaults to the process working directory. Relative values are resolved against that directory. Repeat --tag, --kind, or --supersedes for multiple values.

Examples:

continuum summary --cwd /work/project
continuum record \
--cwd /work/project \
--content 'The cache key includes the schema version.' \
--kind decision \
--tag cache \
--tag schema
continuum search --cwd /work/project --query 'cache schema' --tag cache
continuum search --cwd /work/project --include-history --limit 20
continuum get --cwd /work/project <record-id><older-record-id>

CLI results use the same core shapes as MCP: complete records contain id, kind, content, tags, createdAt, supersedes, and supersededBy; paged results contain records, hasMore, and nextCursor; exact retrieval also contains missingIds.

Memory behavior

Logical workspaces

Every memory operation identifies a workspace by path. Core normalizes the path and resolves it to one logical workspace in a central database.

An already registered path keeps its identity. Otherwise Continuum inspects Git remotes, prefers normalized origin, records other remotes as aliases, and falls back to the canonical path when no Git identity exists. Equivalent common SSH and HTTPS remote forms share identity. Re-clones and Git worktrees for the same remote therefore recover the same memory.

Continuum never silently merges or reassigns workspaces when path, descendant, or remote ownership conflicts. It returns a structured WORKSPACE_ERROR instead.

Immutable evidence and supersession

Records retain complete content and are immutable. Omitted kind defaults to observation; kinds are open-ended, trimmed, and lowercased. Tags are trimmed, lowercased, deduplicated, and sorted.

supersedes may reference only records in the same logical workspace. It adds relationships without rewriting old evidence. Search and summary hide superseded records by default. includeHistory: true includes them, and complete records show both supersedes and supersededBy IDs.

Canonical records, tags, supersession relationships, and FTS updates commit atomically.

Search, browse, summary, and get

An omitted or whitespace-only search query browses newest records by createdAt DESC, id DESC. A nonempty query is treated as ordinary text, escaped from FTS syntax, matched with SQLite FTS5, and ranked with BM25. Tags are weighted as strong retrieval anchors. A nonempty query with no searchable token returns an empty page rather than the unfiltered corpus.

Tag filters require every requested normalized tag. Kind filters accept any requested normalized kind. Superseded history is excluded unless includeHistory is true. Search defaults to 20 records and accepts limits from 1 through 100.

nextCursor is an opaque, versioned continuation token bound to the logical workspace, retrieval mode, normalized query and filters, history mode, and an internal record anchor. Page size may change between requests. Pagination is deterministic for an unchanged corpus; it is not a snapshot guarantee across concurrent writes, which may change BM25 ranking or current/history status.

continuum_summary registers or resolves the workspace and returns workspace identity metadata plus the newest current records. Its default limit is 10. Its cursor continues through an otherwise unfiltered chronological search.

Exact get accepts several IDs, returns complete records regardless of supersession, preserves first-request order after deduplication, and reports unavailable or wrong-workspace IDs in missingIds. Search and get do not register a truly unknown workspace; search returns an empty page and get reports its requested IDs missing.

Storage and failures

Continuum stores one local database at the first applicable location:

$CONTINUUM_DATA_DIR/continuum.db
$XDG_DATA_HOME/continuum/continuum.db
~/.local/share/continuum/continuum.db

The data directory and database are user-private on supported platforms. SQLite uses foreign keys, a 5-second busy timeout, WAL journal mode, synchronous = NORMAL, short transactions, and numbered migrations tracked with PRAGMA user_version. Canonical records remain authoritative; FTS is a rebuildable access path.

Core failures use the small code set WORKSPACE_ERROR, VALIDATION_ERROR, DATABASE_ERROR, and NOT_FOUND. They identify the failed operation and include only safe diagnostic context, never record content, SQL, or stack traces in adapter output.

Legacy v1 importer

tools/import-v1 is a separate one-time operational utility, not part of the MCP or main CLI surface.

Use a stable, checkpointed copy of the old SQLite database:

bun run tools/import-v1/src/index.ts \
--source /safe-copy/legacy.db \
--workspace /work/project \
[--data-dir /isolated/continuum-data]

The importer opens the source through immutable read-only SQLite, rejects nonempty WAL or rollback-journal sidecars, and rejects hard-linked or target-aliasing source files. It reads only raw journal rows. It preserves IDs and content, preserves canonical timestamps or losslessly normalizes equivalent explicit-timezone timestamps to UTC milliseconds, preserves kind semantics, and normalizes tags through core.

It ignores task data, consolidations and summaries, recall/session data, checkpoints, migration bookkeeping, provenance fields, and generated Markdown files. The entire source is structurally validated before target construction.

Repeated identical imports are idempotent. Reusing an ID for different canonical evidence or another workspace fails without overwrite. Imports are transactional per record rather than for the whole run: a safe prefix may remain after a later collision, and rerunning safely accepts that prefix before retrying the unresolved row.

Architecture

Continuum is a Bun workspace with explicit dependency direction:

apps/cli ───────→ packages/core
│
└───────────→ packages/mcp ───────→ packages/core
tools/import-v1 ──────────────────────→ packages/core
  • packages/core owns workspace identity, records, supersession, retrieval, summary, migrations, and SQLite persistence.
  • packages/mcp owns strict Zod schemas, MCP tool registration, result mapping, lifecycle, and stdio transport behavior.
  • apps/cli owns Commander parsing, finite JSON output, direct CLI composition, and the mcp command.
  • tools/import-v1 owns the isolated legacy source reader and import command.

The workspace packages are private architectural boundaries, not a published embedding SDK.

Development

See CONTRIBUTING.md for setup, focused test commands, migration guidance, privacy rules, and the full validation workflow. Product and architectural values live in AGENTS.md; coding defaults live in CODING_STANDARDS.md.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Continuum

Continuum gives coding agents durable, workspace-scoped memory. It stores complete observations, decisions, preferences, and lessons so later agents can recover useful context instead of repeating investigation.

MCP is the primary interface. The CLI exposes the same product behavior for scripting, testing, and recovery.

Continuum is intentionally not a task manager, session archive, generated Markdown memory system, summarization pipeline, embedding service, deletion interface, or cross-workspace search service.

Requirements and installation

Continuum requires Bun 1.4 or newer and the Git executable. A workspace need not itself be a Git repository: Git repositories are identified across clones and worktrees, while ordinary directories use path identity.

bun install
bun run setup
continuum --help

bun run setup installs dependencies and links the local continuum executable. During development, commands can also be run without a global link:

bun run continuum --help

MCP

Start the stdio server with:

continuum mcp

A typical MCP client configuration is:

{
"mcpServers": {
"continuum": {
"command": "continuum",
"args": ["mcp"]
}
}
}

The server exposes exactly five tools:

ToolPurposeKey annotations
continuum_guideReturn version-matched usage guidance.readOnlyHint: true, idempotentHint: true
continuum_summaryReturn the newest current records and logical workspace metadata.readOnlyHint: false, idempotentHint: true; may register the workspace
continuum_memory_recordStore one complete immutable record, optionally superseding older records.readOnlyHint: false, idempotentHint: false
continuum_memory_searchSearch by ordinary text or browse chronologically with filters and pagination.readOnlyHint: true, idempotentHint: true
continuum_memory_getRetrieve several exact record IDs and report missing IDs.readOnlyHint: true, idempotentHint: true

All tools have destructiveHint: false and openWorldHint: false. Inputs and successful structured outputs have strict schemas. The memory inputs are:

continuum_summary({ workspace,limit? })continuum_memory_record({ workspace, content,kind?,tags?,supersedes? })continuum_memory_search({
workspace,query?,tags?,kinds?,includeHistory?,limit?,cursor?,})continuum_memory_get({ workspace, ids })

MCP workspace is an absolute existing directory path. Successful calls return their data in structuredContent. Application failures set isError: true and return a compact safe JSON error envelope in text content; this avoids the pinned MCP SDK validating an error against the tool's success-only output schema. Invalid tool arguments use the MCP SDK's standard validation error result.

Practical workflow

  1. Call continuum_guide when orienting to the installed contract.
  2. Call continuum_summary with the absolute checkout path to recover recent current context.
  3. Search for concepts relevant to the work before and during investigation.
  4. Record concise, self-contained durable knowledge at useful checkpoints.
  5. When knowledge changes, record the replacement with the old IDs in supersedes.
  6. Browse chronologically when targeted search is insufficient, and use continuum_memory_get to follow exact historical references.

CLI

Successful product commands write one compact JSON value and a newline to stdout. Failures write one safe JSON error envelope to stderr and exit nonzero. Help and version output remain human-readable.

The CLI exposes exactly these commands:

continuum guide
continuum summary [--cwd <path>] [--limit <number>]
continuum record --content <text> [--cwd <path>] [--kind <kind>]
[--tag <tag>]... [--supersedes <id>]...
continuum search [--cwd <path>] [--query <text>] [--tag <tag>]...
[--kind <kind>]... [--include-history]
[--limit <number>] [--cursor <cursor>]
continuum get [--cwd <path>] <ids...>
continuum mcp

--cwd defaults to the process working directory. Relative values are resolved against that directory. Repeat --tag, --kind, or --supersedes for multiple values.

Examples:

continuum summary --cwd /work/project
continuum record \
--cwd /work/project \
--content 'The cache key includes the schema version.' \
--kind decision \
--tag cache \
--tag schema
continuum search --cwd /work/project --query 'cache schema' --tag cache
continuum search --cwd /work/project --include-history --limit 20
continuum get --cwd /work/project <record-id><older-record-id>

CLI results use the same core shapes as MCP: complete records contain id, kind, content, tags, createdAt, supersedes, and supersededBy; paged results contain records, hasMore, and nextCursor; exact retrieval also contains missingIds.

Memory behavior

Logical workspaces

Every memory operation identifies a workspace by path. Core normalizes the path and resolves it to one logical workspace in a central database.

An already registered path keeps its identity. Otherwise Continuum inspects Git remotes, prefers normalized origin, records other remotes as aliases, and falls back to the canonical path when no Git identity exists. Equivalent common SSH and HTTPS remote forms share identity. Re-clones and Git worktrees for the same remote therefore recover the same memory.

Continuum never silently merges or reassigns workspaces when path, descendant, or remote ownership conflicts. It returns a structured WORKSPACE_ERROR instead.

Immutable evidence and supersession

Records retain complete content and are immutable. Omitted kind defaults to observation; kinds are open-ended, trimmed, and lowercased. Tags are trimmed, lowercased, deduplicated, and sorted.

supersedes may reference only records in the same logical workspace. It adds relationships without rewriting old evidence. Search and summary hide superseded records by default. includeHistory: true includes them, and complete records show both supersedes and supersededBy IDs.

Canonical records, tags, supersession relationships, and FTS updates commit atomically.

Search, browse, summary, and get

An omitted or whitespace-only search query browses newest records by createdAt DESC, id DESC. A nonempty query is treated as ordinary text, escaped from FTS syntax, matched with SQLite FTS5, and ranked with BM25. Tags are weighted as strong retrieval anchors. A nonempty query with no searchable token returns an empty page rather than the unfiltered corpus.

Tag filters require every requested normalized tag. Kind filters accept any requested normalized kind. Superseded history is excluded unless includeHistory is true. Search defaults to 20 records and accepts limits from 1 through 100.

nextCursor is an opaque, versioned continuation token bound to the logical workspace, retrieval mode, normalized query and filters, history mode, and an internal record anchor. Page size may change between requests. Pagination is deterministic for an unchanged corpus; it is not a snapshot guarantee across concurrent writes, which may change BM25 ranking or current/history status.

continuum_summary registers or resolves the workspace and returns workspace identity metadata plus the newest current records. Its default limit is 10. Its cursor continues through an otherwise unfiltered chronological search.

Exact get accepts several IDs, returns complete records regardless of supersession, preserves first-request order after deduplication, and reports unavailable or wrong-workspace IDs in missingIds. Search and get do not register a truly unknown workspace; search returns an empty page and get reports its requested IDs missing.

Storage and failures

Continuum stores one local database at the first applicable location:

$CONTINUUM_DATA_DIR/continuum.db
$XDG_DATA_HOME/continuum/continuum.db
~/.local/share/continuum/continuum.db

The data directory and database are user-private on supported platforms. SQLite uses foreign keys, a 5-second busy timeout, WAL journal mode, synchronous = NORMAL, short transactions, and numbered migrations tracked with PRAGMA user_version. Canonical records remain authoritative; FTS is a rebuildable access path.

Core failures use the small code set WORKSPACE_ERROR, VALIDATION_ERROR, DATABASE_ERROR, and NOT_FOUND. They identify the failed operation and include only safe diagnostic context, never record content, SQL, or stack traces in adapter output.

Legacy v1 importer

tools/import-v1 is a separate one-time operational utility, not part of the MCP or main CLI surface.

Use a stable, checkpointed copy of the old SQLite database:

bun run tools/import-v1/src/index.ts \
--source /safe-copy/legacy.db \
--workspace /work/project \
[--data-dir /isolated/continuum-data]

The importer opens the source through immutable read-only SQLite, rejects nonempty WAL or rollback-journal sidecars, and rejects hard-linked or target-aliasing source files. It reads only raw journal rows. It preserves IDs and content, preserves canonical timestamps or losslessly normalizes equivalent explicit-timezone timestamps to UTC milliseconds, preserves kind semantics, and normalizes tags through core.

It ignores task data, consolidations and summaries, recall/session data, checkpoints, migration bookkeeping, provenance fields, and generated Markdown files. The entire source is structurally validated before target construction.

Repeated identical imports are idempotent. Reusing an ID for different canonical evidence or another workspace fails without overwrite. Imports are transactional per record rather than for the whole run: a safe prefix may remain after a later collision, and rerunning safely accepts that prefix before retrying the unresolved row.

Architecture

Continuum is a Bun workspace with explicit dependency direction:

apps/cli ───────→ packages/core
│
└───────────→ packages/mcp ───────→ packages/core
tools/import-v1 ──────────────────────→ packages/core
  • packages/core owns workspace identity, records, supersession, retrieval, summary, migrations, and SQLite persistence.
  • packages/mcp owns strict Zod schemas, MCP tool registration, result mapping, lifecycle, and stdio transport behavior.
  • apps/cli owns Commander parsing, finite JSON output, direct CLI composition, and the mcp command.
  • tools/import-v1 owns the isolated legacy source reader and import command.

The workspace packages are private architectural boundaries, not a published embedding SDK.

Development

See CONTRIBUTING.md for setup, focused test commands, migration guidance, privacy rules, and the full validation workflow. Product and architectural values live in AGENTS.md; coding defaults live in CODING_STANDARDS.md.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Continuum

Continuum gives coding agents durable, workspace-scoped memory. It stores complete observations, decisions, preferences, and lessons so later agents can recover useful context instead of repeating investigation.

MCP is the primary interface. The CLI exposes the same product behavior for scripting, testing, and recovery.

Continuum is intentionally not a task manager, session archive, generated Markdown memory system, summarization pipeline, embedding service, deletion interface, or cross-workspace search service.

Requirements and installation

Continuum requires Bun 1.4 or newer and the Git executable. A workspace need not itself be a Git repository: Git repositories are identified across clones and worktrees, while ordinary directories use path identity.

bun install
bun run setup
continuum --help

bun run setup installs dependencies and links the local continuum executable. During development, commands can also be run without a global link:

bun run continuum --help

MCP

Start the stdio server with:

continuum mcp

A typical MCP client configuration is:

{
"mcpServers": {
"continuum": {
"command": "continuum",
"args": ["mcp"]
}
}
}

The server exposes exactly five tools:

ToolPurposeKey annotations
continuum_guideReturn version-matched usage guidance.readOnlyHint: true, idempotentHint: true
continuum_summaryReturn the newest current records and logical workspace metadata.readOnlyHint: false, idempotentHint: true; may register the workspace
continuum_memory_recordStore one complete immutable record, optionally superseding older records.readOnlyHint: false, idempotentHint: false
continuum_memory_searchSearch by ordinary text or browse chronologically with filters and pagination.readOnlyHint: true, idempotentHint: true
continuum_memory_getRetrieve several exact record IDs and report missing IDs.readOnlyHint: true, idempotentHint: true

All tools have destructiveHint: false and openWorldHint: false. Inputs and successful structured outputs have strict schemas. The memory inputs are:

continuum_summary({ workspace,limit? })continuum_memory_record({ workspace, content,kind?,tags?,supersedes? })continuum_memory_search({
workspace,query?,tags?,kinds?,includeHistory?,limit?,cursor?,})continuum_memory_get({ workspace, ids })

MCP workspace is an absolute existing directory path. Successful calls return their data in structuredContent. Application failures set isError: true and return a compact safe JSON error envelope in text content; this avoids the pinned MCP SDK validating an error against the tool's success-only output schema. Invalid tool arguments use the MCP SDK's standard validation error result.

Practical workflow

  1. Call continuum_guide when orienting to the installed contract.
  2. Call continuum_summary with the absolute checkout path to recover recent current context.
  3. Search for concepts relevant to the work before and during investigation.
  4. Record concise, self-contained durable knowledge at useful checkpoints.
  5. When knowledge changes, record the replacement with the old IDs in supersedes.
  6. Browse chronologically when targeted search is insufficient, and use continuum_memory_get to follow exact historical references.

CLI

Successful product commands write one compact JSON value and a newline to stdout. Failures write one safe JSON error envelope to stderr and exit nonzero. Help and version output remain human-readable.

The CLI exposes exactly these commands:

continuum guide
continuum summary [--cwd <path>] [--limit <number>]
continuum record --content <text> [--cwd <path>] [--kind <kind>]
[--tag <tag>]... [--supersedes <id>]...
continuum search [--cwd <path>] [--query <text>] [--tag <tag>]...
[--kind <kind>]... [--include-history]
[--limit <number>] [--cursor <cursor>]
continuum get [--cwd <path>] <ids...>
continuum mcp

--cwd defaults to the process working directory. Relative values are resolved against that directory. Repeat --tag, --kind, or --supersedes for multiple values.

Examples:

continuum summary --cwd /work/project
continuum record \
--cwd /work/project \
--content 'The cache key includes the schema version.' \
--kind decision \
--tag cache \
--tag schema
continuum search --cwd /work/project --query 'cache schema' --tag cache
continuum search --cwd /work/project --include-history --limit 20
continuum get --cwd /work/project <record-id><older-record-id>

CLI results use the same core shapes as MCP: complete records contain id, kind, content, tags, createdAt, supersedes, and supersededBy; paged results contain records, hasMore, and nextCursor; exact retrieval also contains missingIds.

Memory behavior

Logical workspaces

Every memory operation identifies a workspace by path. Core normalizes the path and resolves it to one logical workspace in a central database.

An already registered path keeps its identity. Otherwise Continuum inspects Git remotes, prefers normalized origin, records other remotes as aliases, and falls back to the canonical path when no Git identity exists. Equivalent common SSH and HTTPS remote forms share identity. Re-clones and Git worktrees for the same remote therefore recover the same memory.

Continuum never silently merges or reassigns workspaces when path, descendant, or remote ownership conflicts. It returns a structured WORKSPACE_ERROR instead.

Immutable evidence and supersession

Records retain complete content and are immutable. Omitted kind defaults to observation; kinds are open-ended, trimmed, and lowercased. Tags are trimmed, lowercased, deduplicated, and sorted.

supersedes may reference only records in the same logical workspace. It adds relationships without rewriting old evidence. Search and summary hide superseded records by default. includeHistory: true includes them, and complete records show both supersedes and supersededBy IDs.

Canonical records, tags, supersession relationships, and FTS updates commit atomically.

Search, browse, summary, and get

An omitted or whitespace-only search query browses newest records by createdAt DESC, id DESC. A nonempty query is treated as ordinary text, escaped from FTS syntax, matched with SQLite FTS5, and ranked with BM25. Tags are weighted as strong retrieval anchors. A nonempty query with no searchable token returns an empty page rather than the unfiltered corpus.

Tag filters require every requested normalized tag. Kind filters accept any requested normalized kind. Superseded history is excluded unless includeHistory is true. Search defaults to 20 records and accepts limits from 1 through 100.

nextCursor is an opaque, versioned continuation token bound to the logical workspace, retrieval mode, normalized query and filters, history mode, and an internal record anchor. Page size may change between requests. Pagination is deterministic for an unchanged corpus; it is not a snapshot guarantee across concurrent writes, which may change BM25 ranking or current/history status.

continuum_summary registers or resolves the workspace and returns workspace identity metadata plus the newest current records. Its default limit is 10. Its cursor continues through an otherwise unfiltered chronological search.

Exact get accepts several IDs, returns complete records regardless of supersession, preserves first-request order after deduplication, and reports unavailable or wrong-workspace IDs in missingIds. Search and get do not register a truly unknown workspace; search returns an empty page and get reports its requested IDs missing.

Storage and failures

Continuum stores one local database at the first applicable location:

$CONTINUUM_DATA_DIR/continuum.db
$XDG_DATA_HOME/continuum/continuum.db
~/.local/share/continuum/continuum.db

The data directory and database are user-private on supported platforms. SQLite uses foreign keys, a 5-second busy timeout, WAL journal mode, synchronous = NORMAL, short transactions, and numbered migrations tracked with PRAGMA user_version. Canonical records remain authoritative; FTS is a rebuildable access path.

Core failures use the small code set WORKSPACE_ERROR, VALIDATION_ERROR, DATABASE_ERROR, and NOT_FOUND. They identify the failed operation and include only safe diagnostic context, never record content, SQL, or stack traces in adapter output.

Legacy v1 importer

tools/import-v1 is a separate one-time operational utility, not part of the MCP or main CLI surface.

Use a stable, checkpointed copy of the old SQLite database:

bun run tools/import-v1/src/index.ts \
--source /safe-copy/legacy.db \
--workspace /work/project \
[--data-dir /isolated/continuum-data]

The importer opens the source through immutable read-only SQLite, rejects nonempty WAL or rollback-journal sidecars, and rejects hard-linked or target-aliasing source files. It reads only raw journal rows. It preserves IDs and content, preserves canonical timestamps or losslessly normalizes equivalent explicit-timezone timestamps to UTC milliseconds, preserves kind semantics, and normalizes tags through core.

It ignores task data, consolidations and summaries, recall/session data, checkpoints, migration bookkeeping, provenance fields, and generated Markdown files. The entire source is structurally validated before target construction.

Repeated identical imports are idempotent. Reusing an ID for different canonical evidence or another workspace fails without overwrite. Imports are transactional per record rather than for the whole run: a safe prefix may remain after a later collision, and rerunning safely accepts that prefix before retrying the unresolved row.

Architecture

Continuum is a Bun workspace with explicit dependency direction:

apps/cli ───────→ packages/core
│
└───────────→ packages/mcp ───────→ packages/core
tools/import-v1 ──────────────────────→ packages/core
  • packages/core owns workspace identity, records, supersession, retrieval, summary, migrations, and SQLite persistence.
  • packages/mcp owns strict Zod schemas, MCP tool registration, result mapping, lifecycle, and stdio transport behavior.
  • apps/cli owns Commander parsing, finite JSON output, direct CLI composition, and the mcp command.
  • tools/import-v1 owns the isolated legacy source reader and import command.

The workspace packages are private architectural boundaries, not a published embedding SDK.

Development

See CONTRIBUTING.md for setup, focused test commands, migration guidance, privacy rules, and the full validation workflow. Product and architectural values live in AGENTS.md; coding defaults live in CODING_STANDARDS.md.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Continuum

Continuum gives coding agents durable, workspace-scoped memory. It stores complete observations, decisions, preferences, and lessons so later agents can recover useful context instead of repeating investigation.

MCP is the primary interface. The CLI exposes the same product behavior for scripting, testing, and recovery.

Continuum is intentionally not a task manager, session archive, generated Markdown memory system, summarization pipeline, embedding service, deletion interface, or cross-workspace search service.

Requirements and installation

Continuum requires Bun 1.4 or newer and the Git executable. A workspace need not itself be a Git repository: Git repositories are identified across clones and worktrees, while ordinary directories use path identity.

bun install
bun run setup
continuum --help

bun run setup installs dependencies and links the local continuum executable. During development, commands can also be run without a global link:

bun run continuum --help

MCP

Start the stdio server with:

continuum mcp

A typical MCP client configuration is:

{
"mcpServers": {
"continuum": {
"command": "continuum",
"args": ["mcp"]
}
}
}

The server exposes exactly five tools:

ToolPurposeKey annotations
continuum_guideReturn version-matched usage guidance.readOnlyHint: true, idempotentHint: true
continuum_summaryReturn the newest current records and logical workspace metadata.readOnlyHint: false, idempotentHint: true; may register the workspace
continuum_memory_recordStore one complete immutable record, optionally superseding older records.readOnlyHint: false, idempotentHint: false
continuum_memory_searchSearch by ordinary text or browse chronologically with filters and pagination.readOnlyHint: true, idempotentHint: true
continuum_memory_getRetrieve several exact record IDs and report missing IDs.readOnlyHint: true, idempotentHint: true

All tools have destructiveHint: false and openWorldHint: false. Inputs and successful structured outputs have strict schemas. The memory inputs are:

continuum_summary({ workspace,limit? })continuum_memory_record({ workspace, content,kind?,tags?,supersedes? })continuum_memory_search({
workspace,query?,tags?,kinds?,includeHistory?,limit?,cursor?,})continuum_memory_get({ workspace, ids })

MCP workspace is an absolute existing directory path. Successful calls return their data in structuredContent. Application failures set isError: true and return a compact safe JSON error envelope in text content; this avoids the pinned MCP SDK validating an error against the tool's success-only output schema. Invalid tool arguments use the MCP SDK's standard validation error result.

Practical workflow

  1. Call continuum_guide when orienting to the installed contract.
  2. Call continuum_summary with the absolute checkout path to recover recent current context.
  3. Search for concepts relevant to the work before and during investigation.
  4. Record concise, self-contained durable knowledge at useful checkpoints.
  5. When knowledge changes, record the replacement with the old IDs in supersedes.
  6. Browse chronologically when targeted search is insufficient, and use continuum_memory_get to follow exact historical references.

CLI

Successful product commands write one compact JSON value and a newline to stdout. Failures write one safe JSON error envelope to stderr and exit nonzero. Help and version output remain human-readable.

The CLI exposes exactly these commands:

continuum guide
continuum summary [--cwd <path>] [--limit <number>]
continuum record --content <text> [--cwd <path>] [--kind <kind>]
[--tag <tag>]... [--supersedes <id>]...
continuum search [--cwd <path>] [--query <text>] [--tag <tag>]...
[--kind <kind>]... [--include-history]
[--limit <number>] [--cursor <cursor>]
continuum get [--cwd <path>] <ids...>
continuum mcp

--cwd defaults to the process working directory. Relative values are resolved against that directory. Repeat --tag, --kind, or --supersedes for multiple values.

Examples:

continuum summary --cwd /work/project
continuum record \
--cwd /work/project \
--content 'The cache key includes the schema version.' \
--kind decision \
--tag cache \
--tag schema
continuum search --cwd /work/project --query 'cache schema' --tag cache
continuum search --cwd /work/project --include-history --limit 20
continuum get --cwd /work/project <record-id><older-record-id>

CLI results use the same core shapes as MCP: complete records contain id, kind, content, tags, createdAt, supersedes, and supersededBy; paged results contain records, hasMore, and nextCursor; exact retrieval also contains missingIds.

Memory behavior

Logical workspaces

Every memory operation identifies a workspace by path. Core normalizes the path and resolves it to one logical workspace in a central database.

An already registered path keeps its identity. Otherwise Continuum inspects Git remotes, prefers normalized origin, records other remotes as aliases, and falls back to the canonical path when no Git identity exists. Equivalent common SSH and HTTPS remote forms share identity. Re-clones and Git worktrees for the same remote therefore recover the same memory.

Continuum never silently merges or reassigns workspaces when path, descendant, or remote ownership conflicts. It returns a structured WORKSPACE_ERROR instead.

Immutable evidence and supersession

Records retain complete content and are immutable. Omitted kind defaults to observation; kinds are open-ended, trimmed, and lowercased. Tags are trimmed, lowercased, deduplicated, and sorted.

supersedes may reference only records in the same logical workspace. It adds relationships without rewriting old evidence. Search and summary hide superseded records by default. includeHistory: true includes them, and complete records show both supersedes and supersededBy IDs.

Canonical records, tags, supersession relationships, and FTS updates commit atomically.

Search, browse, summary, and get

An omitted or whitespace-only search query browses newest records by createdAt DESC, id DESC. A nonempty query is treated as ordinary text, escaped from FTS syntax, matched with SQLite FTS5, and ranked with BM25. Tags are weighted as strong retrieval anchors. A nonempty query with no searchable token returns an empty page rather than the unfiltered corpus.

Tag filters require every requested normalized tag. Kind filters accept any requested normalized kind. Superseded history is excluded unless includeHistory is true. Search defaults to 20 records and accepts limits from 1 through 100.

nextCursor is an opaque, versioned continuation token bound to the logical workspace, retrieval mode, normalized query and filters, history mode, and an internal record anchor. Page size may change between requests. Pagination is deterministic for an unchanged corpus; it is not a snapshot guarantee across concurrent writes, which may change BM25 ranking or current/history status.

continuum_summary registers or resolves the workspace and returns workspace identity metadata plus the newest current records. Its default limit is 10. Its cursor continues through an otherwise unfiltered chronological search.

Exact get accepts several IDs, returns complete records regardless of supersession, preserves first-request order after deduplication, and reports unavailable or wrong-workspace IDs in missingIds. Search and get do not register a truly unknown workspace; search returns an empty page and get reports its requested IDs missing.

Storage and failures

Continuum stores one local database at the first applicable location:

$CONTINUUM_DATA_DIR/continuum.db
$XDG_DATA_HOME/continuum/continuum.db
~/.local/share/continuum/continuum.db

The data directory and database are user-private on supported platforms. SQLite uses foreign keys, a 5-second busy timeout, WAL journal mode, synchronous = NORMAL, short transactions, and numbered migrations tracked with PRAGMA user_version. Canonical records remain authoritative; FTS is a rebuildable access path.

Core failures use the small code set WORKSPACE_ERROR, VALIDATION_ERROR, DATABASE_ERROR, and NOT_FOUND. They identify the failed operation and include only safe diagnostic context, never record content, SQL, or stack traces in adapter output.

Legacy v1 importer

tools/import-v1 is a separate one-time operational utility, not part of the MCP or main CLI surface.

Use a stable, checkpointed copy of the old SQLite database:

bun run tools/import-v1/src/index.ts \
--source /safe-copy/legacy.db \
--workspace /work/project \
[--data-dir /isolated/continuum-data]

The importer opens the source through immutable read-only SQLite, rejects nonempty WAL or rollback-journal sidecars, and rejects hard-linked or target-aliasing source files. It reads only raw journal rows. It preserves IDs and content, preserves canonical timestamps or losslessly normalizes equivalent explicit-timezone timestamps to UTC milliseconds, preserves kind semantics, and normalizes tags through core.

It ignores task data, consolidations and summaries, recall/session data, checkpoints, migration bookkeeping, provenance fields, and generated Markdown files. The entire source is structurally validated before target construction.

Repeated identical imports are idempotent. Reusing an ID for different canonical evidence or another workspace fails without overwrite. Imports are transactional per record rather than for the whole run: a safe prefix may remain after a later collision, and rerunning safely accepts that prefix before retrying the unresolved row.

Architecture

Continuum is a Bun workspace with explicit dependency direction:

apps/cli ───────→ packages/core
│
└───────────→ packages/mcp ───────→ packages/core
tools/import-v1 ──────────────────────→ packages/core
  • packages/core owns workspace identity, records, supersession, retrieval, summary, migrations, and SQLite persistence.
  • packages/mcp owns strict Zod schemas, MCP tool registration, result mapping, lifecycle, and stdio transport behavior.
  • apps/cli owns Commander parsing, finite JSON output, direct CLI composition, and the mcp command.
  • tools/import-v1 owns the isolated legacy source reader and import command.

The workspace packages are private architectural boundaries, not a published embedding SDK.

Development

See CONTRIBUTING.md for setup, focused test commands, migration guidance, privacy rules, and the full validation workflow. Product and architectural values live in AGENTS.md; coding defaults live in CODING_STANDARDS.md.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Continuum

Continuum gives coding agents durable, workspace-scoped memory. It stores complete observations, decisions, preferences, and lessons so later agents can recover useful context instead of repeating investigation.

MCP is the primary interface. The CLI exposes the same product behavior for scripting, testing, and recovery.

Continuum is intentionally not a task manager, session archive, generated Markdown memory system, summarization pipeline, embedding service, deletion interface, or cross-workspace search service.

Requirements and installation

Continuum requires Bun 1.4 or newer and the Git executable. A workspace need not itself be a Git repository: Git repositories are identified across clones and worktrees, while ordinary directories use path identity.

bun install
bun run setup
continuum --help

bun run setup installs dependencies and links the local continuum executable. During development, commands can also be run without a global link:

bun run continuum --help

MCP

Start the stdio server with:

continuum mcp

A typical MCP client configuration is:

{
"mcpServers": {
"continuum": {
"command": "continuum",
"args": ["mcp"]
}
}
}

The server exposes exactly five tools:

ToolPurposeKey annotations
continuum_guideReturn version-matched usage guidance.readOnlyHint: true, idempotentHint: true
continuum_summaryReturn the newest current records and logical workspace metadata.readOnlyHint: false, idempotentHint: true; may register the workspace
continuum_memory_recordStore one complete immutable record, optionally superseding older records.readOnlyHint: false, idempotentHint: false
continuum_memory_searchSearch by ordinary text or browse chronologically with filters and pagination.readOnlyHint: true, idempotentHint: true
continuum_memory_getRetrieve several exact record IDs and report missing IDs.readOnlyHint: true, idempotentHint: true

All tools have destructiveHint: false and openWorldHint: false. Inputs and successful structured outputs have strict schemas. The memory inputs are:

continuum_summary({ workspace,limit? })continuum_memory_record({ workspace, content,kind?,tags?,supersedes? })continuum_memory_search({
workspace,query?,tags?,kinds?,includeHistory?,limit?,cursor?,})continuum_memory_get({ workspace, ids })

MCP workspace is an absolute existing directory path. Successful calls return their data in structuredContent. Application failures set isError: true and return a compact safe JSON error envelope in text content; this avoids the pinned MCP SDK validating an error against the tool's success-only output schema. Invalid tool arguments use the MCP SDK's standard validation error result.

Practical workflow

  1. Call continuum_guide when orienting to the installed contract.
  2. Call continuum_summary with the absolute checkout path to recover recent current context.
  3. Search for concepts relevant to the work before and during investigation.
  4. Record concise, self-contained durable knowledge at useful checkpoints.
  5. When knowledge changes, record the replacement with the old IDs in supersedes.
  6. Browse chronologically when targeted search is insufficient, and use continuum_memory_get to follow exact historical references.

CLI

Successful product commands write one compact JSON value and a newline to stdout. Failures write one safe JSON error envelope to stderr and exit nonzero. Help and version output remain human-readable.

The CLI exposes exactly these commands:

continuum guide
continuum summary [--cwd <path>] [--limit <number>]
continuum record --content <text> [--cwd <path>] [--kind <kind>]
[--tag <tag>]... [--supersedes <id>]...
continuum search [--cwd <path>] [--query <text>] [--tag <tag>]...
[--kind <kind>]... [--include-history]
[--limit <number>] [--cursor <cursor>]
continuum get [--cwd <path>] <ids...>
continuum mcp

--cwd defaults to the process working directory. Relative values are resolved against that directory. Repeat --tag, --kind, or --supersedes for multiple values.

Examples:

continuum summary --cwd /work/project
continuum record \
--cwd /work/project \
--content 'The cache key includes the schema version.' \
--kind decision \
--tag cache \
--tag schema
continuum search --cwd /work/project --query 'cache schema' --tag cache
continuum search --cwd /work/project --include-history --limit 20
continuum get --cwd /work/project <record-id><older-record-id>

CLI results use the same core shapes as MCP: complete records contain id, kind, content, tags, createdAt, supersedes, and supersededBy; paged results contain records, hasMore, and nextCursor; exact retrieval also contains missingIds.

Memory behavior

Logical workspaces

Every memory operation identifies a workspace by path. Core normalizes the path and resolves it to one logical workspace in a central database.

An already registered path keeps its identity. Otherwise Continuum inspects Git remotes, prefers normalized origin, records other remotes as aliases, and falls back to the canonical path when no Git identity exists. Equivalent common SSH and HTTPS remote forms share identity. Re-clones and Git worktrees for the same remote therefore recover the same memory.

Continuum never silently merges or reassigns workspaces when path, descendant, or remote ownership conflicts. It returns a structured WORKSPACE_ERROR instead.

Immutable evidence and supersession

Records retain complete content and are immutable. Omitted kind defaults to observation; kinds are open-ended, trimmed, and lowercased. Tags are trimmed, lowercased, deduplicated, and sorted.

supersedes may reference only records in the same logical workspace. It adds relationships without rewriting old evidence. Search and summary hide superseded records by default. includeHistory: true includes them, and complete records show both supersedes and supersededBy IDs.

Canonical records, tags, supersession relationships, and FTS updates commit atomically.

Search, browse, summary, and get

An omitted or whitespace-only search query browses newest records by createdAt DESC, id DESC. A nonempty query is treated as ordinary text, escaped from FTS syntax, matched with SQLite FTS5, and ranked with BM25. Tags are weighted as strong retrieval anchors. A nonempty query with no searchable token returns an empty page rather than the unfiltered corpus.

Tag filters require every requested normalized tag. Kind filters accept any requested normalized kind. Superseded history is excluded unless includeHistory is true. Search defaults to 20 records and accepts limits from 1 through 100.

nextCursor is an opaque, versioned continuation token bound to the logical workspace, retrieval mode, normalized query and filters, history mode, and an internal record anchor. Page size may change between requests. Pagination is deterministic for an unchanged corpus; it is not a snapshot guarantee across concurrent writes, which may change BM25 ranking or current/history status.

continuum_summary registers or resolves the workspace and returns workspace identity metadata plus the newest current records. Its default limit is 10. Its cursor continues through an otherwise unfiltered chronological search.

Exact get accepts several IDs, returns complete records regardless of supersession, preserves first-request order after deduplication, and reports unavailable or wrong-workspace IDs in missingIds. Search and get do not register a truly unknown workspace; search returns an empty page and get reports its requested IDs missing.

Storage and failures

Continuum stores one local database at the first applicable location:

$CONTINUUM_DATA_DIR/continuum.db
$XDG_DATA_HOME/continuum/continuum.db
~/.local/share/continuum/continuum.db

The data directory and database are user-private on supported platforms. SQLite uses foreign keys, a 5-second busy timeout, WAL journal mode, synchronous = NORMAL, short transactions, and numbered migrations tracked with PRAGMA user_version. Canonical records remain authoritative; FTS is a rebuildable access path.

Core failures use the small code set WORKSPACE_ERROR, VALIDATION_ERROR, DATABASE_ERROR, and NOT_FOUND. They identify the failed operation and include only safe diagnostic context, never record content, SQL, or stack traces in adapter output.

Legacy v1 importer

tools/import-v1 is a separate one-time operational utility, not part of the MCP or main CLI surface.

Use a stable, checkpointed copy of the old SQLite database:

bun run tools/import-v1/src/index.ts \
--source /safe-copy/legacy.db \
--workspace /work/project \
[--data-dir /isolated/continuum-data]

The importer opens the source through immutable read-only SQLite, rejects nonempty WAL or rollback-journal sidecars, and rejects hard-linked or target-aliasing source files. It reads only raw journal rows. It preserves IDs and content, preserves canonical timestamps or losslessly normalizes equivalent explicit-timezone timestamps to UTC milliseconds, preserves kind semantics, and normalizes tags through core.

It ignores task data, consolidations and summaries, recall/session data, checkpoints, migration bookkeeping, provenance fields, and generated Markdown files. The entire source is structurally validated before target construction.

Repeated identical imports are idempotent. Reusing an ID for different canonical evidence or another workspace fails without overwrite. Imports are transactional per record rather than for the whole run: a safe prefix may remain after a later collision, and rerunning safely accepts that prefix before retrying the unresolved row.

Architecture

Continuum is a Bun workspace with explicit dependency direction:

apps/cli ───────→ packages/core
│
└───────────→ packages/mcp ───────→ packages/core
tools/import-v1 ──────────────────────→ packages/core
  • packages/core owns workspace identity, records, supersession, retrieval, summary, migrations, and SQLite persistence.
  • packages/mcp owns strict Zod schemas, MCP tool registration, result mapping, lifecycle, and stdio transport behavior.
  • apps/cli owns Commander parsing, finite JSON output, direct CLI composition, and the mcp command.
  • tools/import-v1 owns the isolated legacy source reader and import command.

The workspace packages are private architectural boundaries, not a published embedding SDK.

Development

See CONTRIBUTING.md for setup, focused test commands, migration guidance, privacy rules, and the full validation workflow. Product and architectural values live in AGENTS.md; coding defaults live in CODING_STANDARDS.md.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Continuum

Continuum gives coding agents durable, workspace-scoped memory. It stores complete observations, decisions, preferences, and lessons so later agents can recover useful context instead of repeating investigation.

MCP is the primary interface. The CLI exposes the same product behavior for scripting, testing, and recovery.

Continuum is intentionally not a task manager, session archive, generated Markdown memory system, summarization pipeline, embedding service, deletion interface, or cross-workspace search service.

Requirements and installation

Continuum requires Bun 1.4 or newer and the Git executable. A workspace need not itself be a Git repository: Git repositories are identified across clones and worktrees, while ordinary directories use path identity.

bun install
bun run setup
continuum --help

bun run setup installs dependencies and links the local continuum executable. During development, commands can also be run without a global link:

bun run continuum --help

MCP

Start the stdio server with:

continuum mcp

A typical MCP client configuration is:

{
"mcpServers": {
"continuum": {
"command": "continuum",
"args": ["mcp"]
}
}
}

The server exposes exactly five tools:

ToolPurposeKey annotations
continuum_guideReturn version-matched usage guidance.readOnlyHint: true, idempotentHint: true
continuum_summaryReturn the newest current records and logical workspace metadata.readOnlyHint: false, idempotentHint: true; may register the workspace
continuum_memory_recordStore one complete immutable record, optionally superseding older records.readOnlyHint: false, idempotentHint: false
continuum_memory_searchSearch by ordinary text or browse chronologically with filters and pagination.readOnlyHint: true, idempotentHint: true
continuum_memory_getRetrieve several exact record IDs and report missing IDs.readOnlyHint: true, idempotentHint: true

All tools have destructiveHint: false and openWorldHint: false. Inputs and successful structured outputs have strict schemas. The memory inputs are:

continuum_summary({ workspace,limit? })continuum_memory_record({ workspace, content,kind?,tags?,supersedes? })continuum_memory_search({
workspace,query?,tags?,kinds?,includeHistory?,limit?,cursor?,})continuum_memory_get({ workspace, ids })

MCP workspace is an absolute existing directory path. Successful calls return their data in structuredContent. Application failures set isError: true and return a compact safe JSON error envelope in text content; this avoids the pinned MCP SDK validating an error against the tool's success-only output schema. Invalid tool arguments use the MCP SDK's standard validation error result.

Practical workflow

  1. Call continuum_guide when orienting to the installed contract.
  2. Call continuum_summary with the absolute checkout path to recover recent current context.
  3. Search for concepts relevant to the work before and during investigation.
  4. Record concise, self-contained durable knowledge at useful checkpoints.
  5. When knowledge changes, record the replacement with the old IDs in supersedes.
  6. Browse chronologically when targeted search is insufficient, and use continuum_memory_get to follow exact historical references.

CLI

Successful product commands write one compact JSON value and a newline to stdout. Failures write one safe JSON error envelope to stderr and exit nonzero. Help and version output remain human-readable.

The CLI exposes exactly these commands:

continuum guide
continuum summary [--cwd <path>] [--limit <number>]
continuum record --content <text> [--cwd <path>] [--kind <kind>]
[--tag <tag>]... [--supersedes <id>]...
continuum search [--cwd <path>] [--query <text>] [--tag <tag>]...
[--kind <kind>]... [--include-history]
[--limit <number>] [--cursor <cursor>]
continuum get [--cwd <path>] <ids...>
continuum mcp

--cwd defaults to the process working directory. Relative values are resolved against that directory. Repeat --tag, --kind, or --supersedes for multiple values.

Examples:

continuum summary --cwd /work/project
continuum record \
--cwd /work/project \
--content 'The cache key includes the schema version.' \
--kind decision \
--tag cache \
--tag schema
continuum search --cwd /work/project --query 'cache schema' --tag cache
continuum search --cwd /work/project --include-history --limit 20
continuum get --cwd /work/project <record-id><older-record-id>

CLI results use the same core shapes as MCP: complete records contain id, kind, content, tags, createdAt, supersedes, and supersededBy; paged results contain records, hasMore, and nextCursor; exact retrieval also contains missingIds.

Memory behavior

Logical workspaces

Every memory operation identifies a workspace by path. Core normalizes the path and resolves it to one logical workspace in a central database.

An already registered path keeps its identity. Otherwise Continuum inspects Git remotes, prefers normalized origin, records other remotes as aliases, and falls back to the canonical path when no Git identity exists. Equivalent common SSH and HTTPS remote forms share identity. Re-clones and Git worktrees for the same remote therefore recover the same memory.

Continuum never silently merges or reassigns workspaces when path, descendant, or remote ownership conflicts. It returns a structured WORKSPACE_ERROR instead.

Immutable evidence and supersession

Records retain complete content and are immutable. Omitted kind defaults to observation; kinds are open-ended, trimmed, and lowercased. Tags are trimmed, lowercased, deduplicated, and sorted.

supersedes may reference only records in the same logical workspace. It adds relationships without rewriting old evidence. Search and summary hide superseded records by default. includeHistory: true includes them, and complete records show both supersedes and supersededBy IDs.

Canonical records, tags, supersession relationships, and FTS updates commit atomically.

Search, browse, summary, and get

An omitted or whitespace-only search query browses newest records by createdAt DESC, id DESC. A nonempty query is treated as ordinary text, escaped from FTS syntax, matched with SQLite FTS5, and ranked with BM25. Tags are weighted as strong retrieval anchors. A nonempty query with no searchable token returns an empty page rather than the unfiltered corpus.

Tag filters require every requested normalized tag. Kind filters accept any requested normalized kind. Superseded history is excluded unless includeHistory is true. Search defaults to 20 records and accepts limits from 1 through 100.

nextCursor is an opaque, versioned continuation token bound to the logical workspace, retrieval mode, normalized query and filters, history mode, and an internal record anchor. Page size may change between requests. Pagination is deterministic for an unchanged corpus; it is not a snapshot guarantee across concurrent writes, which may change BM25 ranking or current/history status.

continuum_summary registers or resolves the workspace and returns workspace identity metadata plus the newest current records. Its default limit is 10. Its cursor continues through an otherwise unfiltered chronological search.

Exact get accepts several IDs, returns complete records regardless of supersession, preserves first-request order after deduplication, and reports unavailable or wrong-workspace IDs in missingIds. Search and get do not register a truly unknown workspace; search returns an empty page and get reports its requested IDs missing.

Storage and failures

Continuum stores one local database at the first applicable location:

$CONTINUUM_DATA_DIR/continuum.db
$XDG_DATA_HOME/continuum/continuum.db
~/.local/share/continuum/continuum.db

The data directory and database are user-private on supported platforms. SQLite uses foreign keys, a 5-second busy timeout, WAL journal mode, synchronous = NORMAL, short transactions, and numbered migrations tracked with PRAGMA user_version. Canonical records remain authoritative; FTS is a rebuildable access path.

Core failures use the small code set WORKSPACE_ERROR, VALIDATION_ERROR, DATABASE_ERROR, and NOT_FOUND. They identify the failed operation and include only safe diagnostic context, never record content, SQL, or stack traces in adapter output.

Legacy v1 importer

tools/import-v1 is a separate one-time operational utility, not part of the MCP or main CLI surface.

Use a stable, checkpointed copy of the old SQLite database:

bun run tools/import-v1/src/index.ts \
--source /safe-copy/legacy.db \
--workspace /work/project \
[--data-dir /isolated/continuum-data]

The importer opens the source through immutable read-only SQLite, rejects nonempty WAL or rollback-journal sidecars, and rejects hard-linked or target-aliasing source files. It reads only raw journal rows. It preserves IDs and content, preserves canonical timestamps or losslessly normalizes equivalent explicit-timezone timestamps to UTC milliseconds, preserves kind semantics, and normalizes tags through core.

It ignores task data, consolidations and summaries, recall/session data, checkpoints, migration bookkeeping, provenance fields, and generated Markdown files. The entire source is structurally validated before target construction.

Repeated identical imports are idempotent. Reusing an ID for different canonical evidence or another workspace fails without overwrite. Imports are transactional per record rather than for the whole run: a safe prefix may remain after a later collision, and rerunning safely accepts that prefix before retrying the unresolved row.

Architecture

Continuum is a Bun workspace with explicit dependency direction:

apps/cli ───────→ packages/core
│
└───────────→ packages/mcp ───────→ packages/core
tools/import-v1 ──────────────────────→ packages/core
  • packages/core owns workspace identity, records, supersession, retrieval, summary, migrations, and SQLite persistence.
  • packages/mcp owns strict Zod schemas, MCP tool registration, result mapping, lifecycle, and stdio transport behavior.
  • apps/cli owns Commander parsing, finite JSON output, direct CLI composition, and the mcp command.
  • tools/import-v1 owns the isolated legacy source reader and import command.

The workspace packages are private architectural boundaries, not a published embedding SDK.

Development

See CONTRIBUTING.md for setup, focused test commands, migration guidance, privacy rules, and the full validation workflow. Product and architectural values live in AGENTS.md; coding defaults live in CODING_STANDARDS.md.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Continuum

Continuum gives coding agents durable, workspace-scoped memory. It stores complete observations, decisions, preferences, and lessons so later agents can recover useful context instead of repeating investigation.

MCP is the primary interface. The CLI exposes the same product behavior for scripting, testing, and recovery.

Continuum is intentionally not a task manager, session archive, generated Markdown memory system, summarization pipeline, embedding service, deletion interface, or cross-workspace search service.

Requirements and installation

Continuum requires Bun 1.4 or newer and the Git executable. A workspace need not itself be a Git repository: Git repositories are identified across clones and worktrees, while ordinary directories use path identity.

bun install
bun run setup
continuum --help

bun run setup installs dependencies and links the local continuum executable. During development, commands can also be run without a global link:

bun run continuum --help

MCP

Start the stdio server with:

continuum mcp

A typical MCP client configuration is:

{
"mcpServers": {
"continuum": {
"command": "continuum",
"args": ["mcp"]
}
}
}

The server exposes exactly five tools:

ToolPurposeKey annotations
continuum_guideReturn version-matched usage guidance.readOnlyHint: true, idempotentHint: true
continuum_summaryReturn the newest current records and logical workspace metadata.readOnlyHint: false, idempotentHint: true; may register the workspace
continuum_memory_recordStore one complete immutable record, optionally superseding older records.readOnlyHint: false, idempotentHint: false
continuum_memory_searchSearch by ordinary text or browse chronologically with filters and pagination.readOnlyHint: true, idempotentHint: true
continuum_memory_getRetrieve several exact record IDs and report missing IDs.readOnlyHint: true, idempotentHint: true

All tools have destructiveHint: false and openWorldHint: false. Inputs and successful structured outputs have strict schemas. The memory inputs are:

continuum_summary({ workspace,limit? })continuum_memory_record({ workspace, content,kind?,tags?,supersedes? })continuum_memory_search({
workspace,query?,tags?,kinds?,includeHistory?,limit?,cursor?,})continuum_memory_get({ workspace, ids })

MCP workspace is an absolute existing directory path. Successful calls return their data in structuredContent. Application failures set isError: true and return a compact safe JSON error envelope in text content; this avoids the pinned MCP SDK validating an error against the tool's success-only output schema. Invalid tool arguments use the MCP SDK's standard validation error result.

Practical workflow

  1. Call continuum_guide when orienting to the installed contract.
  2. Call continuum_summary with the absolute checkout path to recover recent current context.
  3. Search for concepts relevant to the work before and during investigation.
  4. Record concise, self-contained durable knowledge at useful checkpoints.
  5. When knowledge changes, record the replacement with the old IDs in supersedes.
  6. Browse chronologically when targeted search is insufficient, and use continuum_memory_get to follow exact historical references.

CLI

Successful product commands write one compact JSON value and a newline to stdout. Failures write one safe JSON error envelope to stderr and exit nonzero. Help and version output remain human-readable.

The CLI exposes exactly these commands:

continuum guide
continuum summary [--cwd <path>] [--limit <number>]
continuum record --content <text> [--cwd <path>] [--kind <kind>]
[--tag <tag>]... [--supersedes <id>]...
continuum search [--cwd <path>] [--query <text>] [--tag <tag>]...
[--kind <kind>]... [--include-history]
[--limit <number>] [--cursor <cursor>]
continuum get [--cwd <path>] <ids...>
continuum mcp

--cwd defaults to the process working directory. Relative values are resolved against that directory. Repeat --tag, --kind, or --supersedes for multiple values.

Examples:

continuum summary --cwd /work/project
continuum record \
--cwd /work/project \
--content 'The cache key includes the schema version.' \
--kind decision \
--tag cache \
--tag schema
continuum search --cwd /work/project --query 'cache schema' --tag cache
continuum search --cwd /work/project --include-history --limit 20
continuum get --cwd /work/project <record-id><older-record-id>

CLI results use the same core shapes as MCP: complete records contain id, kind, content, tags, createdAt, supersedes, and supersededBy; paged results contain records, hasMore, and nextCursor; exact retrieval also contains missingIds.

Memory behavior

Logical workspaces

Every memory operation identifies a workspace by path. Core normalizes the path and resolves it to one logical workspace in a central database.

An already registered path keeps its identity. Otherwise Continuum inspects Git remotes, prefers normalized origin, records other remotes as aliases, and falls back to the canonical path when no Git identity exists. Equivalent common SSH and HTTPS remote forms share identity. Re-clones and Git worktrees for the same remote therefore recover the same memory.

Continuum never silently merges or reassigns workspaces when path, descendant, or remote ownership conflicts. It returns a structured WORKSPACE_ERROR instead.

Immutable evidence and supersession

Records retain complete content and are immutable. Omitted kind defaults to observation; kinds are open-ended, trimmed, and lowercased. Tags are trimmed, lowercased, deduplicated, and sorted.

supersedes may reference only records in the same logical workspace. It adds relationships without rewriting old evidence. Search and summary hide superseded records by default. includeHistory: true includes them, and complete records show both supersedes and supersededBy IDs.

Canonical records, tags, supersession relationships, and FTS updates commit atomically.

Search, browse, summary, and get

An omitted or whitespace-only search query browses newest records by createdAt DESC, id DESC. A nonempty query is treated as ordinary text, escaped from FTS syntax, matched with SQLite FTS5, and ranked with BM25. Tags are weighted as strong retrieval anchors. A nonempty query with no searchable token returns an empty page rather than the unfiltered corpus.

Tag filters require every requested normalized tag. Kind filters accept any requested normalized kind. Superseded history is excluded unless includeHistory is true. Search defaults to 20 records and accepts limits from 1 through 100.

nextCursor is an opaque, versioned continuation token bound to the logical workspace, retrieval mode, normalized query and filters, history mode, and an internal record anchor. Page size may change between requests. Pagination is deterministic for an unchanged corpus; it is not a snapshot guarantee across concurrent writes, which may change BM25 ranking or current/history status.

continuum_summary registers or resolves the workspace and returns workspace identity metadata plus the newest current records. Its default limit is 10. Its cursor continues through an otherwise unfiltered chronological search.

Exact get accepts several IDs, returns complete records regardless of supersession, preserves first-request order after deduplication, and reports unavailable or wrong-workspace IDs in missingIds. Search and get do not register a truly unknown workspace; search returns an empty page and get reports its requested IDs missing.

Storage and failures

Continuum stores one local database at the first applicable location:

$CONTINUUM_DATA_DIR/continuum.db
$XDG_DATA_HOME/continuum/continuum.db
~/.local/share/continuum/continuum.db

The data directory and database are user-private on supported platforms. SQLite uses foreign keys, a 5-second busy timeout, WAL journal mode, synchronous = NORMAL, short transactions, and numbered migrations tracked with PRAGMA user_version. Canonical records remain authoritative; FTS is a rebuildable access path.

Core failures use the small code set WORKSPACE_ERROR, VALIDATION_ERROR, DATABASE_ERROR, and NOT_FOUND. They identify the failed operation and include only safe diagnostic context, never record content, SQL, or stack traces in adapter output.

Legacy v1 importer

tools/import-v1 is a separate one-time operational utility, not part of the MCP or main CLI surface.

Use a stable, checkpointed copy of the old SQLite database:

bun run tools/import-v1/src/index.ts \
--source /safe-copy/legacy.db \
--workspace /work/project \
[--data-dir /isolated/continuum-data]

The importer opens the source through immutable read-only SQLite, rejects nonempty WAL or rollback-journal sidecars, and rejects hard-linked or target-aliasing source files. It reads only raw journal rows. It preserves IDs and content, preserves canonical timestamps or losslessly normalizes equivalent explicit-timezone timestamps to UTC milliseconds, preserves kind semantics, and normalizes tags through core.

It ignores task data, consolidations and summaries, recall/session data, checkpoints, migration bookkeeping, provenance fields, and generated Markdown files. The entire source is structurally validated before target construction.

Repeated identical imports are idempotent. Reusing an ID for different canonical evidence or another workspace fails without overwrite. Imports are transactional per record rather than for the whole run: a safe prefix may remain after a later collision, and rerunning safely accepts that prefix before retrying the unresolved row.

Architecture

Continuum is a Bun workspace with explicit dependency direction:

apps/cli ───────→ packages/core
│
└───────────→ packages/mcp ───────→ packages/core
tools/import-v1 ──────────────────────→ packages/core
  • packages/core owns workspace identity, records, supersession, retrieval, summary, migrations, and SQLite persistence.
  • packages/mcp owns strict Zod schemas, MCP tool registration, result mapping, lifecycle, and stdio transport behavior.
  • apps/cli owns Commander parsing, finite JSON output, direct CLI composition, and the mcp command.
  • tools/import-v1 owns the isolated legacy source reader and import command.

The workspace packages are private architectural boundaries, not a published embedding SDK.

Development

See CONTRIBUTING.md for setup, focused test commands, migration guidance, privacy rules, and the full validation workflow. Product and architectural values live in AGENTS.md; coding defaults live in CODING_STANDARDS.md.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Continuum

Continuum gives coding agents durable, workspace-scoped memory. It stores complete observations, decisions, preferences, and lessons so later agents can recover useful context instead of repeating investigation.

MCP is the primary interface. The CLI exposes the same product behavior for scripting, testing, and recovery.

Continuum is intentionally not a task manager, session archive, generated Markdown memory system, summarization pipeline, embedding service, deletion interface, or cross-workspace search service.

Requirements and installation

Continuum requires Bun 1.4 or newer and the Git executable. A workspace need not itself be a Git repository: Git repositories are identified across clones and worktrees, while ordinary directories use path identity.

bun install
bun run setup
continuum --help

bun run setup installs dependencies and links the local continuum executable. During development, commands can also be run without a global link:

bun run continuum --help

MCP

Start the stdio server with:

continuum mcp

A typical MCP client configuration is:

{
"mcpServers": {
"continuum": {
"command": "continuum",
"args": ["mcp"]
}
}
}

The server exposes exactly five tools:

ToolPurposeKey annotations
continuum_guideReturn version-matched usage guidance.readOnlyHint: true, idempotentHint: true
continuum_summaryReturn the newest current records and logical workspace metadata.readOnlyHint: false, idempotentHint: true; may register the workspace
continuum_memory_recordStore one complete immutable record, optionally superseding older records.readOnlyHint: false, idempotentHint: false
continuum_memory_searchSearch by ordinary text or browse chronologically with filters and pagination.readOnlyHint: true, idempotentHint: true
continuum_memory_getRetrieve several exact record IDs and report missing IDs.readOnlyHint: true, idempotentHint: true

All tools have destructiveHint: false and openWorldHint: false. Inputs and successful structured outputs have strict schemas. The memory inputs are:

continuum_summary({ workspace,limit? })continuum_memory_record({ workspace, content,kind?,tags?,supersedes? })continuum_memory_search({
workspace,query?,tags?,kinds?,includeHistory?,limit?,cursor?,})continuum_memory_get({ workspace, ids })

MCP workspace is an absolute existing directory path. Successful calls return their data in structuredContent. Application failures set isError: true and return a compact safe JSON error envelope in text content; this avoids the pinned MCP SDK validating an error against the tool's success-only output schema. Invalid tool arguments use the MCP SDK's standard validation error result.

Practical workflow

  1. Call continuum_guide when orienting to the installed contract.
  2. Call continuum_summary with the absolute checkout path to recover recent current context.
  3. Search for concepts relevant to the work before and during investigation.
  4. Record concise, self-contained durable knowledge at useful checkpoints.
  5. When knowledge changes, record the replacement with the old IDs in supersedes.
  6. Browse chronologically when targeted search is insufficient, and use continuum_memory_get to follow exact historical references.

CLI

Successful product commands write one compact JSON value and a newline to stdout. Failures write one safe JSON error envelope to stderr and exit nonzero. Help and version output remain human-readable.

The CLI exposes exactly these commands:

continuum guide
continuum summary [--cwd <path>] [--limit <number>]
continuum record --content <text> [--cwd <path>] [--kind <kind>]
[--tag <tag>]... [--supersedes <id>]...
continuum search [--cwd <path>] [--query <text>] [--tag <tag>]...
[--kind <kind>]... [--include-history]
[--limit <number>] [--cursor <cursor>]
continuum get [--cwd <path>] <ids...>
continuum mcp

--cwd defaults to the process working directory. Relative values are resolved against that directory. Repeat --tag, --kind, or --supersedes for multiple values.

Examples:

continuum summary --cwd /work/project
continuum record \
--cwd /work/project \
--content 'The cache key includes the schema version.' \
--kind decision \
--tag cache \
--tag schema
continuum search --cwd /work/project --query 'cache schema' --tag cache
continuum search --cwd /work/project --include-history --limit 20
continuum get --cwd /work/project <record-id><older-record-id>

CLI results use the same core shapes as MCP: complete records contain id, kind, content, tags, createdAt, supersedes, and supersededBy; paged results contain records, hasMore, and nextCursor; exact retrieval also contains missingIds.

Memory behavior

Logical workspaces

Every memory operation identifies a workspace by path. Core normalizes the path and resolves it to one logical workspace in a central database.

An already registered path keeps its identity. Otherwise Continuum inspects Git remotes, prefers normalized origin, records other remotes as aliases, and falls back to the canonical path when no Git identity exists. Equivalent common SSH and HTTPS remote forms share identity. Re-clones and Git worktrees for the same remote therefore recover the same memory.

Continuum never silently merges or reassigns workspaces when path, descendant, or remote ownership conflicts. It returns a structured WORKSPACE_ERROR instead.

Immutable evidence and supersession

Records retain complete content and are immutable. Omitted kind defaults to observation; kinds are open-ended, trimmed, and lowercased. Tags are trimmed, lowercased, deduplicated, and sorted.

supersedes may reference only records in the same logical workspace. It adds relationships without rewriting old evidence. Search and summary hide superseded records by default. includeHistory: true includes them, and complete records show both supersedes and supersededBy IDs.

Canonical records, tags, supersession relationships, and FTS updates commit atomically.

Search, browse, summary, and get

An omitted or whitespace-only search query browses newest records by createdAt DESC, id DESC. A nonempty query is treated as ordinary text, escaped from FTS syntax, matched with SQLite FTS5, and ranked with BM25. Tags are weighted as strong retrieval anchors. A nonempty query with no searchable token returns an empty page rather than the unfiltered corpus.

Tag filters require every requested normalized tag. Kind filters accept any requested normalized kind. Superseded history is excluded unless includeHistory is true. Search defaults to 20 records and accepts limits from 1 through 100.

nextCursor is an opaque, versioned continuation token bound to the logical workspace, retrieval mode, normalized query and filters, history mode, and an internal record anchor. Page size may change between requests. Pagination is deterministic for an unchanged corpus; it is not a snapshot guarantee across concurrent writes, which may change BM25 ranking or current/history status.

continuum_summary registers or resolves the workspace and returns workspace identity metadata plus the newest current records. Its default limit is 10. Its cursor continues through an otherwise unfiltered chronological search.

Exact get accepts several IDs, returns complete records regardless of supersession, preserves first-request order after deduplication, and reports unavailable or wrong-workspace IDs in missingIds. Search and get do not register a truly unknown workspace; search returns an empty page and get reports its requested IDs missing.

Storage and failures

Continuum stores one local database at the first applicable location:

$CONTINUUM_DATA_DIR/continuum.db
$XDG_DATA_HOME/continuum/continuum.db
~/.local/share/continuum/continuum.db

The data directory and database are user-private on supported platforms. SQLite uses foreign keys, a 5-second busy timeout, WAL journal mode, synchronous = NORMAL, short transactions, and numbered migrations tracked with PRAGMA user_version. Canonical records remain authoritative; FTS is a rebuildable access path.

Core failures use the small code set WORKSPACE_ERROR, VALIDATION_ERROR, DATABASE_ERROR, and NOT_FOUND. They identify the failed operation and include only safe diagnostic context, never record content, SQL, or stack traces in adapter output.

Legacy v1 importer

tools/import-v1 is a separate one-time operational utility, not part of the MCP or main CLI surface.

Use a stable, checkpointed copy of the old SQLite database:

bun run tools/import-v1/src/index.ts \
--source /safe-copy/legacy.db \
--workspace /work/project \
[--data-dir /isolated/continuum-data]

The importer opens the source through immutable read-only SQLite, rejects nonempty WAL or rollback-journal sidecars, and rejects hard-linked or target-aliasing source files. It reads only raw journal rows. It preserves IDs and content, preserves canonical timestamps or losslessly normalizes equivalent explicit-timezone timestamps to UTC milliseconds, preserves kind semantics, and normalizes tags through core.

It ignores task data, consolidations and summaries, recall/session data, checkpoints, migration bookkeeping, provenance fields, and generated Markdown files. The entire source is structurally validated before target construction.

Repeated identical imports are idempotent. Reusing an ID for different canonical evidence or another workspace fails without overwrite. Imports are transactional per record rather than for the whole run: a safe prefix may remain after a later collision, and rerunning safely accepts that prefix before retrying the unresolved row.

Architecture

Continuum is a Bun workspace with explicit dependency direction:

apps/cli ───────→ packages/core
│
└───────────→ packages/mcp ───────→ packages/core
tools/import-v1 ──────────────────────→ packages/core
  • packages/core owns workspace identity, records, supersession, retrieval, summary, migrations, and SQLite persistence.
  • packages/mcp owns strict Zod schemas, MCP tool registration, result mapping, lifecycle, and stdio transport behavior.
  • apps/cli owns Commander parsing, finite JSON output, direct CLI composition, and the mcp command.
  • tools/import-v1 owns the isolated legacy source reader and import command.

The workspace packages are private architectural boundaries, not a published embedding SDK.

Development

See CONTRIBUTING.md for setup, focused test commands, migration guidance, privacy rules, and the full validation workflow. Product and architectural values live in AGENTS.md; coding defaults live in CODING_STANDARDS.md.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages