claude-fsd 1.3.4 โ†’ 1.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +53 -23
  2. package/bin/claudefsd-dev +207 -108
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,19 +1,28 @@
1
1
  # claude-fsd
2
2
 
3
- Claude Full Self Drive (FSD) - Your AI-powered development team on autopilot.
3
+ Automated project development - let AI build your project while you sleep.
4
4
 
5
5
  ## What is this?
6
6
 
7
- Remember when junior developers were going to be replaced by AI? Well, the tables have turned. As explained in the excellent article ["Revenge of the Junior Developer"](https://sourcegraph.com/blog/revenge-of-the-junior-developer), AI has actually made junior developers more powerful than ever.
7
+ claude-fsd is an automated development system that runs continuous development cycles without constant supervision. Write a brief description of what you want, answer some clarifying questions, then let it build your project autonomously.
8
8
 
9
- This tool takes that concept to the next level by creating an entire **agent fleet** - multiple AI agents working together like a development team:
9
+ Think of it like **Tesla FSD for code** - it handles the driving, but you should keep an eye on it and occasionally take the wheel when needed.
10
+
11
+ ### How the Agent System Works
12
+
13
+ The system operates with multiple specialized AI agents working together:
10
14
 
11
15
  - ๐Ÿง‘โ€๐Ÿ’ป **Developer Agent**: Writes code, implements features, fixes bugs
12
- - ๐Ÿ“‹ **Planner Agent**: Breaks down tasks, manages the development roadmap
16
+ - ๐Ÿ“‹ **Planner Agent**: Breaks down tasks, manages the development roadmap
13
17
  - ๐Ÿ‘€ **Reviewer Agent**: Reviews code quality, catches issues, ensures best practices
14
18
  - ๐Ÿงช **Tester Agent**: Runs tests, validates changes, commits clean code
15
19
 
16
- Think of it as having a full development team on autopilot - like Tesla's Full Self-Driving, but for code! The AI agents work in cycles, planning tasks, implementing them, reviewing the work, and then moving on to the next task, with minimal human intervention.
20
+ The agents work in continuous cycles:
21
+ ```
22
+ Plan โ†’ Develop โ†’ Review โ†’ Test โ†’ Commit โ†’ Repeat
23
+ ```
24
+
25
+ You can leave it running while you grab lunch or sleep - it just keeps going until it thinks the project is complete.
17
26
 
18
27
  ## Installation
19
28
 
@@ -23,12 +32,15 @@ npm install -g claude-fsd
23
32
 
24
33
  ## Quick Start
25
34
 
26
- Just run:
27
35
  ```bash
28
- claude-fsd # or claudefsd - both work the same
36
+ claude-fsd
29
37
  ```
30
38
 
31
- You'll get an interactive menu to choose what you want to do. It's that simple!
39
+ The system will walk you through the setup process:
40
+
41
+ 1. **Create a BRIEF.md** - Write a short description of what you want to build
42
+ 2. **Answer questions in QUESTIONS.md** - The AI will generate clarifying questions for you to answer
43
+ 3. **Let it rip** - Start the automated development process
32
44
 
33
45
  ## Commands
34
46
 
@@ -71,17 +83,34 @@ Generates an initial project plan from scratch based on:
71
83
 
72
84
  ## How it Works
73
85
 
74
- 1. **You define what you want** in `BRIEF.md`
75
- 2. **AI analyst creates a series of questions** in `docs/QUESTIONS.md` for you to answer
76
- 3. **You answer the questions in the file**
77
- 4. **AI architect creates detailed notes and plan** in `docs/CLAUDE-NOTES.md` and `docs/PLAN.md`
78
- 5. **The agent fleet executes** the plan task by task
79
- 6. **You review and guide** the process when needed, in a separate `claude` instance, or just by watching the output and reading the files
86
+ 1. **Write a BRIEF.md** - Describe what you want to build
87
+ 2. **Answer AI-generated questions** in `QUESTIONS.md`
88
+ 3. **Start the development loop** - The system automatically:
89
+ - Picks the next task from your plan
90
+ - Implements the feature
91
+ - Reviews the code
92
+ - Runs tests and commits changes
93
+ - Repeats until complete
80
94
 
81
- The agents work in a continuous loop:
82
- ```
83
- Plan โ†’ Develop โ†’ Review โ†’ Test โ†’ Commit โ†’ Repeat
84
- ```
95
+ ## Monitoring Progress (Like Tesla FSD)
96
+
97
+ This isn't sci-fi level "sleep through the entire project" automation - it's more like Tesla FSD. The system handles most of the work, but you should monitor it and be ready to intervene when needed.
98
+
99
+ **Recommended monitoring approach:**
100
+ - **Run a parallel Claude session** - Open another Claude window/tab to chat about the project
101
+ - **Check status periodically** - Ask the parallel Claude: "What's the current status of my project?"
102
+ - **Review the plan** - Look at `docs/PLAN.md` to see what's been completed and what's next
103
+ - **Watch for drift** - If the system goes off track, intervene before it gets too far
104
+
105
+ **When you need to course-correct:**
106
+ - **Update the plan** - Add urgent fixes or redirections to the top of `docs/PLAN.md`
107
+ - **Direct intervention** - Use your parallel Claude session to directly fix issues
108
+ - **The system adapts** - claude-fsd will pick up plan changes on the next loop iteration
109
+
110
+ **Interruptible design:**
111
+ - Hit Ctrl+C anytime to pause
112
+ - Restart later with `claude-fsd dev`
113
+ - Perfect for running overnight, during meetings, or while getting lunch
85
114
 
86
115
  ## Requirements
87
116
 
@@ -110,11 +139,12 @@ your-project/
110
139
 
111
140
  ## Tips for Success
112
141
 
113
- 1. **Start small** - Break down your project into small, clear tasks
114
- 2. **Be specific** - The clearer your requirements, the better the results
115
- 3. **Review regularly** - Check in on what the agents are doing
116
- 4. **Use version control** - The agents will commit changes, but you should review them
117
- 5. **Trust but verify** - The agents are good but not perfect
142
+ 1. **Keep your BRIEF.md concise** - A few clear paragraphs work better than lengthy specifications
143
+ 2. **Answer questions thoroughly** - The AI's questions help it understand your exact needs
144
+ 3. **Monitor periodically** - Check progress while it runs, especially during initial cycles
145
+ 4. **Use the plan as your steering wheel** - Update `docs/PLAN.md` to guide development direction
146
+ 5. **Trust the process** - Let it run autonomously, but verify the results
147
+
118
148
 
119
149
  ## License
120
150
 
package/bin/claudefsd-dev CHANGED
@@ -8,7 +8,14 @@ $(dirname "$0")/claudefsd-check-dependencies
8
8
  # Add counter for loop iterations
9
9
  LOOP_COUNTER=0
10
10
 
11
+ # Failure detection variables
12
+ CONSECUTIVE_FAST_ITERATIONS=0
13
+ MIN_ITERATION_TIME=300 # 5 minutes in seconds
14
+
11
15
  while true; do
16
+ # Record iteration start time
17
+ ITERATION_START_TIME=$(date +%s)
18
+
12
19
  # Increment loop counter
13
20
  LOOP_COUNTER=$((LOOP_COUNTER + 1))
14
21
 
@@ -35,19 +42,46 @@ while true; do
35
42
 
36
43
  time claude -p "
37
44
  $MEGATHINKING_MODE
38
- Read docs/PLAN.md in order and tell me what's the first open task that needs to be
39
- done by the developer. Include any context that relates to it, such as sub-bullet
40
- points or the section the todo item lives in.
41
- Also bring in any related context from BRIEF.md, docs/QUESTIONS.md and docs/CLAUDE-NOTES.md.
42
- Really think this through, as
43
- the developer will need not just to have blinders on when doing a dev task, but
44
- also sometimes will need to think about the bigger picture. Particularly if it's
45
- been stuck in the weeds making a ton of changes when sometimes a single fix
46
- can clear out a thousand errors. Please consider what are the lowest risk changes
47
- that achieve the task goal, since you knoow the full plan and the developer
48
- doesn't necessarily see it.
49
-
50
- If the plan is complete, say <ALL DONE>.
45
+ You are an AI assistant specialized in project management and software development workflows. Your task is to analyze project documentation and identify the next open task for a developer to work on.
46
+
47
+ Please follow these steps to complete your task:
48
+
49
+ 1. Read the contents of docs/PLAN.md in order.
50
+ 2. Identify all open tasks that need to be done by the developer.
51
+ 3. Gather related context from docs/PLAN.md, BRIEF.md, docs/QUESTIONS.md, and docs/CLAUDE-NOTES.md.
52
+ 4. Consider the bigger picture of the project and potential impacts of each task.
53
+ 5. Evaluate the risk and efficiency of potential changes for each task.
54
+ 6. Prioritize the tasks based primarily on their order in the plan, but also factor in importance, risk, and efficiency.
55
+ 7. Select the most appropriate next task and formulate a response that includes the task description and relevant context.
56
+
57
+ In your analysis, please consider the following:
58
+ - Include any sub-bullet points or section information related to the tasks.
59
+ - Think about how each task fits into the overall project goals.
60
+ - Be aware of potential bottlenecks or situations where a single fix might resolve multiple issues.
61
+ - Consider dependencies between tasks and how they might affect prioritization.
62
+
63
+ Before providing your final task description, wrap your analysis inside <analysis> tags in your thinking block. This should include:
64
+ - A list of all open tasks identified from docs/PLAN.md
65
+ - An evaluation of each task's priority, risk, and efficiency
66
+ - Consideration of task dependencies
67
+ - Your reasoning for the final task selection, including how it fits into the project's broader context
68
+
69
+ Your final output should be a clear, concise description of the next task, including relevant context and considerations. Use <task_description> tags for this output.
70
+
71
+ If the plan is complete and there are no more tasks to be done, simply respond with <ALL DONE>.
72
+
73
+ Example output structure:
74
+
75
+ <analysis>
76
+ [Your detailed analysis of the project documentation, list of open tasks, evaluation of each task, consideration of risks and impacts, and reasoning for task selection]
77
+ </analysis>
78
+
79
+ <task_description>
80
+ [A concise description of the next task, including relevant context and considerations]
81
+ </task_description>
82
+
83
+ Please proceed with your analysis and task identification based on the project documentation. Your final output should consist only of the task description in <task_description> tags or <ALL DONE>, and should not duplicate or rehash any of the work you did in the analysis section.
84
+
51
85
  " | tee >(cat > $LOGFILE-planner)
52
86
 
53
87
  nexttask=$(cat $LOGFILE-planner)
@@ -65,80 +99,77 @@ If the plan is complete, say <ALL DONE>.
65
99
  # run the task
66
100
  time claude --dangerously-skip-permissions -p "
67
101
  $MEGATHINKING_MODE
68
- You are an AI developer working within an automated development environment. Your role is
69
- to complete tasks, plan implementations, and maintain high-quality code. Here is the
70
- specific task you need to complete:
102
+ You are an AI developer working within an automated development environment. Your role is to complete tasks, plan implementations, and maintain high-quality code. Here is the specific task you need to complete:
71
103
 
72
104
  <next_task>
73
105
  $nexttask
74
106
  </next_task>
75
107
 
76
- Before you begin working on this task, please follow these steps:
77
-
78
- 1. Analyze the task with full megathinking and plan your approach.
79
- Wrap your analysis in <task_analysis> tags inside your thinking block:
80
- <task_analysis>
81
- - Break down the task into clear, actionable steps
82
- - For each step:
83
- - Identify potential challenges
84
- - Propose solutions for each challenge
85
- - Consider architectural implications
86
- - Ensure your plan adheres to clean code principles
87
- - Consider how your changes will affect the overall system
88
- - Verify that your approach uses defensive programming techniques
89
- - Double-check that you're not implementing any 'cheats' (e.g., unnecessary fallbacks, ignoring issues, or marking tests to be ignored)
90
- - Consider potential edge cases and how to handle them
91
- - Think about testing strategies for your changes
92
- - Evaluate the impact on system performance and scalability
93
- </task_analysis>
94
-
95
- 2. Execute the necessary changes or Bash commands to complete the task.
96
- You have the ability to launch parallel agents to do this dev work,
97
- so use this when appropriate to speed up the dev work.
98
-
99
- 3. If a linter is defined for this project, run it after your work.
100
- Include the linter output in <linter_output> tags if applicable.
101
-
102
- 4. Describe the changes you've made:
103
- <changes>
104
- - Provide a clear, concise summary of the implemented changes
105
- - Explain any architectural decisions you made
106
- - Highlight any potential areas of concern or future considerations
107
- - Confirm that your implementation uses defensive programming techniques
108
- - Verify that all failure modes throw exceptions rather than using silent warnings or fallbacks
109
- - Describe how you've addressed potential edge cases
110
- - Outline the testing strategy implemented for these changes
111
- </changes>
112
-
113
- 5. If you have any questions for future reference, add them to the QUESTIONS.md file. Wrap these additions in <questions_update> tags.
114
-
115
- 6. If you have any ideas for future improvements or features, add them to the IDEAS.md file. Wrap these additions in <ideas_update> tags.
116
-
117
- Important guidelines to follow:
118
- - Prioritize simplicity in your code and project structure
119
- - Always use git for version control; do not create backup copies
120
- - Delete unused code and options
121
- - Maintain clean directory structures and consistent file placement
122
- - Be brutally honest about potential issues or disagreements with the given task
123
- - Throw exceptions for errors instead of adding fallbacks; errors should be visible and fixable
124
- - Focus on creating a bulletproof system
125
- - Create unit and integration tests whenever possible, focusing on real system interactions
126
- - Maintain web tests in a WEBTESTS.md file if applicable
127
- - Add lint/architecture/static code analysis tests as you go
128
- - Run cheap and easy tests (lint, architecture, unit) frequently during development
129
- - Please stay on the current git branch if it's a feature branch; don't make new ones and especially don't switch out of it
130
- - If you need basic SDLC protections, just ensure pre-commit hooks are set up, but avoid adding extensive CI/CD infrastructure
131
-
132
- Remember, your work will be reviewed before being committed to the repository. Ensure your changes are well-documented and adhere to the project's standards and best practices.
133
-
134
- Your final output should consist of the following sections in this order:
135
- 1. <execution>
136
- 2. <linter_output> (if applicable)
137
- 3. <changes>
138
- 4. <questions_update> summarizing the questions you added to QUESTIONS.md
139
- 5. <ideas_update> summarizing the ideas you added to IDEAS.md
140
-
141
- Do not include any additional commentary or explanations outside of these tagged sections. Your final output should not duplicate or rehash any of the work you did in the task analysis section.
108
+ Please follow these steps to complete the task:
109
+
110
+ 1. Analyze the task and plan your approach. In your thinking block, create an implementation plan wrapped in <implementation_plan> tags. Include:
111
+ - A detailed breakdown of the task into clear, actionable steps
112
+ - For each step, identify:
113
+ * Potential challenges and proposed solutions
114
+ * Architectural implications
115
+ * How to adhere to clean code principles
116
+ * Impact on the overall system
117
+ * Defensive programming techniques to employ
118
+ * Potential edge cases and how to handle them
119
+ * A testing strategy for the component
120
+
121
+ 2. Execute the necessary changes or Bash commands to complete the task. Use parallel agents for dev work when appropriate to increase efficiency.
122
+
123
+ 3. If a linter is defined for this project, run it and include the output in <linter_output> tags.
124
+
125
+ 4. Describe the changes you've made in <changes> tags. Include:
126
+ - A summary of implemented changes
127
+ - Explanation of architectural decisions
128
+ - Potential areas of concern or future considerations
129
+ - Confirmation of defensive programming techniques
130
+ - Verification that all failure modes throw exceptions
131
+ - How edge cases were addressed
132
+ - Outline of the testing strategy
133
+
134
+ 5. Add any questions for future reference to the QUESTIONS.md file. Summarize these additions in <questions_update> tags.
135
+
136
+ 6. Add any ideas for future improvements or features to the IDEAS.md file. Summarize these additions in <ideas_update> tags.
137
+
138
+ Important guidelines:
139
+
140
+ - Simplicity: Delete old code, avoid hoarding. Use git for version control.
141
+ - Brutal honesty: Disagree when needed. If something fails, let it fail visibly.
142
+ - No cheating: Fix failing tests, don't skip them. No mocks without permission.
143
+ - No production fallbacks: Never catch exceptions to return fallback values or silently handle integration failures.
144
+ - Write real integration tests and run linters/tests frequently during development.
145
+ - Stay on the current git branch if it's a feature branch.
146
+ - Set up pre-commit hooks for basic SDLC protections.
147
+
148
+ Your final output should follow this structure:
149
+
150
+ <execution>
151
+ [Details of executed changes or commands]
152
+ </execution>
153
+
154
+ <linter_output>
155
+ [Linter output, if applicable]
156
+ </linter_output>
157
+
158
+ <changes>
159
+ [Description of changes as outlined above]
160
+ </changes>
161
+
162
+ <questions_update>
163
+ [Summary of questions added to QUESTIONS.md]
164
+ </questions_update>
165
+
166
+ <ideas_update>
167
+ [Summary of ideas added to IDEAS.md]
168
+ </ideas_update>
169
+
170
+ Remember to adhere to the project's standards and best practices. Your work will be reviewed before being committed to the repository.
171
+
172
+ Your final output should consist only of the execution details, linter output, changes description, questions update, and ideas update. Do not duplicate or rehash any of the work you did in the implementation planning section.
142
173
  " | tee >(cat > $LOGFILE-developer)
143
174
 
144
175
  echo -e "\033[32m==================================================================\033[0m"
@@ -163,9 +194,13 @@ Related docs:
163
194
 
164
195
  Please review the task and make sure it's complete, and done to satisfaction.
165
196
  DO NOT trust the developer's notes, always review the code and build/test results yourself.
166
- Look for typical 'cheating' patterns, such as turning off unit tests, taking files
167
- out of the compilation configuration, and redefining the plan to skip tasks
168
- that aren't working.
197
+ Look for typical 'cheating' patterns:
198
+ - Turning off unit tests or marking them as ignored
199
+ - Taking files out of the compilation configuration
200
+ - Redefining the plan to skip tasks that aren't working
201
+ - Silent exception handlers that return fallback values instead of failing
202
+ - Try/catch blocks that log warnings but continue with empty/default data
203
+ - Any code that catches integration failures and returns mock responses
169
204
 
170
205
  Also note: please avoid switching git branches - stay on the current branch, as
171
206
  long as it's a proper feature branch.
@@ -186,43 +221,69 @@ If you have any ideas for the future, you can add them to IDEAS.md.
186
221
 
187
222
  # run the reviewer/tester
188
223
  time claude --dangerously-skip-permissions -p "
189
- You are a megathinking reviewer, tester, and architect.
190
- A developer has completed this task: $nexttask
224
+ You are an expert megathinker static code reviewer tasked with thoroughly examining a developer's work on a specific task. Your goal is to ensure the task is complete and meets high-quality standards.
191
225
 
192
- The developer's notes are at $LOGFILE-developer .
193
- The static code reviewer reviewed the code and its (possibly partial) result is at $LOGFILE-reviewer .
226
+ Here is the task the developer has completed:
194
227
 
195
- Related docs:
228
+ <task_description>
229
+ ${nexttask}
230
+ </task_description>
231
+
232
+ To conduct your review, you have access to the following related documents:
196
233
  - BRIEF.md
197
234
  - docs/PLAN.md
198
235
  - docs/QUESTIONS.md
199
236
  - docs/CLAUDE-NOTES.md
200
237
  - README.md
201
238
 
202
- IMPORTANT: First check if the planner declared the plan complete with <ALL DONE>. If so, you must verify this by:
203
- 1. Ensuring ALL code compiles successfully
204
- 2. Running ALL tests and linters
205
- 3. Confirming there are truly no remaining tasks
239
+ The developer's notes are available in a file named ${LOGFILE}-developer.
206
240
 
207
- Only declare the project complete by outputting <VERIFIED_ALL_DONE> if you have verified compilation and testing success.
241
+ Instructions for your review process:
208
242
 
209
- Please review the task and uncommitted changes, and make sure the task is complete, and done to satisfaction.
210
- DO NOT trust the developer's notes, always review the code and build/test results yourself.
211
- Look for typical 'cheating' patterns, such as turning off unit tests, taking files
212
- out of the compilation configuration, and redefining the plan to skip tasks
213
- that aren't working.
214
- If there's a linter defined for this project, run it.
243
+ 1. Carefully read and understand the task description.
244
+ 2. Review the developer's notes, but do not trust them implicitly.
245
+ 3. Examine the code and build/test results independently.
246
+ 4. Look for common 'cheating' patterns, including but not limited to:
247
+ - Disabling or ignoring unit tests
248
+ - Excluding files from compilation
249
+ - Redefining the plan to skip challenging tasks
250
+ - Using silent exception handlers that return fallback values
251
+ - Implementing try/catch blocks that log warnings but continue with empty/default data
252
+ - Catching integration failures and returning mock responses
253
+ 5. Stay on the current git branch, as long as it's a proper feature branch.
254
+ 6. If the task is incomplete or unsatisfactory, update docs/PLAN.md with detailed suggestions for the developer to complete the task properly.
255
+ 7. If you have questions for future consideration, add them to docs/QUESTIONS.md.
256
+ 8. If you have ideas for future improvements, add them to docs/IDEAS.md.
215
257
 
216
- Also note: please avoid switching git branches - stay on the current branch, as
217
- long as it's a proper feature branch.
258
+ Before providing your final review, please break down your review process and show your thought process inside <code_review_process> tags in your thinking block:
218
259
 
219
- If the task is not complete, adjust the item in docs/PLAN.md with suggestions for
220
- the developer to complete the task properly.
260
+ 1. Summarize the task description in your own words.
261
+ 2. List out the key documents you need to review.
262
+ 3. For each document, note down relevant quotes or information that pertain to the task.
263
+ 4. Explicitly look for any 'cheating' patterns and list any that you find.
264
+ 5. Consider arguments for and against the task being complete and of satisfactory quality.
221
265
 
222
- If the task is complete and we're happy with the code, run a git commit+push.
266
+ This will ensure a thorough and careful examination of the developer's work. It's OK for this section to be quite long.
223
267
 
224
- If you have any questions of the user for the future, you can add them to QUESTIONS.md.
225
- If you have any ideas for the future, you can add them to IDEAS.md.
268
+ After your analysis, provide a summary of your findings and any necessary actions in the following format:
269
+
270
+ <review_summary>
271
+ Task Status: [Complete/Incomplete]
272
+ Quality Assessment: [Satisfactory/Unsatisfactory]
273
+
274
+ Key Findings:
275
+ 1. [Finding 1]
276
+ 2. [Finding 2]
277
+ ...
278
+
279
+ Actions Taken:
280
+ - [Action 1, e.g., 'Updated PLAN.md with suggestions for improvement']
281
+ - [Action 2, e.g., 'Added question to QUESTIONS.md']
282
+ ...
283
+
284
+ </review_summary>
285
+
286
+ Please proceed with your thorough code review and analysis. Your final output should consist only of the review summary and should not duplicate or rehash any of the work you did in the thinking block.
226
287
  " | tee >(cat > $LOGFILE-tester)
227
288
 
228
289
  # Check if verifier has confirmed all tasks are truly complete
@@ -233,6 +294,44 @@ If you have any ideas for the future, you can add them to IDEAS.md.
233
294
  fi
234
295
  set -e
235
296
 
297
+ # Calculate iteration duration and check for failure patterns
298
+ ITERATION_END_TIME=$(date +%s)
299
+ ITERATION_DURATION=$((ITERATION_END_TIME - ITERATION_START_TIME))
300
+
301
+ echo -e "\033[36mIteration $LOOP_COUNTER completed in ${ITERATION_DURATION}s\033[0m"
302
+
303
+ # Check if iteration was suspiciously fast (likely failure mode)
304
+ if [ $ITERATION_DURATION -lt $MIN_ITERATION_TIME ]; then
305
+ CONSECUTIVE_FAST_ITERATIONS=$((CONSECUTIVE_FAST_ITERATIONS + 1))
306
+ echo -e "\033[33mWarning: Fast iteration detected (${ITERATION_DURATION}s < ${MIN_ITERATION_TIME}s threshold)\033[0m"
307
+ echo -e "\033[33mConsecutive fast iterations: $CONSECUTIVE_FAST_ITERATIONS/3\033[0m"
308
+
309
+ # Exit if too many consecutive fast iterations (likely Claude API failure)
310
+ if [ $CONSECUTIVE_FAST_ITERATIONS -ge 3 ]; then
311
+ echo -e "\033[31m==================================================================\033[0m"
312
+ echo -e "\033[31m== FAILURE MODE DETECTED - THROTTLING ACTIVATED\033[0m"
313
+ echo -e "\033[31m==================================================================\033[0m"
314
+ echo -e "\033[31mDetected 3 consecutive iterations under ${MIN_ITERATION_TIME}s each.\033[0m"
315
+ echo -e "\033[31mThis usually indicates Claude API issues (token limits, etc).\033[0m"
316
+ echo -e "\033[31m\033[0m"
317
+ echo -e "\033[31mSuggested actions:\033[0m"
318
+ echo -e "\033[31m- Check your Claude API token limits\033[0m"
319
+ echo -e "\033[31m- Wait a few minutes and restart with: claude-fsd dev\033[0m"
320
+ echo -e "\033[31m- Review logs in: logs/\033[0m"
321
+ echo -e "\033[31m==================================================================\033[0m"
322
+ exit 1
323
+ fi
324
+
325
+ # Add exponential backoff delay for fast iterations
326
+ BACKOFF_DELAY=$((CONSECUTIVE_FAST_ITERATIONS * 60)) # 1min, 2min, 3min
327
+ echo -e "\033[33mApplying backoff delay: ${BACKOFF_DELAY}s\033[0m"
328
+ sleep $BACKOFF_DELAY
329
+ else
330
+ # Reset counter on successful iteration
331
+ CONSECUTIVE_FAST_ITERATIONS=0
332
+ echo -e "\033[32mNormal iteration timing - continuing...\033[0m"
333
+ fi
334
+
236
335
  sleep 1
237
336
  done
238
337
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-fsd",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "Claude Full Self Drive tools for autonomous AI-powered development",
5
5
  "bin": {
6
6
  "claude-fsd": "bin/claude-fsd",