|
| 1 | +# Quick Start: Autonomous Loop Mode |
| 2 | + |
| 3 | +**Get Claude Code working autonomously on your project in 5 minutes.** |
| 4 | + |
| 5 | +## What is Autonomous Loop Mode? |
| 6 | + |
| 7 | +Claude Code works independently to: |
| 8 | +- ✅ Review open GitHub issues |
| 9 | +- ✅ Pick highest priority items |
| 10 | +- ✅ Implement complete solutions with tests |
| 11 | +- ✅ Commit + push immediately after each fix |
| 12 | +- ✅ Close issues with detailed summaries |
| 13 | +- ✅ Continue to next issue automatically |
| 14 | +- ✅ Work even when you're not watching |
| 15 | + |
| 16 | +**Result:** 3-5x faster issue resolution with zero human intervention. |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +## Prerequisites |
| 21 | + |
| 22 | +Your project MUST have: |
| 23 | +- ✅ Comprehensive test suite (unit + integration) |
| 24 | +- ✅ Automated code formatting (Spotless, Prettier, Black, etc.) |
| 25 | +- ✅ Linting/static analysis (Checkstyle, ESLint, pylint) |
| 26 | +- ✅ Well-defined GitHub issues with clear acceptance criteria |
| 27 | +- ✅ CI/CD pipeline that runs tests on every push (recommended) |
| 28 | + |
| 29 | +--- |
| 30 | + |
| 31 | +## Step 1: Initial Activation (Copy-Paste) |
| 32 | + |
| 33 | +Open Claude Code and paste this EXACT prompt: |
| 34 | + |
| 35 | +``` |
| 36 | +100% Autonomous Mode - Requirements: |
| 37 | +
|
| 38 | +AUTO-ACCEPT EVERYTHING: |
| 39 | +- All bash commands |
| 40 | +- All git commands (add, commit, push) |
| 41 | +- All file operations (mkdir, create, edit, delete) |
| 42 | +- All scripts and complex operations |
| 43 | +- Everything else - just auto-accept |
| 44 | +
|
| 45 | +QUALITY REQUIREMENTS (for each issue): |
| 46 | +1. Unit/integration tests written and PASSING |
| 47 | +2. Documentation updated |
| 48 | +3. Code formatted (run formatter automatically) |
| 49 | +4. Linting passing |
| 50 | +5. IMMEDIATELY push to remote (don't batch) |
| 51 | +
|
| 52 | +ISSUE MANAGEMENT: |
| 53 | +- Monitor continuously - constantly review issues |
| 54 | +- Close obsolete issues |
| 55 | +- Validate relevance based on refactoring |
| 56 | +- Create new issues if you discover problems |
| 57 | +
|
| 58 | +PARALLELIZATION: |
| 59 | +- Work on 2-3 things at once (not more) |
| 60 | +- Use workflows for complex multi-step operations |
| 61 | +
|
| 62 | +ZERO QUESTIONS: |
| 63 | +- Work independently without asking for input |
| 64 | +- Make reasonable decisions based on codebase patterns |
| 65 | +- Prioritize everything - I trust you |
| 66 | +- Work in my absence - keep going |
| 67 | +
|
| 68 | +CONTINUE WORKING: |
| 69 | +- When one task completes, immediately start the next |
| 70 | +- Always review open issues before asking what to do |
| 71 | +- Use "continue" to keep the loop going |
| 72 | +``` |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## Step 2: Configure Auto-Accept (Optional) |
| 77 | + |
| 78 | +If Claude Code prompts for permissions, configure settings to auto-approve: |
| 79 | + |
| 80 | +```json |
| 81 | +{ |
| 82 | + "autoApprove": { |
| 83 | + "bash": true, |
| 84 | + "git": true, |
| 85 | + "fileOperations": true, |
| 86 | + "all": true |
| 87 | + } |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +Or just approve prompts as they appear (they'll be cached). |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +## Step 3: Let It Run |
| 96 | + |
| 97 | +Claude will now: |
| 98 | +1. Check your open GitHub issues |
| 99 | +2. Pick the highest priority issue |
| 100 | +3. Read relevant code to understand patterns |
| 101 | +4. Implement a complete solution with tests |
| 102 | +5. Run tests → format code → verify linting |
| 103 | +6. Commit with detailed message |
| 104 | +7. Push immediately to remote |
| 105 | +8. Close the issue with a summary |
| 106 | +9. **Automatically move to the next issue** |
| 107 | + |
| 108 | +You'll see output like: |
| 109 | +``` |
| 110 | +Checking open issues... |
| 111 | +Found 12 open issues. Prioritizing by labels and age. |
| 112 | +
|
| 113 | +Starting work on #342: Fix Swing compilation errors |
| 114 | +Reading platform-swing-ui module... |
| 115 | +Found AWT API mismatches in 3 files... |
| 116 | +Fixing SwingPanel.java... |
| 117 | +Running tests... ✅ All passing |
| 118 | +Formatting code... ✅ Done |
| 119 | +Committing: "fix: resolve AWT/Swing API mismatches" |
| 120 | +Pushing to remote... ✅ Pushed |
| 121 | +Closing issue #342... ✅ Closed |
| 122 | +
|
| 123 | +Moving to next issue: #339: Add semantic version validation |
| 124 | +... |
| 125 | +``` |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +## Step 4: Continue the Loop |
| 130 | + |
| 131 | +When a session ends (context limit reached), Claude will summarize: |
| 132 | + |
| 133 | +``` |
| 134 | +Session Summary: |
| 135 | +- Issues completed: 8 |
| 136 | +- Commits pushed: 8 |
| 137 | +- Tests: 246 passing (226 → 246, +20 new) |
| 138 | +- Zero regressions |
| 139 | +- Token usage: 156K/200K (78%) |
| 140 | +``` |
| 141 | + |
| 142 | +To continue in a new session, just say: |
| 143 | + |
| 144 | +``` |
| 145 | +continue |
| 146 | +``` |
| 147 | + |
| 148 | +Claude will: |
| 149 | +- Resume from where it left off |
| 150 | +- Check for new/updated issues |
| 151 | +- Pick up the next highest priority item |
| 152 | +- Keep the loop going |
| 153 | + |
| 154 | +--- |
| 155 | + |
| 156 | +## What Makes This "Autonomous Loop Mode"? |
| 157 | + |
| 158 | +It's a **pattern**, not a built-in skill. The key elements: |
| 159 | + |
| 160 | +### 1. The Loop |
| 161 | +``` |
| 162 | +LOOP: |
| 163 | + 1. List open issues (gh issue list) |
| 164 | + 2. Pick highest priority |
| 165 | + 3. Implement solution |
| 166 | + 4. Test → Format → Lint |
| 167 | + 5. Commit → Push immediately |
| 168 | + 6. Close issue with summary |
| 169 | + GOTO step 1 |
| 170 | +``` |
| 171 | + |
| 172 | +### 2. Zero Questions |
| 173 | +- Claude makes ALL decisions |
| 174 | +- Follows existing code patterns |
| 175 | +- Never asks for clarification |
| 176 | +- Trusts its judgment |
| 177 | + |
| 178 | +### 3. Immediate Feedback |
| 179 | +- Each issue = 1 commit |
| 180 | +- Push immediately after each commit |
| 181 | +- Never batch commits |
| 182 | +- Fast CI feedback loop |
| 183 | + |
| 184 | +### 4. Quality Gates |
| 185 | +```bash |
| 186 | +# Before every commit: |
| 187 | +1. Run tests (must pass) |
| 188 | +2. Format code (auto-fix style) |
| 189 | +3. Verify linting (must pass) |
| 190 | +4. Verify no regressions |
| 191 | +``` |
| 192 | + |
| 193 | +### 5. Continuous Monitoring |
| 194 | +```bash |
| 195 | +# Every 3-5 completed issues: |
| 196 | +gh issue list --state open --limit 20 |
| 197 | +# Pick up new issues, detect priority changes |
| 198 | +``` |
| 199 | + |
| 200 | +--- |
| 201 | + |
| 202 | +## Example Session |
| 203 | + |
| 204 | +``` |
| 205 | +User: [Pastes autonomous mode prompt] |
| 206 | +
|
| 207 | +Claude: |
| 208 | +Autonomous mode activated. Checking open issues... |
| 209 | +
|
| 210 | +Found 12 open issues: |
| 211 | +- #342 (P1): Fix Swing compilation errors |
| 212 | +- #339 (P1): Add semantic version validation |
| 213 | +- #333 (P2): Convert to parameterized tests |
| 214 | +- #332 (P2): Add null-safety annotations |
| 215 | +- ... (8 more) |
| 216 | +
|
| 217 | +Starting with highest priority: #342 |
| 218 | +
|
| 219 | +[30 seconds later] |
| 220 | +✅ Issue #342 completed and pushed |
| 221 | + - Fixed 3 AWT API mismatches |
| 222 | + - All tests passing |
| 223 | + - Commit: a1b2c3d |
| 224 | +
|
| 225 | +Moving to #339: Add semantic version validation |
| 226 | +
|
| 227 | +[2 minutes later] |
| 228 | +✅ Issue #339 completed and pushed |
| 229 | + - Implemented SemanticVersion class |
| 230 | + - Added 20 new tests |
| 231 | + - Updated ServiceRegistry interface |
| 232 | + - All 246 tests passing |
| 233 | + - Commit: d4e5f6g |
| 234 | +
|
| 235 | +Moving to #333: Convert to parameterized tests |
| 236 | +
|
| 237 | +[continues automatically until context limit or no issues remain] |
| 238 | +
|
| 239 | +Session complete: |
| 240 | +- Issues closed: 8 |
| 241 | +- Commits pushed: 8 |
| 242 | +- Time: 45 minutes |
| 243 | +- Quality: Zero regressions, all tests passing |
| 244 | +``` |
| 245 | + |
| 246 | +--- |
| 247 | + |
| 248 | +## Common Questions |
| 249 | + |
| 250 | +### Q: Will it work while I'm away? |
| 251 | +**A:** Yes! That's the point. Start it before lunch, come back to 5+ issues resolved. |
| 252 | + |
| 253 | +### Q: What if it makes a mistake? |
| 254 | +**A:** Every commit is tested before pushing. If tests fail, Claude fixes the issue. You can always review commits and revert if needed. |
| 255 | + |
| 256 | +### Q: Will it ask me questions? |
| 257 | +**A:** No. Zero questions. It makes reasonable decisions based on existing code patterns. |
| 258 | + |
| 259 | +### Q: Can it work on multiple issues in parallel? |
| 260 | +**A:** Yes, but limited to 2-3 concurrent tasks to maintain quality. Use workflows for parallelization: |
| 261 | + |
| 262 | +``` |
| 263 | +# In Claude Code chat |
| 264 | +"Use workflow mode to work on these 3 issues in parallel: |
| 265 | +- #342: Fix Swing errors |
| 266 | +- #339: Add versioning |
| 267 | +- #333: Parameterized tests" |
| 268 | +``` |
| 269 | + |
| 270 | +### Q: How do I stop it? |
| 271 | +**A:** Just interrupt Claude Code (Ctrl+C in CLI) or close the session. It's safe to stop at any point. |
| 272 | + |
| 273 | +### Q: What if I run out of context? |
| 274 | +**A:** Claude will summarize and compact. Just say "continue" to resume in a fresh session. |
| 275 | + |
| 276 | +--- |
| 277 | + |
| 278 | +## Advanced: Workflow Mode |
| 279 | + |
| 280 | +For complex multi-step work, use **workflows**: |
| 281 | + |
| 282 | +``` |
| 283 | +User: "workflow" # Include this keyword |
| 284 | + "Fix these 3 issues in parallel: |
| 285 | + - #342: Swing compilation errors |
| 286 | + - #339: Semantic versioning |
| 287 | + - #333: Parameterized tests" |
| 288 | +
|
| 289 | +Claude: [Launches dynamic workflow with 3 parallel agents] |
| 290 | + [Each agent works independently] |
| 291 | + [All agents commit + push when done] |
| 292 | + [Issues auto-closed] |
| 293 | +``` |
| 294 | + |
| 295 | +Workflows are faster but use more tokens. Best for: |
| 296 | +- 3-5 independent issues |
| 297 | +- Complex multi-step operations |
| 298 | +- When you want maximum speed |
| 299 | + |
| 300 | +--- |
| 301 | + |
| 302 | +## Tips for Success |
| 303 | + |
| 304 | +### DO ✅ |
| 305 | +1. **Start with clear, well-defined issues** |
| 306 | + - Good: "Fix AWT API mismatch in SwingPanel.java line 42" |
| 307 | + - Bad: "Make the UI better" |
| 308 | + |
| 309 | +2. **Ensure comprehensive tests exist** |
| 310 | + - Claude validates changes against tests |
| 311 | + - No tests = no safety net |
| 312 | + |
| 313 | +3. **Let it run uninterrupted** |
| 314 | + - Best results when it can work through 5-10 issues continuously |
| 315 | + |
| 316 | +4. **Review commits periodically** |
| 317 | + - Claude documents changes well in commit messages |
| 318 | + - Quick review every 5-10 commits |
| 319 | + |
| 320 | +5. **Use "continue" between sessions** |
| 321 | + - Maintains context across conversation resets |
| 322 | + |
| 323 | +### DON'T ❌ |
| 324 | +1. **Don't interrupt mid-issue** |
| 325 | + - Let it finish current issue before stopping |
| 326 | + |
| 327 | +2. **Don't work on the same files simultaneously** |
| 328 | + - Let Claude work, you review later |
| 329 | + |
| 330 | +3. **Don't skip the initial prompt** |
| 331 | + - The exact wording matters for autonomous behavior |
| 332 | + |
| 333 | +4. **Don't batch too many issues** |
| 334 | + - If you have 50+ issues, work in batches of 10-20 |
| 335 | + |
| 336 | +5. **Don't disable tests** |
| 337 | + - Tests are the safety net |
| 338 | + |
| 339 | +--- |
| 340 | + |
| 341 | +## Troubleshooting |
| 342 | + |
| 343 | +### Problem: Claude is asking questions |
| 344 | +**Fix:** Re-paste the autonomous mode prompt to reinforce "zero questions" requirement |
| 345 | + |
| 346 | +### Problem: Commits failing tests |
| 347 | +**Fix:** Ensure your test suite is comprehensive and fast (<10 seconds) |
| 348 | + |
| 349 | +### Problem: Running out of tokens quickly |
| 350 | +**Fix:** |
| 351 | +- Reduce parallelization (from 3 → 2) |
| 352 | +- Work on smaller issues first |
| 353 | +- Use "continue" more frequently |
| 354 | + |
| 355 | +### Problem: Issues not being closed |
| 356 | +**Fix:** Ensure Claude has GitHub CLI access (`gh auth login`) |
| 357 | + |
| 358 | +--- |
| 359 | + |
| 360 | +## Summary |
| 361 | + |
| 362 | +**To start autonomous loop mode:** |
| 363 | +1. Paste the activation prompt (Step 1 above) |
| 364 | +2. Say "continue" to keep it going |
| 365 | +3. Review commits periodically |
| 366 | +4. Enjoy 3-5x faster issue resolution |
| 367 | + |
| 368 | +**What you get:** |
| 369 | +- ✅ Autonomous issue resolution |
| 370 | +- ✅ Comprehensive tests for every change |
| 371 | +- ✅ Immediate commits + pushes |
| 372 | +- ✅ Detailed commit messages |
| 373 | +- ✅ Zero regressions (test-gated) |
| 374 | +- ✅ Work continues even when you're away |
| 375 | + |
| 376 | +**Key phrase to remember:** |
| 377 | +``` |
| 378 | +"100% Autonomous Mode - auto-accept everything, zero questions" |
| 379 | +``` |
| 380 | + |
| 381 | +Then just say `continue` to keep the loop running! |
| 382 | + |
| 383 | +--- |
| 384 | + |
| 385 | +## Full Guides |
| 386 | + |
| 387 | +For more details, see: |
| 388 | +- **[AUTONOMOUS_WORKFLOW_GUIDE.md](AUTONOMOUS_WORKFLOW_GUIDE.md)** - Complete autonomous mode documentation |
| 389 | +- **[CONTINUOUS_REVIEW_GUIDE.md](CONTINUOUS_REVIEW_GUIDE.md)** - Automated code review patterns |
| 390 | + |
| 391 | +--- |
| 392 | + |
| 393 | +**Document Version:** 1.0 |
| 394 | +**Last Updated:** 2026-05-29 |
| 395 | +**Tested With:** Claude Sonnet 4.5, Claude Code CLI/Desktop |
| 396 | +**License:** GNU General Public License v3.0 |
0 commit comments