Introduction

DeepSeek Harness (DSH) extends its functionality through plugins. In long-running sessions, the model may become stuck in reasoning loops, repeat responses, or show noticeable degradation in context quality. When deciding to switch a task to a new session, attention should not focus only on token consumption, but also on the degree of content degradation. The dsh-attention-health plugin detects degradation signals from local session logs and, when necessary, recommends a handoff. It generates a handoff document that does not rely on model calls.

What This Is

This is a plugin that runs on DSH and primarily addresses degradation detection and task handoff in long-running sessions. It does not call external models and makes rule-based judgments entirely from local logs.

The core functionality consists of three parts:
1. Real-Time Thought Guard: During generation, it detects repetitive or spinning thinking content. When triggered, it immediately aborts the current generation.
2. Session Health Self-Check: It infers session degradation risk from logs and provides a health score along with context usage.
3. Handoff Document Generation: It mechanically generates a Markdown handoff document without using model summarization, ensuring handoff materials remain reliable even when the model is not trustworthy.

Installation and Enablement

Installing the plugin requires using the DSH profile parameter. Please ensure the Node version meets the requirement (>= 22.19).

dsh plugin --profile web add -w dsh-attention-health

Notes:
* The -w parameter in the command cannot be omitted; otherwise, an error will occur.
* After installation completes, DSH must be restarted. Plugin entries will not be hot-loaded.
* If the pnpm major version of the profile does not match the plugin, an error may occur.

Typical Usage

After installation, you can operate on local sessions using the command-line tool.

Check the health status of the current session:

node handoff.mjs --health

Check the health status of a specified session (ID prefix supported):

node handoff.mjs d346d3e8 --health

Generate a handoff document to a file:

node handoff.mjs -o HANDOFF.md

List all sessions:

node handoff.mjs --list

Generate a handoff document with statistics:

node handoff.mjs --stats -o HANDOFF.md

Core Functionality

1. Real-Time Thought Guard

This is the only capability where the plugin actively intervenes. During generation, it detects repetitive or spinning thinking content frame by frame. Once a suspected degradation signal is detected, the guard immediately aborts the current generation round. It will not provide a “warning only” option or a “disable guard” option. This means that if normal reasoning is falsely judged as spinning, the user cannot turn off the guard through settings; they can only modify the configuration or uninstall the plugin.

2. Session Health Self-Check

The plugin reads local session logs, calculates context size, and effective usage. It outputs a health score (for example, 50 / 100) and points out the specific counts and symptoms of thinking anomalies (such as spinning or repetition). This feature runs fully offline and does not access the network or make additional model calls.

3. Handoff Document Generation

This is where the plugin delivers its core value. It does not use a model to generate the document; instead, it mechanically extracts structured information from session logs. The generated document contains sections for session identity, current goal, main user request, progress for each turn, relevant files, pending tasks, and encountered errors.

Notes and Boundaries

  • Handling false positives: Because the guard aborts immediately when triggered and has no fallback switch, if a false positive occurs (for example, normal reasoning is judged as spinning), the only remedy is to modify the configuration or uninstall the plugin.
  • Offline operation: The plugin only reads local session logs. It does not access the network or initiate additional model requests.
  • Timing of effect: After modifying configuration or installing, DSH must be restarted for changes to take effect.
  • Environment requirement: Only Node.js version >= 22.19 is supported.

Summary

dsh-attention-health provides a local solution for monitoring quality degradation in long-running DSH sessions. By immediately aborting degraded generation and providing model-free handoff materials, it helps developers safely switch context when the model is not trustworthy. For more details and source code, see the GitHub repository.