Preface

When developing with DeepSeek Harness (DSH), if you paste a code snippet with a file path into the input box and there is no reference mechanism, it usually enters the draft as raw multiline text. The dsh-code-quote plugin provides an “Option B (inline snapshot)” experience: inside the input box it automatically collapses into a single compact reference, and on send it inlines the complete code snapshot to the model as an independent context message.

What Is This

dsh-code-quote is a code-reference collapsing plugin for the DeepSeek Harness Web input box, maintained by hanrr92. It solves the problems of verbose pasted code and the model not having access to the full context.

Core Features

  1. Automatic Reference Collapsing: Pasted code with a file path and line numbers automatically collapses into a compact reference.
  2. True Chip Mode: True chip mode is enabled by default and supports undo with Ctrl+Z. The input box directly displays a file icon + filename:line number.
  3. Sidebar Support: Supports the “Add to Dialog” function in the dsh-better-sidebar sidebar; selecting code longer than 500 characters can automatically collapse it.
  4. Snapshot Persistence: Code snapshots are persisted locally and remain available after the process restarts, allowing the model to access the full code context.
  5. Form Compatibility: Supports compatibility between old and new token formats.
  6. Snapshot Management: Snapshot limit is 64 blocks / 128KB per block, using an LRU eviction policy.

Installation and Activation

To install the plugin, run the following command:

dsh plugin --profile web add dsh-code-quote

After installation, restart the profile to apply the configuration.

Typical Usage

  1. Paste Reference: Select code in the editor, copy the portion that includes the path and line numbers (for example dsh-web-launcher/package.:13-15), and paste it into the DSH input box.
  2. Sidebar Reference: Select code in the sidebar (longer than 500 characters), click “Add to Dialog,” and the plugin automatically recognizes and collapses it.
  3. Send: When sending a message, the plugin appends the full code snapshot to the model as an independent context message.

Notes

  1. Conflict Handling: Choose either this plugin or a dynamic-version plugin (such as quote-1); enabling both will cause duplicate injection.
  2. Environment Requirements: Requires a Node >= 20 environment and depends on @deepseek-ai/cordis ^4.0.1.
  3. Configuration Switch: True chip mode is enabled by default. To fall back to token mode, set the environment variable DSH_CODE_QUOTE_CHIP_MODE=0.
  4. Recognition Threshold: The recognition threshold is conservative; pure code without a header will not collapse.
  5. Snapshot Limit: The snapshot limit is 64 blocks / 128KB per block (LRU eviction).

Summary

By converting code pasting into structured references and persisting snapshots, dsh-code-quote effectively solves the verbose code display problem in the DSH context window. Developers can quickly undo with Ctrl+Z, and the sidebar is also seamlessly supported, making it suitable for scenarios that require frequently referencing project code during debugging or development.

For more information, see:
- Plugin Directory
- GitHub Repository