taskfold
Keeps long coding-agent sessions lean: wrap a stretch of work in a named task, and when it ends, fold that whole span into one short titled summary. The conversation stays readable, context costs stay low, and any fold's original content can be read back on demand. Built for DeepSeek Harness.
What it is
Keeps long coding-agent sessions lean: wrap a stretch of work in a named task, and when it ends, fold that whole span into one short titled summary…
How to install
Run this in the DSH web profile, then refresh the page.
$ dsh plugin --profile web add dsh-taskfold@0.40.1
DSH versions accepted
^0.2.0-rc.1
Author and traction
yindf · ★ 11 · Updated 2026-11-10
About this plugin
effectively infinite context for your coding agent
简体中文 ·
Releases ·
Changelog
Your agent compacts its own context, as it works. It wraps each piece of work in a named task, closes it when the work is done, and the closed span becomes one short titled summary — written while that span is still in context, so it is accurate by construction. There is no command to run, and nothing you must manage.
Nothing is thrown away: every fold is archived in full, and fold_recall brings any of it back exactly as it was.
For [DeepSeek Harness](https://www.npmjs.com/package/@deepseek-ai/dsh) (DSH).
> Latest supported dsh: 0.2.2-rc.1. dsh rc builds are supported on this branch; dsh alpha builds are supported on the [alpha branch](https://github.com/yindf/taskfold/blob/alpha/README.md#supported-dsh-versions).
What it does
Long sessions drown in their own history: every request re-sends hours of finished work — old tool outputs, debug logs, abandoned attempts. Costs climb, the model gets distracted, and the window eventually fills.
taskfold takes finished work off the surface at the moment it finishes:
task_begin("fix the login bug") … the work … task_end("fix the login bug")
→ "fix the login bug" — one titled summary: what was tried, what failed and why,
what changed, what the user decided
The agent opens a task before starting and closes it when done. Closing is the fold: the span collapses into that summary, and the original messages are archived untouched.
Autonomous compaction
The agent compacts on its own initiative, at task boundaries — not when a token counter decides the window is nearly full. That is the difference from dsh's built-in compaction, and the two compose:
| | dsh built-in compaction | taskfold |
| --- | --- | --- |
| Trigger | token pressure | the agent, at each task boundary |
| Fires when | the window is nearly full | the work is finished |
| Summary written | from history that has already gone stale | while the span is still in context |
| Scope | a token-sized range | one named task, with a title |
| Reading the original | re-summarized | fold_recall({ fold: N }) returns the exact messages |
| Context window | fills until it fires | rarely fills, so it fires later or not at all |
- Accurate by construction. The summary is written once, while the span it describes is still in context — never a summary of a summary.
- Navigable. Every fold carries a title, so a long session stays scannable.
- Cache-friendly. Folding rewrites a middle chunk of history; the stable prefix (system prompt, tools, earlier context) stays cache-friendly.
- Guardrails, not noise. If the agent forgets the discipline, a short hint appears in its context. Hints are events, not state: one is published when the condition appears or its wording changes, nothing is published once it clears, and there is no wrapper, supersession header or expiry notice.
What it saves (measured)
One real session — 411 model steps, 26 folds — read from the harness's own usage records:
| | Without folding | With taskfold |
| --- | --- | --- |
| Total prompt tokens | 142,654,308 | 52,127,098 (−63.5%) |
| Largest single request | 594,909 | 206,896 (−65%) |
| Context window used at peak | 59.5% | 20.7% |
- Folding moved 441,100 tokens of finished work off the surface; because that history would otherwise be re-sent on every later request, it added up to 90,527,210 tokens never sent.
- Producing the 26 summaries cost 3,550,270 tokens — 3.9% of the saving, and most of it cache reads.
- The biggest single fold took 40,422 tokens out of the conversation in one call.
Most of those tokens would have been cache reads rather than fresh input — cheaper, but still billed and still occupying the window. In longer sessions that is the difference between staying inside the context window and not.
One session, one task shape — your numbers will differ. The mechanism is the point: finished work leaves the surface, the stable prefix stays cached, and the model keeps the lessons instead of the transcript.
Install
dsh Desktop (recommended)
1. Open dsh Desktop and go to the Plugins page in the sidebar.
2. Click Add plugin in the top-right corner.
3. In Package name or address, enter dsh-taskfold. The dialog runs pnpm for you:
- want the newest release the moment it ships? pin it —
dsh-taskfold@from the [versions list](https://www.npmjs.com/package/dsh-taskfold?activeTab=versions). pnpm 11 (bundled with dsh Desktop) leaves a release younger than 24 h out of the bare name's reach, and an explicit version overrides that; pnpm records it in the profile'sminimumReleaseAgeExcludetoo. Never install 0.37.7 or 0.38.0 — uninstallable (ERR_PNPM_LINKED_PKG_DIR_NOT_FOUND) and deprecated on npm; - skip npm entirely: paste the prebuilt
.tgzfrom the [newest Release](https://github.com/yindf/taskfold/releases/latest) — a tarball is not subject to the release-age policy; - follow a branch:
github:yindf/taskfold#master(rc channel) orgithub:yindf/taskfold#alpha(alpha channel) — needs direct GitHub access from this machine; - a local path must point at a copy, never at your working checkout: the plugin manager treats whatever it installs as its own (it leaves
dsh-taskfold.frozen-*.baksnapshots beside it and replaces the directory on upgrade).
4. Leave Registry on Default registry; mainland-China networks can pick Mainland China mirror and retry.
5. Click Install, wait for "Installed; it loads at the next start.", then click Enable now.
6. Restart dsh Desktop — plugin composition is evaluated only at startup. Back on the Plugins page you should see a Taskfold card reading Components · 2 total · 2 running (taskfold and taskfold-client); the fold floor and the task-bar switch live on that card (see [Settings](#settings)).
7. To upgrade, uninstall a
Compare in this category
The five most-starred plugins in the same category.
| Plugin | Author | Stars | Version | Updated |
|---|---|---|---|---|
| EverOS | EverMind-AI | 13.9K | 0.0.0 | 2026-11-10 |
| billion-context | ranxianglei | 5.9K | 0.1.213 | 2026-11-10 |
| dsh-context | bowenliang123 | 4.8K | 0.83.1 | 2026-11-10 |
| memsearch | zilliztech | 2.9K | 0.0.0 | 2026-11-10 |
| dsh-mnemon | omdsh-dev | 957 | 0.5.43 | 2026-11-08 |