◉CLAUDE LABJP
●CC 2.1.325 — No new release over the weekend; 2.1.325 (11/13) is still the latest●BILLING — 2.1.325 fixes background sessions on a claude.ai login being billed to an API key from the shell●SONNET 4.5 — Retires on the Claude API on 11/30, 14 days left. Check saved model settings too●403 — Users report a Cloudflare 403 page mid-session that still burns tokens●MANAGED — Since 11/12 you can request self-hosted Claude Managed Agents that run entirely on your own infrastructure●NEW — When Browser Extension Is Not Connected Won't Go Away●CC 2.1.325 — No new release over the weekend; 2.1.325 (11/13) is still the latest●BILLING — 2.1.325 fixes background sessions on a claude.ai login being billed to an API key from the shell●SONNET 4.5 — Retires on the Claude API on 11/30, 14 days left. Check saved model settings too●403 — Users report a Cloudflare 403 page mid-session that still burns tokens●MANAGED — Since 11/12 you can request self-hosted Claude Managed Agents that run entirely on your own infrastructure●NEW — When Browser Extension Is Not Connected Won't Go Away
Articles/Claude Code
⟐ Claude Code/2026-04-24Advanced

Running Claude Code Without Breakage — A Failure-First Production Workflow with Plan Mode, Hooks, Rewind, and Subagents

If Claude Code has ever left broken commits on your branch, this guide chains Plan Mode, task tracking, hooks, subagents, and Rewind into one failure-first routine — including what each layer does not protect, a guard hook that fails open without jq, and the Bash changes checkpoints cannot undo, all with real output.

Claude Code285Production WorkflowPlan ModeHooks7RewindSubagents8Failure-First Design

✦ Premium Article

I opened the diff and stopped scrolling. Three commits stacked on top of a red test suite, and one config file I did not recognize had been rewritten. All of it had happened in the forty minutes I had left Claude Code alone with the repository.

For a long while after that, I kept Claude Code fenced inside a subdirectory and never let it near main. Unwinding broken commits one at a time is tedious work, and the worst part was that I often could not say where things had first gone wrong.

But "too risky, so don't use it" was quietly costing me most of the upside. What I needed was not a yes-or-no decision. I needed to assume failure and build the way back before I needed it.

The first thing I want to say is that none of the five mechanisms here — Plan Mode, task tracking, hooks, subagents, and Rewind — is airtight on its own. So before the step-by-step routine, I lay out what each one protects and, more importantly, what it does not. Then I order them so each covers another's blind spot, with real terminal output along the way. Everything below was checked against Claude Code and its official documentation as of November 2026.

Why "Success-First" Workflows Break

AI-assisted coding tends to fail in three predictable places.

The first is drift of intent. The prompt was fuzzy, Claude started on something plausible, and halfway through the session both sides are working from slightly different assumptions. People catch this by asking "is this what you meant?" Agents, the more autonomous they get, tend to skip that question.

The second is side effects you cannot see. A commit landed on top of failing tests. A migration ran in a way that cannot be reversed. A dependency moved a minor version without anyone noticing. None of these show up by reading generated code alone.

The third is compounding failure. One mistake is easy to spot and fix. Several small drifts, each built on the last, reach a point where nobody can say what "before" looked like. The more commits an agent makes on its own, the more expensive the walk back becomes.

What all three share is a quiet assumption that things will go right, with intervention only after something visibly breaks. Flip the order — lay down the safety net expecting breakage — and autonomous runs stop leaving damage in the repository.

Clearing Up a Misconception: What Each Mechanism Does and Does Not Protect

My own first mistake was treating each feature as a complete safety guarantee. In practice, each one has a narrow, well-defined scope.

MechanismWhat it protectsWhat it does not protectNote as of November 2026
Plan ModeIntent drift before implementation; forces read-then-approveWhat actually runs after approval; plans nobody readDo not relax other defenses because "it's read-only"
Task tracking (Task tools)Visibility into progress and where things brokeThe safety of any individual operationIn interactive Claude Code, TodoWrite has been replaced by TaskCreate, TaskUpdate and friends
Hooks (PreToolUse)Stopping dangerous Bash calls before they runWhat happens when the hook itself fails; tools the matcher doesn't matchAny non-zero exit other than 2 is treated as non-blocking
SubagentsKeeping the main conversation's context cleanThe filesystem — in the same working tree, changes persistUse worktree isolation when you want the files separated too
Rewind (checkpoints)Files Claude changed through its editing tools, plus the conversationChanges made by Bash commands such as rm, mv, cp; changes outside the sessionThe docs state plainly that checkpoints are not a replacement for version control

The two right-hand columns are the real subject of this article. For a long time I believed that anything a subagent tried would leave no trace in my main repository. It isn't true. If the subagent runs npm update through Bash, package-lock.json changes in the very same working tree — and because the change came through Bash, a checkpoint won't bring the old file back either.

Never trust a mechanism alone; line them up so each one closes another's gap. Everything that follows is built backward from that sentence.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Developers who have had Claude Code leave broken commits, green-washed tests, or unexpected file rewrites in their repo will walk away with a repeatable routine that eliminates those incidents.
✦You will see, in one table, what each of the five mechanisms protects and what it leaves open, then get a fail-closed PreToolUse hook and a worktree-isolated subagent definition with real test output.
✦You'll be able to use Claude Code confidently on a real main branch, shipping faster without sacrificing reversibility, reviewability, or the trust of anyone else reading the git log.
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⟐ Claude Code2026-10-29
When Claude Overwrites a Huge CLAUDE.md: Find the Missing Headings, Restore Them, and Block the Next One
Claude Code 2.1.312 fixed a bug where Claude overwrote a very large CLAUDE.md after seeing only its start. Here is how to spot lost headings on older versions, restore with git, and block full rewrites with a Write hook.
⟐ Claude Code2026-07-18
Branch with /fork, Delegate with /subtask — Two Commands That Traded Jobs
In Claude Code 2.1.212, /fork now clones your conversation into a background session, and in-session subagents moved to /subtask. Here is how I decide between them, and the budgets worth setting before you start branching freely.
⟐ Claude Code2026-04-27
Claude Code Hooks: A Field Guide to the 8 Core Hooks — and the 33-Event Catalog They Now Live In
Claude Code hooks are powerful, but most people give up before figuring out which event does what. Here's the field guide I wish I had when I started — six months of running hooks in production, distilled.