In the development workflow of DeepSeek Harness (DSH), maintaining repo-level state (such as the current task ID) and context continuity across sessions is a common challenge. Manual export and import often lack consistency and make evidence hard to track. The shared-handoff-dsh plugin wraps the core workflow of shared-handoff-kit, provides a zero-dependency solution, supports macOS, Linux, and Windows, and implements automation behavior similar to that in Codex and Claude.
Core Positioning¶
This is a DeepSeek Harness (dsh) skill plugin maintained by eve1329. It provides evidence-based session handoff and repo-local task ID state management skills, supporting interoperability across Codex, Claude, and dsh. The plugin emulates the original Kit’s hook behavior through the DSH event system and requires no build step.
Installation and Activation¶
Installation consists of only a single command. After installation, restart dsh web; the skills will be automatically added to the skill directory, and the model will load them through the skill tool.
dsh plugin --profile web add shared-handoff-dsh
Core Features¶
The plugin includes two main skills:
- Evidence-driven session handoff: Supports exporting and restoring session context, and sharing state files among Codex, Claude, and dsh.
- Repo-local task ID state management: Manages task state under
.agents/state/tasks/<task-id>/and binds it to the current dsh session.
In addition, it has the following characteristics:
* Cross-platform support: Natively handles Python environment differences on Windows 10 and 11.
* Automated Hook-equivalent behavior: Listens to agent/pre-step and session/event events to automatically handle session startup, task routing, continuation, and compaction protection.
* Zero dependencies, no build step: Implemented in pure Node.js (requires Node.js >=20.16.0).
Typical Usage¶
After installation, there is no need to memorize commands; skills are triggered through conversation.
task-id-bootstrap: Open a Task¶
Enter a command in the dsh chat to start a new task. For example:
新开task-id=init-kmp,然后开个 init-kmp 分支
The model runs the built-in bootstrap script. After success, the model outputs three key lines to confirm that state has been established:
Task state: .../.agents/state/tasks/init-kmp
Current task: init-kmp
Session binding: /Users/you/.dsh/sessions/.../session.jsonl.zstd
Later, when resumption is needed, simply say 继续,task-id=init-kmp.
Note: task-id-bootstrap requires Python 3.9+. If Python is missing from the system, the plugin does not silently install it. Instead, it reports the missing dependency and shows the installation command; execution only happens after explicit consent.
handoff: Export / Restore Session¶
When a conversation thread becomes too long, you can use the handoff feature. Enter:
帮我做个 handoff
The model generates a prompt that can be directly pasted into a new thread, including the workspace, branch, completion status, and next steps. In the new thread, enter:
继续上次 handoff
The model reconstructs context from the state file instead of relying on chat history. Trigger words include 交接, 新开线程继续, 继续上次, resume, and so on.
Automation Mechanism¶
The plugin’s automated behavior is implemented through the DSH event system and does not require manual intervention:
| Original Hook | DSH Equivalent Event | Behavior Description |
|---|---|---|
SessionStart |
agent/pre-step |
Injects the current task’s process.md as a baseline and prompts running the handoff skill after completing milestones. |
UserPromptSubmit |
agent/pre-step |
Scans messages for task=<id> tags, binds the session, and switches the current task. |
| Continuation | agent/pre-step |
Recognizes keywords such as 继续 and re-injects persisted state. |
Stop |
session/event |
Updates process.auto.md after each interaction and appends a summary to the ## Auto Log section of process.md. |
PreCompact / PostCompact |
compaction/start / compaction/summary |
Writes snapshots before and after compaction, generates context_guard.json, and suggests cleanup when a threshold is reached. |
Design Details and Limitations¶
- Subagents are read-only: Subagents or forks derived from a parent session can only receive baseline injection and do not write state (no snapshot, no Auto Log, no task binding updates, no compaction protection updates).
- Session Binding: The plugin obtains the current session record path through the environment variable
DSH_SESSION_JSONL, ensuring that state files strictly correspond to the DSH session. - Interoperability: The state layout matches the Codex/Claude versions, and
session-tasks.jsonis shareable.context_guard.jsonuses a read-merge-write strategy to ensure context is correctly protected even when alternating between different runtimes. - Configuration overrides: If the default behavior does not meet your requirements, configuration items can be overridden via Profile Patch (such as disabling baseline injection, disabling automatic snapshots, adjusting the number of log entries, etc.).
License and Resources¶
This plugin is licensed under the MIT license. It runs with the permissions of the current DSH process. It is recommended to review the source code and license before installation.
- GitHub repository: https://github.com/eve1329/dsh-shared-handoff
- Community directory: https://www.skillhub.cn/plugins/eve1329/dsh-shared-handoff