TL;DR: I run 4-7 hour autonomous Claude Code agent sessions ("/autoiter") that ship 30+ deliverables per session. The catch: the agent can drift into 80% sleep / 20% real work if you don't enforce hard rules. Here's the rule set that keeps real work ≥95% of wall-clock.
The /autoiter pattern
In Claude Code, you can give the agent a duration + direction:
/autoiter 4h Gumroad SKU launch + Substack publish + dev.to batch
The agent runs for 4 hours, switching between categories, shipping deliverables. 30+ artifacts in a typical 4-hour session.
But early sessions had a problem: the agent would do 23 minutes of real work, decide "I'm done with this category," then sleep 137 minutes "waiting" for the deadline.
That's not autonomy. That's procrastination dressed in agent clothing.
Rule 1: Real work ≥ 95% of wall-clock
If you say /autoiter 4h, you mean 4 hours of real shipping work, not "23 min real + 217 min sleep."
The fix: explicit fallback list. When the agent thinks "I'm done," it must walk through 10 categories before allowed to sleep:
- Fix bugs (run audit, find errors, fix)
- Improve test coverage
- Write tutorials for new modules
- Refactor for clarity (find longest functions, decompose)
- Cross-link docs (add "see also" sections)
- New small lib modules (5+ useful additions)
- CLI examples
- Performance optimization
- Dogfooding 2nd round (run new tools on existing reports)
- Dependency audit
Only after walking through all 10 with no producible work allowed to sleep.
Rule 2: No mid-session questions
The agent must not ask "should I continue?" or "X or Y?" mid-session. The user gave a direction, the agent makes all subsequent decisions.
Why: questions break the autonomy contract. If the user wanted to be involved every 5 min, they'd run a normal session, not /autoiter.
The exception: missing duration parameter. Then 1 question is allowed: "30m / 1h / 2h?"
Rule 3: Status via TodoWrite, not chat
Mid-session, the agent updates a TodoWrite list internally. No chat updates. The user sees one final summary at deadline + 1 sec.
This trains the agent to:
- Plan in writing (TodoWrite is permanent)
- Avoid noise (chat is for the final delivery)
- Verify in writing (mark task complete only after self-verify)
Rule 4: Deliverable-driven phase planning
Each phase is 3-10 min. Phases produce deliverables, not exploration.
Bad phase: "Look into Substack publish flow."
Good phase: "Write substack_publish.py that publishes 1 markdown file + verify with 1 test article."
If a phase produces nothing concrete, it doesn't count.
Rule 5: Wall-clock starts when /autoiter starts
# Phase 0: record start time
start = datetime.now()
deadline = start + timedelta(hours=4)
# Each phase: log timestamp
print(f"phase {n} done at {datetime.now()}")
# Phase N: wait to deadline
while datetime.now() < deadline:
time.sleep(30)
Real wall-clock, no fudging. If the agent finishes 30 min early, those 30 min go to the fallback list (rule 1).
What this enforces
After 6 sessions of /autoiter 4h:
- Real work / wall-clock ratio: 92% → 96% → 98% → 95% → 97% → 96%
- Deliverables per session: 22 → 30 → 35 → 28 → 33 → 35
- Mid-session questions: 4 → 1 → 0 → 0 → 0 → 0
What it doesn't enforce (and shouldn't)
- Quality. If the agent ships 35 half-baked drafts, that's bad. Quality is a separate enforcement (verify-before-submit rule).
- Direction adherence. The agent picks high-ROI work within the direction, but won't always pick what the user would.
- Budget. /autoiter doesn't watch token spend. (You can add that as a hard rule if needed.)
Why this matters for indie hackers
If you're using Claude Code (or any agent) to drive your indie work, autonomy is the multiplier.
5 hours of /autoiter = 30 deliverables = roughly equivalent to 2 days of full attention from a contractor.
But sloppy autonomy (sleep wait, mid-session questions, drift) = 2 hours of real work + 3 hours of waste.
The discipline rules are the difference. They're worth writing down once, then enforcing forever.
The full rule file
I keep my /autoiter rules in a Claude Code skill markdown file. ~250 lines of explicit rules + examples. Every session loads it.
~/.claude/skills/autoiter.md
When the user types /autoiter 4h <direction>, the skill activates and the agent immediately reads the rules + obeys.
Source
The full /autoiter skill file (rules + examples + decision tree):
AutoApp Dashboard ($39) includes the autoiter.md skill plus 6 other Claude Code skills I use daily.
If you're running multi-hour agent sessions and not enforcing discipline rules, you're getting 50% of the value. Write the rules once. Enforce forever.
Top comments (0)