claude-evolve 1.1.0 → 1.1.2

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.
@@ -172,7 +172,7 @@ Format: One idea per line, no numbering, no extra formatting."
172
172
 
173
173
  # Call Claude and process response
174
174
  local response
175
- if ! response=$(echo "$prompt" | claude --model opus -p 2>&1); then
175
+ if ! response=$(echo "$prompt" | claude --dangerously-skip-permissions --model opus -p 2>&1); then
176
176
  echo "[WARN] Claude API call failed, falling back to manual entry."
177
177
  return 1
178
178
  fi
@@ -53,6 +53,9 @@ echo "[INFO] Starting continuous evolution run..."
53
53
  echo "[INFO] Will continue running until no more pending candidates or 5 consecutive failures"
54
54
  [[ -n $timeout_seconds ]] && echo "[INFO] Using timeout: ${timeout_seconds} seconds per evaluation"
55
55
 
56
+ # Prepare logging directory
57
+ mkdir -p logs
58
+
56
59
  # Track consecutive failures
57
60
  consecutive_failures=0
58
61
  MAX_FAILURES=5
@@ -145,6 +148,9 @@ while true; do
145
148
  echo "[INFO] No more pending candidates found. Evolution run complete!"
146
149
  exit 0
147
150
  fi
151
+
152
+ # Create log file for this iteration
153
+ LOGFILE="logs/claude-$(date +%Y%m%d_%H%M%S).txt"
148
154
 
149
155
  # Get row data
150
156
  row_data=$(get_csv_row "$row_num")
@@ -204,31 +210,12 @@ if ! command -v "$claude_cmd" >/dev/null 2>&1; then
204
210
  exit 1
205
211
  fi
206
212
 
207
- # Implement claude-fsd style model selection
208
- # Read/create loop counter for megathinking mode
209
- if [[ -f "$FULL_EVOLUTION_DIR/.loop_counter" ]]; then
210
- LOOP_COUNTER=$(cat "$FULL_EVOLUTION_DIR/.loop_counter")
211
- else
212
- LOOP_COUNTER=1
213
- fi
214
-
215
- # Check if this is the 4th iteration for megathinking mode
216
- if [ $((LOOP_COUNTER % 4)) -eq 0 ]; then
217
- echo -e "\033[33m**** MEGATHINKING MODE ACTIVATED ****\033[0m"
218
- CLAUDE_MODEL="opus"
219
- MEGATHINK_PREFIX="megathink: "
220
- echo "[INFO] Using Claude Opus for architectural thinking"
221
- else
222
- CLAUDE_MODEL="sonnet"
223
- MEGATHINK_PREFIX=""
224
- echo "[INFO] Using Claude Sonnet for development"
225
- fi
226
-
227
- # Increment and save counter
228
- echo $((LOOP_COUNTER + 1)) > "$FULL_EVOLUTION_DIR/.loop_counter"
213
+ # Always use Claude Sonnet
214
+ CLAUDE_MODEL="sonnet"
215
+ echo "[INFO] Using Claude Sonnet for development"
229
216
 
230
217
  # Create mutation prompt - Claude will edit the file directly
231
- prompt="${MEGATHINK_PREFIX}Please edit file $output_file to implement the following change for iteration $id: $description
218
+ prompt="Please edit file $output_file to implement the following change for iteration $id: $description
232
219
 
233
220
  There may be extra information in documentation in the $FULL_EVOLUTION_DIR/*.md files.
234
221
 
@@ -240,11 +227,26 @@ if [[ $id == "000" || $id == "0" ]]; then
240
227
  else
241
228
  echo "[INFO] Calling Claude $CLAUDE_MODEL to apply mutation..."
242
229
  echo "[INFO] Claude will edit: $output_file"
230
+ echo "[INFO] Logging to: ${LOGFILE}-developer"
231
+
232
+ # Claude will edit the file directly - log both prompt and response
233
+ {
234
+ echo "=== EVOLUTION MUTATION PROMPT ==="
235
+ echo "ID: $id"
236
+ echo "Based on: $based_on_id"
237
+ echo "Description: $description"
238
+ echo "Output file: $output_file"
239
+ echo "Model: $CLAUDE_MODEL"
240
+ echo "Timestamp: $(date)"
241
+ echo
242
+ echo "$prompt"
243
+ echo
244
+ echo "=== CLAUDE RESPONSE ==="
245
+ } >> "${LOGFILE}-developer"
243
246
 
244
- # Claude will edit the file directly - we just need to run the command
245
- if ! output=$(echo "$prompt" | "$claude_cmd" --model $CLAUDE_MODEL -p 2>&1); then
247
+ # Use tee to show output and log simultaneously
248
+ if ! echo "$prompt" | "$claude_cmd" --dangerously-skip-permissions --model $CLAUDE_MODEL -p 2>&1 | tee -a "${LOGFILE}-developer"; then
246
249
  echo "[ERROR] Claude failed to mutate algorithm" >&2
247
- echo "[ERROR] Claude output: $output" >&2
248
250
  update_csv_row "$row_num" "" "failed"
249
251
  if should_continue_after_failure; then
250
252
  continue
@@ -254,10 +256,6 @@ else
254
256
  fi
255
257
 
256
258
  echo "[INFO] Claude completed mutation"
257
- # Show Claude's response (it might contain useful information about what was changed)
258
- if [[ -n $output ]]; then
259
- echo "[INFO] Claude response: $output"
260
- fi
261
259
  fi
262
260
 
263
261
  echo "[INFO] Algorithm ready at: $output_file"
@@ -292,12 +290,26 @@ else
292
290
  fi
293
291
  fi
294
292
 
295
- # Show evaluator output
293
+ # Show evaluator output and log it
296
294
  echo "[INFO] Evaluator output:"
297
295
  echo "----------------------------------------"
298
296
  echo "$eval_output"
299
297
  echo "----------------------------------------"
300
298
 
299
+ # Log evaluator phase
300
+ {
301
+ echo "=== EVALUATOR EXECUTION ==="
302
+ echo "ID: $id"
303
+ echo "Algorithm: $output_file"
304
+ echo "Command: $PYTHON_CMD $FULL_EVALUATOR_PATH $output_file"
305
+ echo "Exit code: $eval_exit_code"
306
+ echo "Timestamp: $(date)"
307
+ echo
308
+ echo "=== EVALUATOR OUTPUT ==="
309
+ echo "$eval_output"
310
+ echo
311
+ } >> "${LOGFILE}-evaluator"
312
+
301
313
  # Process results
302
314
  if [[ $eval_exit_code -eq 0 ]]; then
303
315
  # Extract score from JSON (simple grep approach)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-evolve",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "bin": {
5
5
  "claude-evolve": "./bin/claude-evolve",
6
6
  "claude-evolve-main": "./bin/claude-evolve-main",