Cigar
Your coding agent gets tired as its context fills up. Cigar notices the fatigue, saves a handoff, and restarts it fresh without losing the thread.
Two hours into a long coding session, your agent starts failing tool calls, re-reading files it already read, and undoing its own edits. By the time you notice, twenty minutes are gone — and if you reset too early, you lose your place. Cigar is a plugin for Claude Code that watches for those signs and offers the agent a break: write a structured handoff, reset the context, and pick up from the handoff in a fresh session. After every tool call, Cigar reads the context size from the session transcript and looks at the last 20 calls for five signals: failed calls, repeated identical calls, files re-read with no edit in between, edits that undo an earlier edit, and failed tests, builds or lint runs. It combines them with context pressure — how full the model's window is — into a fatigue score. It never nudges below 40,000 tokens, and never on fewer than 10 calls of evidence. In suggest mode, the default, the agent gets a short factual note and you see one line in the terminal. In auto mode, the whole break happens by itself — but only after a handoff has been saved, and never after an interrupted turn or for a subagent. Every model starts with a default knee, the context size where sessions usually start to slip — 100,000 tokens for Sonnet, 120,000 for Opus on a 200,000-token window — and as you work, Cigar learns where your sessions slip, per model. A report command shows the curve, and you can share your anonymous curve with the project's open dataset if you choose. Cigar is free and open source under the MIT license, and everything stays on your machine: no telemetry and no network calls. It has 57 commits since it was created on 23 October 2026 and was last pushed on 14 November 2026. It runs in the Claude Code terminal on Python 3.11 or newer, and the same detection is available as a standalone MCP server for other agents.