Preface

When using DeepSeek Harness (DSH) for long conversations or multi-round development, context accumulation can cause the conversation to drift off-topic or consume a large number of tokens. When you need to return to an earlier point in the conversation and start over, or “branch off” the current train of thought while preserving the original conversation history, manually copying and pasting history is often inefficient and error-prone. The dsh-rewind plugin solves this pain point through command-line interaction.

Plugin Overview

dsh-rewind is a /rewind plugin for DeepSeek Harness, maintained by jiangr100, and belongs to the “Memory” category. Its core function is to rewind a conversation to any historical message and create a new clean session at that point, while automatically archiving the original conversation to reduce context contamination.

Core Features

This plugin mainly provides the following capabilities:

  1. Message Selector: Opens a selector window via the /rewind command, defaulting to the most recent message.
  2. Session Forking: Creates a new clean session at the selected historical message and automatically switches to that session. The original conversation is automatically archived and can be restored from the sidebar.
  3. Context Cleanup: The new session after forking removes all context after the selected message, effectively reducing context contamination.
  4. Interaction Controls: Supports closing the selector by pressing the Esc key, clicking the ✕ button, or clicking outside the window area.

Installation and Enablement

Prerequisites

  • DeepSeek Harness is deployed (web profile layout; the directory is usually $DSH_HOME/profiles/<name>).
  • pnpm is included in the system environment variable PATH.

It is recommended to install via the plugin package, which automatically completes the mount configuration:

dsh plugin --profile web add github:jiangr100/dsh-rewind

After installation, restart Harness to activate it.

Manual Installation Method

If you need manual control, follow these steps:

# 1. 进入 profile 目录
cd "$DSH_HOME/profiles/web"

# 2. 安装包
pnpm add github:jiangr100/dsh-rewind

# 3. 编辑 cordis.patch.yml 文件
# 添加以下内容:
# - insert:
#     - id: dsh-rewind
#       name: dsh-rewind

# 4. 重启 Harness

Typical Usage

  1. Type /rewind in the conversation input box and press Enter. The selector window appears above the input box.
  2. Scroll up through the conversation list and click any message row.
  3. The window closes, the interface automatically switches to the new forked session, and the original conversation is archived.
  4. Close the selector window using Esc, ✕, or by clicking outside the window area.

Notes

  • The plugin runs with the permissions of the current DeepSeek Harness process. Please ensure you fully understand the plugin source code and its license (MIT) before installing.
  • Before installation, check whether pnpm is configured in the environment variables, because the dsh plugin command depends on it.

Summary

dsh-rewind provides DSH users with a concise and efficient conversation management tool. Through the /rewind command, you can easily rewind and fork a session, ensuring a clean new session while preserving an archive of the original conversation. This is especially useful for long-cycle development, validating multiple ideas, or scenarios that require frequent context resets.