In the use of DeepSeek Harness (DSH), long-running sessions can accumulate a large amount of context. The built-in /compact command can compress history, but it typically continues within the original session. Sometimes, you need to treat the compression operation as a clear branching point: continue working in a new session while preserving the post-compression state, while keeping the original session independently recoverable. This is especially useful in scenarios with limited context windows. The dsh-compact-and-branch plugin implements this functionality. It performs the same operations as /compact, but moves the subsequent work into a new session.

Plugin Scope

This is a DeepSeek Harness plugin maintained by zeropointnine and classified under “Memory.” It is a standalone plugin designed to turn standard context compression into a clean session branching point.

Core Features

  • Reuses Canonical Compression: Invokes the logic of DSH’s built-in /compact command.
  • Creates Independent Sessions: Creates a brand-new root session under the same workspace and preset, without inheriting the fork lineage of the parent session.
  • Complete Context Migration: Preserves the compressed context, including message content, ordering, identity sources, and tool-call pairs.
  • Model Configuration Inheritance: The new session inherits the model selection configuration from the source session.
  • UI Optimization: Hides synthetic import turn rows in the browser interface and displays only one native prompt row, keeping the interface clean.

Installation and Enablement

Installation does not require manually editing configuration files. Add the plugin via the command line:

dsh plugin --profile web add git+https://github.com/zeropointnine/dsh-compact-and-branch

After adding, updating, or removing a plugin, DSH must be restarted for the changes to take effect.

Usage

Enter the following in any session:

/compact-and-branch

No arguments are required. The command compresses the current session through DSH’s canonical /compact mechanism and then opens a new root session in the browser. The new session inherits the model settings and compressed context from the original session. The original session remains recoverable.

Compatibility and Notes

  • Version Requirements: The current version (0.3.x) requires DSH version ^0.1.5-rc.2. If you are a DSH 0.1.1-rc.x user, pin #v0.2.0.
  • Process Permissions: The plugin runs with the current DSH process permissions. Review the source code and license before installation.
  • Dependencies: This plugin does not include build scripts. Installing it via Git requires no additional configuration.

Summary

By turning compression operations into separate branch sessions, this plugin helps developers manage long-cycle projects more effectively. By importing the compressed context into a new session, it preserves the integrity of the original session while providing a fresh starting point for subsequent work. Plugin repository: https://github.com/zeropointnine/dsh-compact-and-branch.