Claude Modsunofficial directory

Context & memory·terminal · desktop·MIT

taskcut

Compacts Claude Code between sub-tasks, even mid-turn, not when the context fills.

Generic Claude Mods cover, used because the taskcut repository ships no screenshots

taskcut makes Claude Code compact when the work moves on from one finished sub-task to the next, instead of when the context window fills, and it can do so in the middle of a long turn. It is built for long, unattended jobs: hand over a list of tasks in one message and it compacts between them, so the summary never lands halfway through a piece that is still live. Below a context floor, 35% by default, it does nothing and costs nothing.

Install

Needs Claude Code 2.1.287 or later and an interactive session: claude -p and Agent SDK sessions cannot compact, so taskcut never ends a turn there.

claude plugin marketplace add wasd96040501/taskcut
claude plugin install taskcut@taskcut

Add --scope local to both commands to try it in one project for you alone, or --scope project to share it with everyone who clones the repository. The install warns that its options are not set; unset, each takes its default.

Then work as usual. Nothing happens until the ctx figure in the status line passes the floor. /taskcut tells you whether it is on, what it has judged and compacted, and how many tokens the judging has used. TASKCUT=0 claude turns it off for one session.

How it works

After every step of the main conversation, taskcut reads the context fill the status line shows. Subagent steps are ignored. Below the floor it stops there.

Past the floor, it asks a model, through Claude Code’s $.model.complete, whether the work moves on at this step from a finished piece to another. The judge reads:

  • every message you typed: the first and the latest three in full (up to 2,000 characters each), the rest cut to one line of 150 characters;
  • Claude’s latest ten messages, 400 characters each, plus the summary of an earlier compaction if there is one;
  • what Claude’s latest twelve non-lookup calls touched: a file path, or a command’s description, or failing that the first 100 characters of the call;
  • Claude’s task list, if it keeps one with TodoWrite or the task tools;
  • the step itself: what Claude just said and the calls it is making, each call’s input cut to 300 characters.

It never reads tool output or CLAUDE.md. The judge writes one sentence and a verdict. A step that asks you something or proposes work is never a boundary. A step that says in its own words that a piece is done, while another piece you asked for remains, is one. Everything else is not, including finishing the last thing you asked for, because what you say next may be about it. Anything short of a clear yes keeps the context.

Some steps never reach the judge: a step with no text, the step that ends a turn, and any step after a compaction until Claude has changed something again.

On a yes, taskcut lets the step’s tools finish and prints a dim line such as taskcut: context at 43%, compacting before the next piece. It then ends the turn before the next request, runs $.session.compact(), the same compaction /compact runs, and submits Continue., which the transcript shows as a message from the plugin. What the summary keeps is Claude Code’s decision. taskcut changes only when it happens; fast-jev-compaction replaces the summary itself, and ctx-handoff hands the session to a fresh conversation instead.

Cost, storage and network

  • Each judged step is one call to sonnet by default: about 2,000 input tokens however long the session has run, uncached, and one sentence out. The author puts it at about half a cent. It runs while the step’s tools run, so it rarely adds a wait.
  • /cost does not count the judge’s calls, although they spend your tokens. /taskcut adds them up from the token counts the API returns.
  • Each compaction costs what /compact costs and clears the prompt cache. A compaction takes the context back under the floor, so judging stops until it fills again. If one cannot get under the floor, judging resumes 5 points above where it left the context.
  • Nothing is written to disk. The tally lives in memory for the session. With --debug, each judgement adds one line to the debug log with its token counts. The only network traffic is the judge’s model call, made through Claude Code.

Settings

SettingDefaultWhat it does
floorPercent35Context fill, 0 to 100, below which taskcut does nothing. Lower compacts sooner and more often; 0 judges every step.
modelsonnetThe judge, as an alias or a full model id. The author says haiku costs about a third and misses about half the task switches.

Pass --config floorPercent=50 to the install command, or change either later in /plugin. Claude Code keeps plugin settings in your user settings, so they apply wherever taskcut is installed on the machine, whatever the scope.

What the author measured

The author handed 36 real sqlglot changes to Sonnet 5 in one message. taskcut compacted once inside the turn, after issue 20, from 431,567 tokens to 10,511. Peak context fell from 71% of the window to 43% and cost by about a fifth, and both runs, with and without taskcut, solved all 36. Whether boundary compaction makes long sessions work better is the open question the author’s measurement notes track.

Limitations

  • The judge never sees tool output, so a reply that claims more than was done can trigger a compaction a little early.
  • Silent moves are missed. A step with no text is never judged. In the author’s benchmark about half the moves between issues were silent, and one turn of four tasks done without a word was never compacted.
  • A mid-turn compaction splits the turn in two, with the plugin’s Continue. between them.
  • Only inside a turn. Once a turn ends, /compact before your next request is yours to run, and Claude Code’s own threshold still applies.
  • Not after a turn’s first step. On 2.1.280, a compaction right after a request that ended on your own message answers that message instead of summarising, so taskcut compacts only after a step that followed tool results.
  • The author developed and measured it on 2.1.280. Claude Code’s events and methods can change between versions.

Similar Claude Mods

The whole directory →