Preface

In the DSH plugin ecosystem, developers often need to quickly summarize current progress in multi-turn conversations. Manually organizing goals, completed tasks, and key files is time-consuming and easy to overlook details. dsh-handoff aims to solve this problem by parsing the session event stream and generating a deterministic Markdown handoff document. Unlike memory plugins, it is a one-time snapshot and does not consume LLM resources.

Plugin Positioning

This is a DSH plugin maintained by ZhijiangTang under the MIT license. It focuses on “freezing” the current session state into a static handoff document for human reading or reference in the next session.

Core Features

  • Deterministic Export and Zero Cost: Generates the document based on the session event stream (user messages, tool calls, results, todos, etc.) without calling an LLM and without additional inference cost.
  • Automatic Collection: Automatically organizes goals, completed/pending tasks, key file paths, and session statistics.
  • Safety and Self-Check: Built-in path fence protection ensures the export path stays within the workspace root; supports a self-check mechanism to verify feature availability.

Installation and Enablement

In a DSH environment, install the plugin via a profile:

dsh plugin --profile <你的 profile> add file:./plugins/dsh-handoff

After installation, invoke the handoff tool in the session.

Typical Usage

When invoking the handoff tool, you can specify the export path and overwrite behavior:

dsh plugin --profile <profile> add dsh-handoff

Parameter Description:
* dest: Export file path, defaults to HANDOFF.md. The path must be relative to the workspace root.
* overwrite: Whether to overwrite an existing file, defaults to false.

Return Value:
* Success: { ok: true, path, sections, eventCount, chars, skipped, note }
* Failure: { ok: false, error }

Generated Content Structure:
The exported Markdown document contains the following sections:
* # Session Handoff: Includes the session ID and time range
* ## Goals: Summary of the 3 most recent user messages and the latest goal status
* ## Completed: File writes/edits, Git commits, and successful tool results
* ## Incomplete: Failing tools and pending/in_progress todo items
* ## Next Step Suggestions: Template (currently blank)
* ## Key Files: Deduplicated paths seen, up to the first 15
* ## Session Statistics: Counts of events, messages, tools, tokens, and goals

Technical Details and Notes

  • Pure ESM: No build step; depends on @deepseek-ai/cordis, @deepseek-ai/dsh-tools, @deepseek-ai/dsh-llm.
  • Fallback Strategy: When session.events is missing or malformed, the tool returns ok: true with skipped: true, outputting only a template skeleton and fallback explanation without throwing an exception.
  • Security Constraints: The dest parameter must resolve within the workspace root; otherwise, an error is returned.

Summary

dsh-handoff is suitable for use at the end of a session, when switching context, or when handing work over to another person. It provides a fact-based static handoff document.

GitHub
Skill Library Directory