CLAUDE CODE PLUGINS

Bento

Six Claude Code plugins that add live panes, a status band, toasts and guard rails.

  • v1.6.0 Bento release
  • 6 Bento plugins
  • MIT Licence

machine-setup repo, release list (2026-11-14), 2026-11-26; machine-setup repo, marketplace.json, 2026-11-26; lossless-handoff repo, 2026-11-26

ROLE
Author
TIMELINE
2026-10
STACK
Shell, Python, Claude Code hooks
STATUS
Public

Survive compaction

Watch for: which summary still knows the exact next step.

A mock long session fills a context meter. When it compacts, compare a generic summary with a structured handoff and pick the one a fresh session can continue from.

Problem

Long Claude Code sessions lose context when they compact. The summary Claude Code writes is generic. It drops the exact next step, the dead ends you already ruled out and your latest instructions. After a compaction the model often redoes work or asks what you wanted (claude-handoff README, 2026-10-24).

A second, wider problem: agents are hard to watch. Subagents, plan progress, git state, test results and rate limits are all buried in logs while you work.

Constraints

  • Everything is an add-on to Claude Code. I do not control the host, so I use its hooks and plugin system.
  • Claude Code caps the text each hook can inject at 10,000 characters, so a long handoff is split across three injections.
  • Claude Code refuses model writes under ~/.claude/, so handoffs live under ~/.local/state/claude-handoffs/.
  • A hook must never block compaction. If anything fails, a minimal handoff is still written.
  • Public, MIT licensed, and easy to install and remove.

Approach

There are two repos.

lossless-handoff (formerly claude-handoff) is the small, focused one. Three hooks, Python 3 standard library only:

  1. A nudge, when context reaches 75% of the auto-compact window, asks the working model to write its own handoff with six fixed headings: Goal, Decisions and why, Done, In progress, Dead ends, Exact next step.
  2. A pre-compaction hook writes the handoff file. It includes the model's own note, a fresh summary written by Sonnet, and a facts section extracted from the transcript with no model at all.
  3. A session-start hook feeds the handoff back in after compaction.

The design rule is graceful degradation. If the model never writes its note, you still get the Sonnet summary and the facts. If both fail, you get the facts and a visible warning.

Bento (the machine-setup repo) is six Claude Code plugins that add live panes, a status band above the prompt, toasts and guard rails. It also holds a weekly token-budget report and macOS scripts that rebuild the setup on a new Mac.

What shipped

  • claude-handoff v0.1.0 (2026-10-20) to v0.4.0 (2026-10-27) (claude-handoff CHANGELOG), with CI in the claude-handoff and machine-setup repos. Install and uninstall are one command each, and install has a dry-run mode.
  • Bento v1.0.0 (2026-10-19) to v1.6.0 (2026-11-14), with six plugins and bootstrap scripts (machine-setup CHANGELOG).
  • A public code-blind test repo, bento-mods-tests, written from the behaviour contract for Bento. It has 2,089 tests across nine suites (bento-mods-tests README, as of 2026-10-18).
  • lossless-handoff (formerly claude-handoff) has its own page now: Lossless Handoff.
  • Links: lossless-handoff and Bento (machine-setup).

Six plugins

Bento is the machine-setup repo. Its plugin marketplace is called bento. It has six plugins and 26 mods, and every mod can be switched off on its own (machine-setup README and marketplace.json, as of 2026-10-27):

  • safety: protect, checkpoint.
  • usage: burn, cache, compaction.
  • awareness: headsup, nowdoing, spec, focus.
  • agents: pets, review, delegation, mission.
  • dev: git, diff, pulse, coverage, typecheck, pr, ports.
  • compact: coach, handoff, resume, nudge, handoffalert, orch.

Install one plugin or all of them: claude plugin marketplace add pratikgh0se/machine-setup, then claude plugin install <name>@bento.

Compact plugin updates

In v1.3.0 (2026-10-27) the handoff nudge repeats every 25,000 tokens from 75% of the window (it was 50,000), so the agent's handoff is fresher at compaction. A final nudge at 90% says compaction is imminent (machine-setup CHANGELOG). claude-handoff v0.4.0 (2026-10-27) carries the matching faster decisions update: the merge now returns only the changes, and code applies them (claude-handoff CHANGELOG).

Machine setup and the publish gate

setup/bootstrap.sh --dry-run shows what would change and touches nothing. --launchd also installs the scheduled jobs. Anything it overwrites is backed up first. Machine-wide hooks come with it: a pre-compaction handoff, a post-compaction inject, one that blocks git stash and one that blocks recursive scans from / or your home folder (machine-setup README).

The repo is public, so nothing personal may leave. A pre-commit hook and CI run setup/leak-scan.sh, and setup/secret-scan.sh scans exports. Autosync only commits locally. setup/publish.sh --push leak-scans the unpushed commits and pushes only if the scan is clean (machine-setup ADR 0012).

Weekly loops

  • token-budget is a weekly launchd job. It measures the tokens Claude Code loads before I type anything, flags regressions against last week and proposes small, reversible fixes. It never applies them (tools/token-budget README).
  • handoff-canary is a nightly job. It drives two headless sessions past a compaction each and checks that the handoff still works end to end (tools/handoff-canary README).

Outcome

These are measured on my own machine, so treat them as one user's numbers (claude-handoff README, 2026-10-20):

  • Over the first 4.7 days with a 400k window (2026-10-15 to 2026-10-20), average context per turn fell from about 474k (estimated) to 223k, which is roughly 19% lower API-equivalent cost.
  • 13 of 13 real compactions had a fresh model-written handoff, with no degraded cases.
  • In a blind test on 18 real compactions, a fresh Claude scored 62 out of 100 on what it needed with Claude Code's summary alone, and 75 to 76 with the Sonnet summary added.

The sample is small: one user, four sessions, and one session accounts for most of the saving. The README says so too.

What I learned

A summary that reads well can still drop the next step, so the handoff has its own "Exact next step" heading. The model's own note was not enough. In the blind resume quiz, Claude Code's summary alone scored 62, adding the agent's handoff note gave 68, and adding a fresh Sonnet summary at every compaction gave 75 to 76. Rewording the summary prompt did not move the score.

A hook that can fail also needs two grades of failure. I first treated a missing agent note as always degraded, then split it, so DEGRADED raises an alert and REDUCED is only logged, because alerting on every harmless fallback would teach me to ignore alerts (machine-setup ADR 0013, 2026-10-23, and ADR 0007, 2026-10-16; claude-handoff README).

How AI built this

  • Models. Sonnet builds and tests, Sonnet referees (Opus for hard cases), Opus or Fable orchestrates, and Haiku gathers (machine-setup code-blind-tdd.md and ADR 0004). I have no record of which model built which plugin.
  • Tests. 2,089 tests across nine suites (as of 2026-10-18). The six plugin suites are agents 378, compact 348, dev 214, usage 156, safety 143 and awareness 122. The other three are token-budget 321, handoff-hooks 208 and machine-setup 199 (bento-mods-tests README). The tests have grown since: counting the test functions in the three Python suites on 2026-10-27 gives token-budget 321, handoff-hooks 372 and machine-setup 199. I did not re-count the TypeScript suites, so I have no new total.
  • Code-blind. bento-mods-tests is a separate public repo whose tests were written from Bento's behaviour contract by an agent that had not seen the code.