dsh-handoff-card
interrice/dsh-handoff-card
一键交接卡:把当前会话日志提炼成 HANDOFF.md(待办、最近诉求、改动文件、成本概况),新会话读卡即可续接,避免会话中途切模型带来的缓存冷启动浪费。
安装
dsh plugin --profile web add github:interrice/dsh-handoff-cardREADME
dsh-handoff-card
A sidebar panel plugin for DeepSeek Harness (DSH). One click distills the current DSH session log into a HANDOFF.md handoff card — pending todos, recent user requests, changed files, and a cost summary. In a new session, send read HANDOFF.md, then continue from the todos to pick the work up again, instead of switching models mid-session and paying for a cold prompt cache.
What it does
The plugin adds a "Handoff card" panel to the DSH sidebar. From the panel you can:
- Pick a session from a dropdown (defaults to the most recently modified one).
- Click Generate card to write
HANDOFF.mdinto your workspace. - Copy the first message to send in the next session, and copy the generated file's path.
The generated card contains:
- Project / current task (session title)
- Pending todos (from the last
todo/writein the session) - Recently completed todos
- The last few real user requests, in order
- Files recently changed by
write/edittool calls - Cost overview: user messages, model steps, model switches, input/output/cache-read token totals
- Instructions for the new session
How it works
The Host half (index.js) registers three HTTP routes on the DSH connection:
| Route | Method | Purpose |
|---|---|---|
/api/__handoff/generate | POST | Regenerate HANDOFF.md. Body: { "sessionId": "..." } (optional; defaults to the newest session). Returns a summary JSON. |
/api/__handoff/status | GET | Whether HANDOFF.md exists, plus size and mtime. |
/api/__handoff/sessions | GET | List up to 80 sessions (id, title, mtime) found in the log directory. |
The generator locates session logs under ~/.dsh/sessions, decodes the multi-frame zstd session.v4.jsonl.zstd files with Node's built-in zlib.zstdDecompressSync, extracts events (user/message, todo/write, tool/call, model/selection, assistant/message usage, …), and renders the Markdown card. The Client half (client.js) is a React sidebar panel that calls these routes.
Install
dsh plugin add github:interrice/dsh-handoff-card
Then restart or reload DSH so the bundle patch (cordis.patch.yml) is applied.
Configuration
By default the plugin uses process.cwd() of the DSH host process as the workspace — that is where HANDOFF.md is written. To pin a different workspace, add a config.workspace entry to the plugin in your profile's cordis patch:
- insert:
- id: handoff-card
name: '@interrice/handoff-card'
config:
workspace: 'D:/path/to/your/workspace'
Session logs are always read from ~/.dsh/sessions regardless of this setting; config.workspace only controls where HANDOFF.md is written and which session files are preferred when several workspaces share the log root.
Requirements
- Node.js with
zlib.zstdDecompressSync(Node 22.15+ / 23.8+) in the DSH host. - DSH with the zstd session-log format (
session.v4.jsonl.zstd).
License
MIT, see LICENSE.