claude-evolve 1.0.4 → 1.0.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.
- package/bin/claude-evolve-ideate +1 -1
- package/bin/claude-evolve-run +25 -2
- package/package.json +1 -1
package/bin/claude-evolve-ideate
CHANGED
|
@@ -166,7 +166,7 @@ Format: One idea per line, no numbering, no extra formatting."
|
|
|
166
166
|
|
|
167
167
|
# Call Claude and process response
|
|
168
168
|
local response
|
|
169
|
-
if ! response=$(echo "$prompt" | claude
|
|
169
|
+
if ! response=$(echo "$prompt" | claude --model opus -p 2>&1); then
|
|
170
170
|
echo "[WARN] Claude API call failed, falling back to manual entry."
|
|
171
171
|
return 1
|
|
172
172
|
fi
|
package/bin/claude-evolve-run
CHANGED
|
@@ -154,8 +154,31 @@ if ! command -v "$claude_cmd" >/dev/null 2>&1; then
|
|
|
154
154
|
exit 1
|
|
155
155
|
fi
|
|
156
156
|
|
|
157
|
+
# Implement claude-fsd style model selection
|
|
158
|
+
# Read/create loop counter for megathinking mode
|
|
159
|
+
if [[ -f evolution/.loop_counter ]]; then
|
|
160
|
+
LOOP_COUNTER=$(cat evolution/.loop_counter)
|
|
161
|
+
else
|
|
162
|
+
LOOP_COUNTER=1
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
# Check if this is the 4th iteration for megathinking mode
|
|
166
|
+
if [ $((LOOP_COUNTER % 4)) -eq 0 ]; then
|
|
167
|
+
echo -e "\033[33m**** MEGATHINKING MODE ACTIVATED ****\033[0m"
|
|
168
|
+
CLAUDE_MODEL="opus"
|
|
169
|
+
MEGATHINK_PREFIX="megathink: "
|
|
170
|
+
echo "[INFO] Using Claude Opus for architectural thinking (iteration $LOOP_COUNTER)"
|
|
171
|
+
else
|
|
172
|
+
CLAUDE_MODEL="sonnet"
|
|
173
|
+
MEGATHINK_PREFIX=""
|
|
174
|
+
echo "[INFO] Using Claude Sonnet for development (iteration $LOOP_COUNTER)"
|
|
175
|
+
fi
|
|
176
|
+
|
|
177
|
+
# Increment and save counter
|
|
178
|
+
echo $((LOOP_COUNTER + 1)) > evolution/.loop_counter
|
|
179
|
+
|
|
157
180
|
# Create mutation prompt
|
|
158
|
-
prompt="You are an AI assistant helping to evolve algorithms through mutations. Please modify the Python algorithm file at $output_file based on the requested modification.
|
|
181
|
+
prompt="${MEGATHINK_PREFIX}You are an AI assistant helping to evolve algorithms through mutations. Please modify the Python algorithm file at $output_file based on the requested modification.
|
|
159
182
|
|
|
160
183
|
CONTEXT:
|
|
161
184
|
$(cat evolution/BRIEF.md 2>/dev/null || echo "No brief available")
|
|
@@ -176,7 +199,7 @@ INSTRUCTIONS:
|
|
|
176
199
|
The output should be a complete, executable Python file that builds upon the existing algorithm."
|
|
177
200
|
|
|
178
201
|
# Generate mutation
|
|
179
|
-
if ! generated_code=$(echo "$prompt" | "$claude_cmd" --model
|
|
202
|
+
if ! generated_code=$(echo "$prompt" | "$claude_cmd" --model $CLAUDE_MODEL); then
|
|
180
203
|
echo "[ERROR] Claude failed to generate algorithm mutation" >&2
|
|
181
204
|
update_csv_row "$row_num" "" "failed"
|
|
182
205
|
exit 1
|