turn-budget
Reviewed
at commit cf711c3
Caution: Writes your recent prompts, Claude's last reply and git status to ~/.claude/handoffs outside the project, and by default stops the turn itself when over budget.
When one turn uses more than +5 session points or 500,000 uncached input tokens, writes a handoff from exact session data and copies it for a new session; the…
0 upvotes
Log in to upvote or save- Made by
- Vedant Andhale
- Pinned commit
-
cf711c363797f549f54103422080c6f57a0fd6f9 - What we checked
-
Watches what one turn spends (session points or uncached input tokens). Past the limit, by default it stops the turn and writes a handoff file with your recent prompts, Claude's last reply, edited files, todos and git status, then copies it so you can paste it into a new session. It makes no model calls and no network requests.
Review details
Static review of the source at the pinned commit; not run. Hooks: session.start (registers /turn-budget and /handoff), tool.call (main loop only: remembers the file paths of Edit, MultiEdit, Write and NotebookEdit calls and the latest TodoWrite list in memory), session.measure (reads the five-hour rate limit percentage), turn.start, turn.step (checks the spend before each model request and, when stopped, answers the step without sending the request), turn.complete and command.run for both commands. Over the limit, with the default onLimit handoff, it calls handOff without asking: $.session.messages for the user prompts and last answer, git status --short and git diff --stat through $.process.run in the session directory with a 10 second timeout, then writes the document (capped near 12000 characters plus the latest prompt) to CLAUDE_CONFIG_DIR or USERPROFILE/HOME plus .claude/handoffs/<timestamp>.md with $.fs.write, aborts the turn, copies the text with $.ui.copy and shows a toast. The files accumulate and are never deleted. With onLimit ask it shows a $.ui.ask dialog (hand off, continue, do not ask again, stop); stop appends a note to the session and aborts the turn; an unanswered dialog lets the turn go on. Prompts and replies can contain secrets, and git runs in the project directory, so repository git configuration applies. /handoff does the same on demand. Stored data: the limits via $.store. No fetch or other network access, no model calls. Not reviewed: the git binary.
- What it uses
-
- Reads your prompts: yes
- Sees tool calls: yes
- Blocks or changes tool calls: yes
- Reads or writes files: yes
- Runs programs on your machine: yes
- Calls the model (uses tokens): no
- Sends data over the network: no
- Stores data: yes
- Shows something on screen: yes
When one turn uses more than +5 session points or 500,000 uncached input tokens, writes a handoff from exact session data and copies it for a new session; the old session is never cleared. No model calls.
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/turn-budget/)