context-continuity
Local-first continuity plugin for Codex and DeepSeek Harness across compaction, resume, and handoff.
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 28, 2026
- Updated
- Aug 31, 2026
Introduction
Context Continuity
中文说明 · Release evidence · Privacy
Context Continuity keeps a small, source-aware record of what a long Agent task must not forget, then checks that record after compaction, resume, or handoff before work continues.
It is available as one shared-core package for Codex and DeepSeek Harness on Windows, macOS, and Linux.
Why this exists
A host can preserve enough text for an Agent to keep talking while losing the actual objective, a hard constraint, a user correction, the reason for a decision, the current file/version, or whether the old next step is still safe. Host summaries and memory remain useful inputs, but they are not authoritative task state.
Context Continuity stores a bounded task projection with source, time, status, supersession, conflict, and verification metadata. It does not copy the full transcript, create long-term memory, plan the task, or replace host permissions.
Status
Version 0.2.0-beta.1 is the release candidate. The pinned install commands
become valid only when the matching public tag and GitHub prerelease exist.
| Host / platform | Support level |
|---|---|
| Codex | Beta release candidate; real manual and consecutive automatic compaction lifecycle receipts on the tested Windows host |
| DeepSeek Harness | Developer-preview candidate pinned to 0.1.1-rc.2; published Host API lifecycle and isolated package verified |
| Windows | Full release test matrix plus real Codex lifecycle evidence |
| macOS | Release gate: the full source, Hook, MCP, package, eval, and DSH adapter matrix must pass on macos-latest; authenticated Codex automatic lifecycle is not yet verified |
| Linux | Release gate: the full source, Hook, MCP, package, eval, and DSH adapter matrix must pass on ubuntu-latest |
The frozen three-arm real-task study has not been completed. This release proves mechanics and bounded failure behavior, not yet a measured reduction in user rework or target drift.
Install: Codex
Requirements: a Codex build with plugin and Hook support, Node.js 20 or newer, and permission to inspect local Hooks.
The commands are the same on macOS, Linux, and Windows shells:
codex plugin marketplace add rrrrrredy/context-continuity --ref v0.2.0-beta.1
codex plugin add context-continuity@context-continuity
Then:
- Restart or resume the Codex task.
- Open
/hooks. - Inspect the exact commands in the installed cache and trust only those definitions.
- Work normally. Ordinary turns remain silent and do not call another model.
Verify installation:
codex plugin list --json
The JSON output must include context-continuity@context-continuity. In
/hooks, verify and trust these seven groups from the installed cache:
SessionStart, UserPromptSubmit, PreCompact, PostCompact,
SubagentStart, SubagentStop, and SessionEnd. If any command reports
node not found, continuity protection is not active.
Run this 60-second, no-file-change smoke test in a disposable task:
- Say: “Protect this objective: keep the smoke test local. Hard constraint: do not edit files.”
- Read the proposed state and send the exact confirmation text the Agent returns.
- Say: “Show the current continuity state.”
- Pass only if the objective and constraint are both
verifiedand no file was changed.
For Mac-specific evidence and limits, see macOS support.
Install: DeepSeek Harness
Requirements: DeepSeek Harness 0.1.1-rc.2, Node.js 20 or newer, and
pnpm. Replace <profile> with your actual profile:
dsh plugin --profile <profile> add github:rrrrrredy/context-continuity#v0.2.0-beta.1
dsh --profile <profile> --dump-config
The dumped configuration must contain a layer/service with both id and
name equal to context-continuity. Then start the profile with:
dsh --profile <profile>
Use the same plain-language smoke test above after the profile starts.
If that profile was already running during installation, restart its process before the smoke test. The DSH bundle patch inserts the adapter; no separate state schema or fork is used. See the adapter guide and capability record.
What users see
Most of the time: nothing.
When a lossy boundary occurs, the plugin:
- snapshots only the active task invariants;
- records whether the boundary completed;
- restores a bounded projection before the next model step;
- preserves unresolved conflicts instead of inventing agreement;
- marks the old
next_actionstale so it must be rederived.
If reliable evidence can repair a mismatch, recovery is automatic. Low-risk uncertainty is marked while reversible work may continue. A mismatch that could change objective, scope, authorization, work object, publication, deletion, or another irreversible action requires one necessary user question.
Users can say:
- “Show the current continuity state.”
- “Protect the current objective and constraints.”
- “This recovered item is wrong; replace it with …”
- “Export a minimal handoff.”
- “Turn continuity protection off for this task.”
- “Delete this task's continuity state.”
User-authoritative structured state uses a readable, exact second confirmation. A model paraphrase or an old message cannot mint authority.
Data and guarantees
- Local, task-scoped append-only ledger with hash-chain verification.
- At most three recent compaction snapshots.
- Bounded recovery projection: 800-token default, 1,500-token maximum.
- Full transcript, hidden reasoning, and full tool output are not copied.
- Platform summaries, retrieval results, handoffs, and subagent output enter as untrusted caches or candidates.
- Every lossy boundary invalidates the old action cursor.
- Hook or adapter failure is fail-open for the host. Continuity protection for that boundary is then unavailable.
- Corrupt continuity state is not restored or mutated.
- Other installed products do not become automatic integrations. The shared-state contract is read-only and single-owner.
Codex data defaults to
$CODEX_HOME/plugin-data/context-continuity/v1. DSH data defaults to
$DSH_HOME/plugin-data/context-continuity/v1. An explicit
CONTEXT_CONTINUITY_DATA_DIR is supported for isolated or managed runs.
Evidence
The repository requires:
- 88 core tests and 7 DeepSeek Harness adapter/integration tests;
- real Codex manual and consecutive automatic compaction receipts;
- byte-identical installed-cache lifecycle receipts;
- an installed-host read-only discovery receipt;
- an isolated DSH tarball install receipt;
- a published DSH Host API lifecycle receipt;
- Hook, MCP, repository, protocol-eval, audit, and multi-OS CI gates.
Receipts bind the current source tree and plugin package SHA-256. Fixture protocol results are explicitly excluded from efficacy claims.
Local development
npm ci
npm test
npm run test:dsh
npm run smoke:hooks
npm run smoke:mcp
npm run eval:protocol
npm run verify:dsh:package
npm run verify:dsh:lifecycle
npm run validate
npm audit --audit-level=high
Only plugins/context-continuity/ is the installable Codex package. The root
package also carries the DeepSeek Harness adapter and its bundle patch.
Update or remove
Upgrade Codex to <new-tag> while preserving its local ledger:
codex plugin remove context-continuity@context-continuity
codex plugin marketplace remove context-continuity
codex plugin marketplace add rrrrrredy/context-continuity --ref <new-tag>
codex plugin add context-continuity@context-continuity
Upgrade DeepSeek Harness to <new-tag>:
dsh plugin --profile <profile> remove context-continuity
dsh plugin --profile <profile> add github:rrrrrredy/context-continuity#<new-tag>
To remove from Codex without deleting its ledger:
codex plugin remove context-continuity@context-continuity
codex plugin marketplace remove context-continuity
To remove from DSH without deleting its ledger:
dsh plugin --profile <profile> remove context-continuity
Removal does not silently delete ledgers. For a complete deletion, first say
“Delete this task's continuity state,” send the exact second confirmation, and
verify that the task state is gone. Only if the plugin cannot run, resolve and
review the exact data path before removing plugin-data/context-continuity;
see privacy and deletion.
License and support
Apache License 2.0. Commercial and private use are allowed subject to the license terms. Report reproducible problems through GitHub Issues.