Introduction

DeepSeek Harness’ plugin-based architecture allows developers to extend functionality as needed. In agent development workflows, it is common to need to pin down a complete session context so that a follow-up session can take over or a human can review it. The original handoff skill usually writes the document to the system temp directory, so it cannot be opened directly inside the application.

dsh-handoff-button adds a Handoff button to the bottom action row of each AI reply. When clicked, it compresses the current session into a structured document and writes it to the handoff/ directory for that session’s workspace. This provides a persistent handoff artifact that is easy to reuse across sessions.

Core Features

1. Button & Interaction

The plugin injects a round icon button at the far right of the action group for each completed AI reply (after the copy/feedback buttons). A tooltip is shown on hover.

  • Click to generate: Clicking the button invokes the current default model to generate the document. The button dims during generation; after completion, a green ✓ is shown (automatically restored after 2 seconds); on failure, a red ⚠ is shown (hover to see the reason).
  • Click again to open: When in the ✓ state, clicking again opens the generated document inside the application via DSH’s openWorkspacePath API (if better-sidebar is installed, it opens in the sidebar editor; otherwise the system default app is used).
  • Icon replacement: The icon file is assets/write.png (Magnific “Write” icon), served by the same-origin Host route. To replace it, simply replace the file and restart DSH.

2. Document Generation Logic

The document uses the five-section structure from handoff skill:
* Status: Current status
* Goal: Taken from the initial goal and any subsequent explicit rephrasings
* Progress: A concise summary, not a verbatim transcript
* Next Steps: Follow-up steps
* Suggested Skills: Skills actually invoked in the session

For lengthy assistant content that appears in the middle of the session, it is treated by default as already captured as an artifact in References (e.g., specs / plans / ADRs). During generation, a path reference is used instead of retelling the full text. If the LLM is unavailable, it falls back automatically to a heuristic summary while retaining the original Goal.

3. Focus Settings

A normal click generates the full document. Click while holding Alt to specify “focus points for the next session”. This parameter guides the generation of Next Steps but does not replace the original Goal.

4. File and Reference Handling

  • File name: handoff-{yyyymmddhhmmss}-{session-title}.md. Illegal characters are replaced with -, and the name is limited to 60 characters. The handoff/ directory is created automatically if it does not exist.
  • Redaction: Sensitive information such as API keys, tokens, and passwords is automatically masked before writing.
  • References: File paths actually touched in the session are collected automatically. Only files inside the workspace are retained and converted to paths relative to the workspace root. System paths, temporary directories, and similar locations are not included.

Installation and Activation

The plugin has been published to npm. The installation command is as follows:

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

If using a local development version:

dsh plugin --profile <name> add /绝对路径/dsh-handoff-button

Note: The startup order determines whether a restart is required. DSH composes plugins when the process starts; the installation command only modifies the configuration on disk.
- Install first → start later: The plugin is already included in the startup list, takes effect immediately, and no restart is required.
- Start first → install later: After installation, you must fully quit and restart dsh (⌘Q in the desktop app, or terminate the Web UI process) so the process can recompose the profile.

After installation, you can use dsh --profile <name> --dump-config | grep handoff to confirm that the plugin has been loaded.

Architecture and Implementation

  • Host side (index.js): Registers three routes and provides POST /handoff/write (generation), GET /handoff/read (opening), and GET /handoff/icon (icon) services. It handles reading the session log, invoking the LLM to summarize, and writing the file (creating directories automatically).
  • Client side (client.js): Injected via the module loader into the conversation.chat.assistant-actions slot (order: 100, far right), it handles click events and invokes the Host routes.
  • Sandbox constraints: The write fence is pinned to “the session workspace” rather than the Host default root directory, avoiding permission errors such as file access denied under workspace-write mode. Even if sandbox approval is set to never, it still attempts to write to handoff/.

Use Cases

  • Scenarios where handoff documents need to be opened directly inside DSH.
  • Cross-machine or multi-person collaboration scenarios where artifacts need to be referenced by relative paths.
  • Scenarios where the current session context needs to be quickly pinned down for later handover.
  • GitHub: https://github.com/whiteS18/dsh-handoff-button
  • Catalog: https://www.skillhub.cn/plugins/whiteS18/dsh-handoff-button