Introduction¶
In long sessions of DeepSeek Harness, historical messages keep accumulating. When the model handles a new request, it resends large amounts of completed debug logs and abandoned attempts, causing the context window to fill up quickly, inference costs to rise, and the model to become distracted by outdated information.
dsh-taskfold solves this problem. It keeps conversations readable and low-cost by explicitly wrapping workflows in named tasks and, after a task is complete, folding the entire span into a short title summary. The original content is fully preserved and can be retrieved at any time.
Plugin Positioning¶
- Name:
dsh-taskfold - Category: Memory
- Maintainer: yindf
- License: MIT
Core Features¶
The plugin provides the following capabilities:
- Named task wrapping: Wraps a workflow between
task_beginandtask_end, clearly defining the scope of work. - Fold summary: After a task ends, folds the entire conversation history into a short summary with a title, keeping the session tidy.
- On-demand recall: Uses the
fold_recallcommand to read the original content before folding at any time, enabling “fold first, inspect later.” - Persistent storage: Each fold saves the original messages to a file, ensuring no information is lost.
- Complements built-in compression: It can coexist with DSH’s built-in compression mechanism, and using them together can further reduce context pressure.
Installation and Enablement¶
The plugin is installed via command line and applies to desktop and web profiles.
- Install the plugin:
Execute the following command to add the plugin to the specified profile (defaults todesktop):
dsh plugin --profile desktop add dsh-taskfold
If you need to specify a version to avoid installing an unavailable version (such as 0.37.7 or 0.38.0), use:
dsh plugin --profile desktop add dsh-taskfold@<version>
- Restart the process:
Plugin components are evaluated only at startup, so dsh must be restarted after installation for changes to take effect.
# 安装后重启
restart dsh
Usage¶
After the plugin is installed and dsh is restarted, the agent automatically or manually uses the following command structure to manage context while writing code:
task_begin("fix the login bug")
// ... 执行修复工作 ...
task_end("fix the login bug")
When the task completes, that span is folded into a short title summary, preserving key decisions and results. If you need to view the original content, call:
fold_recall({ fold: N })
Notes¶
- Version compatibility: Do not install versions 0.37.7 or 0.38.0; these versions have been marked as uninstall-disabled and deprecated.
- File saving: The plugin does not discard any data. All original messages from folds are saved to files.
- Startup timing: The plugin’s combined configuration is loaded only when dsh starts, so it must be restarted after every configuration change or new plugin installation.
Conclusion¶
dsh-taskfold helps developers control the context cost of long sessions through explicit task management and folding mechanisms. It separates “lessons” from “verbose records,” keeping the session concise while retaining the ability to trace back to original details at any time.