I Let Claude Code Run Unattended on a Real Build - Here's What I Learned

David IyaDavid Iya July 28, 2026 9 min read
A dim home office at night lit only by a laptop screen, an empty coffee mug beside the keyboard, a desk chair pushed back and no one sitting in it.
Original image, Claude Code Club

What 'Running Claude Code Unattended' Actually Means

Running Claude Code unattended means giving it a task and letting it work through the steps on its own - reading files, writing code, running commands, checking results - without you sitting there approving each move. In the desktop app you kick it off and walk away. The appeal is obvious: you describe the work, go make dinner, and come back to progress. The reality is more interesting than either the hype or the fear.

I tested this on a real client build, not a toy demo. The task was migrating a batch of old form components to a new validation library across a mid-size codebase - repetitive, well-defined, the kind of work that eats an afternoon of human attention but doesn't need much creativity. That combination turned out to be exactly the sweet spot.

The First Run Went Sideways (and Why)

My first attempt was lazy. I wrote a broad prompt - 'migrate the forms to the new validation library and clean things up while you're in there' - and let it go. When I came back, it had migrated the forms correctly, then kept going. It refactored a shared utility, renamed a few props for consistency, and touched files that had nothing to do with the task. None of it was wrong exactly. All of it was scope I hadn't asked for, which meant every one of those changes now needed review before I trusted it.

That is the core failure mode of unattended runs. Claude is genuinely capable, so when you leave the goal fuzzy, it fills the space with initiative. 'Clean things up while you're in there' is an open door. It will walk through it. The problem is not the tool being bad - it's the instruction being vague, and vague instructions are far more expensive when nobody is watching in real time.

The Leash Loop: How I Get Unattended Work Without the Mess

After that run I built a small routine I now call the Leash Loop. It's three moves, and it's the difference between coming back to progress and coming back to cleanup.

  1. Scope to one finishable job. Not 'improve the forms' but 'migrate exactly these 14 form files to the new library, changing nothing else.' Name the files if you can. A task with a clear edge is a task Claude can't wander past.
  2. Give it a way to check its own work. Point it at the test command or the type checker and tell it the run is not done until that passes. Now it has an objective signal for 'finished' instead of an open-ended sense of 'better.'
  3. Set a hard stopping condition. Tell it what done looks like and to stop there and report, rather than continuing to find more to do. The leash is short on purpose.

The name is the point. You're not caging the tool - a caged tool can't help you. You're keeping it on a leash long enough to do real work and short enough that it can't run off. When I re-ran the migration with the Leash Loop, it did the 14 files, ran the type checker until it was clean, and stopped. I reviewed a focused diff instead of an archaeology dig.

Where Unattended Runs Genuinely Save You Time

Once I stopped fighting the tool and started scoping for it, the wins were concrete. The pattern that predicts a good unattended run is always the same: the work is well-defined, repetitive, and has an automatic way to verify it's correct.

Tasks that work unattended vs tasks that need you watching

Good for unattended runsKeep yourself in the loop
Repetitive migrations across many similar filesArchitecture decisions with real tradeoffs
Writing tests against existing, stable behaviorAnything touching money, auth, or user data
Mechanical refactors with a clear before/afterOpen-ended 'make this better' work
Bulk edits verifiable by a test or type checkFirst drafts of features with fuzzy requirements

The Review Step Is Not Optional

Here's the honest part the hype skips. Even a clean, well-scoped unattended run produces a first draft, not a shipped feature. I still read every diff before it goes anywhere near production. The time I save is the time I would have spent typing the changes and grinding through the repetitive parts. The time I do not save is the review. If anything, unattended work makes the review more important, because I wasn't watching it happen and I don't have the running context of each decision in my head.

This is where the money guardrail lives, too. I will happily let Claude migrate form components overnight. I will not let it run unattended on anything that spends money, touches authentication, or writes to production data. The blast radius is too big and the failure is too hard to reverse. Unattended runs belong on reversible, reviewable work.

How to Try Your First Unattended Run This Week

Pick the most boring, most well-defined task on your list - the one you keep putting off because it's tedious rather than hard. Something like adding the same prop to a dozen components, or writing tests for a module whose behavior is already settled. In the Claude Code desktop app, write the prompt with the Leash Loop in mind: name the exact scope, point it at the check that proves it worked, and tell it to stop and report when that check passes.

Free Claude Code drops, straight to your inbox

Short, practical drops on skills, MCP, agents, prompts, and more. No spam, unsubscribe anytime.

Frequently asked questions

Can Claude Code really run unattended without me approving each step?

Yes. You can give Claude Code a task and let it read files, write code, run commands, and check results on its own. The catch is that unattended does not mean unsupervised - it works inside the guardrails you set up front. A narrowly scoped task with a clear finish line runs well unattended. An open-ended prompt is where it drifts into scope you didn't ask for.

What kind of work is safe to run unattended?

Repetitive, well-defined work that a machine can verify - migrations across many similar files, writing tests against stable behavior, mechanical refactors, bulk edits you can confirm with a test or type check. Avoid unattended runs on architecture decisions, anything touching money, auth, or user data, and open-ended 'make this better' tasks. If only a careful human read can tell you the result is correct, keep a human in the loop.

What is the Leash Loop?

It's the three-move routine I use to get unattended work without a mess: scope the task to one finishable job with a clear edge, give Claude a way to check its own work like a test or type checker, and set a hard stopping condition so it reports and stops instead of continuing to find more to do. It keeps the leash long enough for real work and short enough that Claude can't wander off.

Do I still need to review the output of an unattended run?

Always. Even a clean, well-scoped run produces a first draft, not a shipped feature. Read every diff before it goes near production. Unattended runs save you the time of typing the changes and grinding through the repetitive parts - they do not save you the review, and if anything the review matters more because you weren't watching each decision happen.

Why did my unattended run change files I didn't ask about?

Almost always because the prompt had an open-ended clause - something like 'and clean things up while you're in there.' Claude is capable enough that vague instructions get filled with initiative. Cut every open door out of the prompt, name the exact scope, and tell it to stop when the defined work is done. Narrow the instruction and the wandering stops.

Last reviewed by David Iya on July 28, 2026

David Iya

Written by

David Iya

Forbes 30 Under 30 · Y Combinator

Keep reading

Ready to build it yourself?

Join Claude Code Club, the #1 community for learning claude code, for $9/month.

← Back to the blog