DeepSeek Harness (dsh) Work Continuity plugin—explicit persistence of work state across sessions, managed separately from general memory.

Preamble

DSH’s plugin ecosystem emphasizes modularity. When using an agent to handle complex tasks, a common pain point is that a limited context window or too many conversation turns causes the Agent to lose prior progress or decisions in a new session. If it relies on general memory, these work states are often buried or injected arbitrarily, leading to context confusion.

The Work Continuity plugin aims to solve this problem. It separates work state (goals, decisions, and next steps) from general memory and uses explicit persistence to ensure that the Agent can immediately resume the work in progress in a new session, without requiring manual repetition of background information.

Core Features

The plugin implements automatic management and tracking of work state through the following mechanisms:

  1. Automatic event capture: Listens to host authoritative events and automatically captures goal changes (goal/change) and ToDo list updates (todo/write).
  2. LLM autonomous decision-making: By registering the work_state model tool, it allows the LLM to autonomously judge and record checkpoints worth tracking during the conversation.
  3. Explicit commands: Provides the /checkpoint command, allowing users to manually record, update, or review work state at any time.
  4. Post-compaction re-anchoring: Addresses state loss caused by compression summaries and automatically resets injection after context compression.
  5. Setpoint deviation detection: Monitors tool calls and detects whether the Agent’s actions deviate from the current work scope, issuing a warning when a deviation occurs.
  6. Injection scheduler wiring: Supports the host injection scheduler, reports based on the actual amount injected, and falls back to direct injection when the scheduler is not mounted.
  7. Explicit cross-session work-state persistence: All state is written to a SQLite database and supports cross-session reads.

Typical Usage

The /checkpoint command can be used to quickly manage the current workflow.

Record Work State

  • Set goal: /checkpoint goal Complete M3 development
  • Record decision: /checkpoint decision Use MIT license
  • Set next step: /checkpoint next Merge into Group A
  • Record artifact: /checkpoint artifact D:/out/report.pdf
  • View state: /checkpoint show

View Statistics

  • Usage statistics: /checkpoint stats
  • Clear state: /checkpoint clear

Installation and Configuration

Installation

Install the plugin via CLI:

dsh plugin --profile <name> add github:Icstick/dsh-work-continuity

Configuration

After installation, you must explicitly specify the data storage directory in the profile configuration file; otherwise, the plugin will not work properly.

Edit <profile>/cordis.patch.yml:

- id: work-continuity
  name: dsh-work-continuity
  config:
    workDir: C:\path\to\work-state   # 必填:工作状态库绝对路径
    debug: false                     # 可选:调试日志

After installation, restart DSH to apply the configuration.

Design Principles and Notes

  • Data ownership: All write operations leave an audit trail in the work_audit table to ensure traceability.
  • Fail-Open mechanism: If the plugin encounters a runtime exception, it only logs the issue and never blocks the conversation.
  • Memory boundary: Memory does not perform the work on behalf of the user; it only records state. Execution still requires autonomous Agent decisions.
  • Data security: Data is stored in workDir/work.db. Uninstalling the plugin does not delete the data; reinstalling it restores access.