dsh-clear-tool-results: An Automatic Tool Result Archiving and Context Clearing Plugin for DeepSeek Harness

stultuss/dsh-clear-tool-results

Tools & CapabilitiesVerified
Listed on 2026-08-27
Page last updated 2026-09-05

A DSH plugin that archives raw tool results after each turn and clears them from context to reduce token usage, with model-accessible retrieval.

dsh-clear-tool-results is a host plugin designed for DeepSeek Harness that automatically archives raw tool results to the session directory after each conversation turn and clears them from the context, significantly reducing token consumption. It solves the problem of historical tool outputs occupying excessive context in long sessions, allowing the model to read archived data on demand via the read_tool_result_log tool without user intervention. Maintained by stultuss under the MIT license, it supports both new and legacy Harness cores and automatically backfills archives when enabled mid-session, ensuring data integrity.

How to Install

install
npmdsh plugin --profile web add dsh-clear-tool-results
Category
Tools & Capabilities
Platform
DSH Plugin
Author
stultuss
Distribution
Plugin

dsh-clear-tool-results Key Features

Archive tool resultsClear contextSelf-serve retrievalToggle control
Listed on dsh-plugin.org

dsh-clear-tool-results Repo Summary

What Does It Do?

dsh-clear-tool-results is a DSH plugin for DeepSeek Harness that automatically archives raw tool results after each conversation turn and clears them from the context, reducing token consumption. It solves the problem of historical tool outputs occupying excessive context in long sessions, allowing the model to read archived data on demand via the read_tool_result_log tool. Maintained by stultuss under the MIT license, it supports both new and legacy Harness cores.

Core Features

  • Automatic archiving: writes raw tool/result events to tool-result-logs/round-NNNN.json in the session directory, with an index.json manifest.
  • Context clearing: replaces tool results of finished turns with a placeholder noting the turn and hinting at the read tool.
  • On-demand reading: registers the read_tool_result_log tool, letting the model fetch archived data by turn or time.
  • Toggle control: use /clear-tool-results on|off|status to enable, disable, or check status, stored in $DSH_HOME/clear-tool-results.json.
  • Backfill archiving: automatically archives missing turns after enabling mid-session or restarting, idempotently.

How to Use This Plugin?

After enabling it in DSH, the plugin runs by default. At the end of each turn, tool results are archived and cleared; when the user asks about a previous output, the model automatically calls read_tool_result_log to retrieve the data. For example, if the user asks "What was the output of the last bash command?", the model calls read_tool_result_log({ turn: 2 }) and answers with the raw data. You can control the plugin with /clear-tool-results on|off|status commands.

This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: stultuss/dsh-clear-tool-results. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.

Install, update, and uninstall this plugin in the Plugin Market of DeepSeek Harness's DSH Plugin Hub

DSH Plugin FAQ