ctx-handoff

Reviewed at commit a416713

Auto handoff + /clear at a context threshold, idle cache refresh with an away handoff, and background notes per workspace

Made by
CabLate
What we checked

Sends new conversation parts to Claude on your account (uses tokens) to keep per-project notes under ~/.claude/projects, which it adds to new conversations. Rules repeated three times are written into CLAUDE.md or a skill without asking first. Keeps the cache warm, may ask Claude to rewrite a reply not in your set language, and can clear and continue from a summary if you turn that on.

Review details

Static review of the source at the pinned commit; not run. Delta review of the changes since 328664e; the rest carries over from the review at that commit. Hooks and runtime calls are unchanged: session.start, session.end, turn.step, config.set, prompt.context, tool.call, ui.render AbovePrompt, turn.complete, classic.Stop, prompt.submit and command.run /handoff; $.model.fork and $.model.complete (claude-sonnet-5-5 by default), $.command.run and $.prompt.submit for the handoff, $.fs.read of the notes file, CLAUDE.md files, the .git file and the repo's .claude/settings.json and .claude/hooks/*, $.fs.write only to <CLAUDE_CONFIG_DIR or ~/.claude>/projects/<encoded workspace>/memory/ctx-handoff.md and its .ctx-handoff-backup, $.env.get, $.settings.read, $.store, $.state, $.ui. No fetch, $.http, $.process, eval or dynamic import. Changes in this version: a new away_handoff setting (default on, same behaviour as before) that can switch off the away handoff written when cache refreshes run out; the reply-language reminder is shorter and now fires on much shorter text and at a 75 percent threshold; the repeated-failure nudge is now sent on the 2nd and 4th identical failure and, for Edit and MultiEdit, tells Claude to confirm text with Grep or Read and, for several replacements, to run `node ~/.claude/tools/safe-replace.mjs`, a script the plugin does not ship (it only runs if the user has such a file, and goes through Claude's normal permission prompt); the done-check message asks Claude to end with one of four status labels. The tools/ folder (developer tooling that spawns the claude CLI) is not loaded by the hooks. The unresolved ../types imports are type-only. Changes since 328664e: register.ts adds a Stop-time reply-language check (stopRewrite in lang.ts): when reply_language is not off (default auto) and the last assistant message is judged not to be in the target language, the Stop hook blocks the stop once per turn (never on a repeated stop_hook_active, never for subagents) with a reminder to rewrite the reply, which makes Claude write a second message and uses tokens; it never throws. paths.ts encodeProject now appends an FNV-1a hash suffix for project paths with non-ASCII characters, so the notes file for such projects lives under a different directory name than before (pure string function). Other changes are a log string, a type-only test fixture and a docs helper in tools/ that the hooks do not load.

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: no
  • Calls the model (uses tokens): yes
  • Sends data over the network: no
  • Stores data: yes
  • Shows something on screen: yes
Hooked events
Screenshot of ctx-handoff
Made this mod? Add a badge to your README

modsforClaude badge for ctx-handoff

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/ctx-handoff.svg)](https://modsforclaude.com/mods/ctx-handoff/)

← All mods