claude-evolve 1.3.15 → 1.3.16

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/README.md CHANGED
@@ -12,7 +12,7 @@ Think of it like **genetic algorithms for code** - it handles the mutations and
12
12
 
13
13
  The system operates with specialized phases working together:
14
14
 
15
- - 🧠 **Ideation Phase**: Generates creative algorithm variations using Claude Opus
15
+ - 🧠 **Ideation Phase**: Generates creative algorithm variations using codex o3-pro (if available) or Claude Opus
16
16
  - 🔬 **Development Phase**: Implements mutations using Claude Sonnet (with periodic Opus "megathinking")
17
17
  - 📊 **Evaluation Phase**: Tests performance against your custom evaluator
18
18
  - 📈 **Analysis Phase**: Tracks evolution progress and identifies top performers
@@ -180,6 +180,7 @@ Evolution experiments can fail for various reasons. The system tracks these fail
180
180
  - [Claude CLI](https://docs.anthropic.com/en/docs/claude-code) (`claude` command)
181
181
 
182
182
  ### Optional (but recommended)
183
+ - [Codex CLI](https://github.com/aboutgaurav/codex) (`codex` command) - Uses o3-pro model for superior ideation when available
183
184
  - Scientific Python libraries (numpy, scipy, etc.) depending on your algorithms
184
185
  - Plotting libraries (matplotlib, plotly) for analyzing results
185
186
 
@@ -292,16 +292,18 @@ if command -v gnuplot >/dev/null 2>&1 && [[ $valid_performance_count -gt 0 ]]; t
292
292
  echo "# Row ID Performance Generation" >"$data_file"
293
293
  echo "# Generation AvgPerformance Color" >"$gen_avg_file"
294
294
 
295
- # Get color by generation number (rotates through 5 colors)
295
+ # Get color by generation number (rotates through 7 colors)
296
296
  get_gen_color() {
297
297
  local gen_num="$1"
298
- local color_index=$(( gen_num % 5 + 1 ))
298
+ local color_index=$(( gen_num % 7 ))
299
299
  case $color_index in
300
- 1) echo "#1f77b4" ;; # blue
301
- 2) echo "#ff7f0e" ;; # orange
302
- 3) echo "#2ca02c" ;; # green
303
- 4) echo "#d62728" ;; # red
304
- 0) echo "#9467bd" ;; # purple
300
+ 0) echo "#1f77b4" ;; # blue
301
+ 1) echo "#ff7f0e" ;; # orange
302
+ 2) echo "#2ca02c" ;; # green
303
+ 3) echo "#d62728" ;; # red
304
+ 4) echo "#9467bd" ;; # purple
305
+ 5) echo "#8c564b" ;; # brown
306
+ 6) echo "#e377c2" ;; # pink
305
307
  esac
306
308
  }
307
309
 
@@ -426,7 +428,7 @@ print(f'max_id=\"{max_id}\"')
426
428
  max_gen_num=$gen_num
427
429
  fi
428
430
  color=$(get_gen_color "$gen_num")
429
- echo "$gen_index \"$gen\" $avg \"$color\"" >>"$gen_avg_file"
431
+ echo "$gen_index \"Gen$gen_num\" $avg \"$color\"" >>"$gen_avg_file"
430
432
  ((gen_index++))
431
433
  fi
432
434
  fi
@@ -482,13 +484,18 @@ print(f'max_id=\"{max_id}\"')
482
484
  fi
483
485
  fi
484
486
 
485
- # Build x-axis labels for generation chart
487
+ # Build x-axis labels for generation chart (include all generations from data)
486
488
  xtics_labels=""
487
- for ((i=1; i<=max_gen_num; i++)); do
488
- if [[ -n $xtics_labels ]]; then
489
- xtics_labels="$xtics_labels, "
489
+ label_index=1
490
+ for gen in $(cut -d' ' -f1 "$gen_data_temp" | sort -u); do
491
+ if [[ -n $gen ]]; then
492
+ gen_display=$(echo "$gen" | sed 's/gen0*//')
493
+ if [[ -n $xtics_labels ]]; then
494
+ xtics_labels="$xtics_labels, "
495
+ fi
496
+ xtics_labels="${xtics_labels}\"Gen$gen_display\" $label_index"
497
+ ((label_index++))
490
498
  fi
491
- xtics_labels="${xtics_labels}\"Gen$i\" $i"
492
499
  done
493
500
 
494
501
  gnuplot <<EOF
@@ -14,14 +14,34 @@ else
14
14
  load_config
15
15
  fi
16
16
 
17
- # Helper function to call Claude with usage limit detection
18
- call_claude_with_limit_check() {
17
+ # Helper function to call AI model (codex o3-pro if available, else Claude)
18
+ call_ai_with_limit_check() {
19
19
  local prompt="$1"
20
- local model="${2:-opus}"
20
+ local fallback_model="${2:-opus}"
21
+
22
+ # Check if codex is available
23
+ if command -v codex >/dev/null 2>&1; then
24
+ echo "[INFO] Using codex o3-pro for ideation (smartest available model)" >&2
25
+
26
+ # Call codex with o3-pro model
27
+ local ai_output
28
+ ai_output=$(echo "$prompt" | codex -m o3-pro 2>&1)
29
+ local ai_exit_code=$?
30
+
31
+ if [[ $ai_exit_code -eq 0 ]]; then
32
+ echo "$ai_output"
33
+ return 0
34
+ else
35
+ echo "[WARN] Codex failed, falling back to Claude" >&2
36
+ fi
37
+ fi
38
+
39
+ # Fall back to Claude
40
+ echo "[INFO] Using Claude $fallback_model for ideation" >&2
21
41
 
22
42
  # Call Claude and capture output
23
43
  local claude_output
24
- claude_output=$(echo "$prompt" | claude --dangerously-skip-permissions --model "$model" -p 2>&1)
44
+ claude_output=$(echo "$prompt" | claude --dangerously-skip-permissions --model "$fallback_model" -p 2>&1)
25
45
  local claude_exit_code=$?
26
46
 
27
47
  # Check for usage limit
@@ -51,6 +71,11 @@ call_claude_with_limit_check() {
51
71
  return $claude_exit_code
52
72
  }
53
73
 
74
+ # Backward compatibility alias
75
+ call_claude_with_limit_check() {
76
+ call_ai_with_limit_check "$@"
77
+ }
78
+
54
79
  # Parse arguments
55
80
  use_strategies=true
56
81
  no_ai=false
@@ -253,9 +278,9 @@ ideate_manual() {
253
278
 
254
279
  # Generate ideas using AI with multi-strategy approach
255
280
  ideate_ai_strategies() {
256
- # Check for claude CLI
257
- if ! command -v claude >/dev/null 2>&1; then
258
- echo "[WARN] Claude CLI not found. Falling back to manual entry."
281
+ # Check for AI CLI (codex or claude)
282
+ if ! command -v codex >/dev/null 2>&1 && ! command -v claude >/dev/null 2>&1; then
283
+ echo "[WARN] No AI CLI found (codex or claude). Falling back to manual entry."
259
284
  return 1
260
285
  fi
261
286
 
@@ -329,9 +354,9 @@ Example descriptions:
329
354
 
330
355
  Add exactly $count rows to the CSV file now."
331
356
 
332
- echo "[INFO] Calling Claude Opus to generate $count novel exploration ideas..."
333
- if ! call_claude_with_limit_check "$prompt" "opus"; then
334
- echo "[WARN] Claude failed to generate novel ideas" >&2
357
+ echo "[INFO] Generating $count novel exploration ideas..."
358
+ if ! call_ai_with_limit_check "$prompt" "opus"; then
359
+ echo "[WARN] AI failed to generate novel ideas" >&2
335
360
  return 1
336
361
  fi
337
362
  echo "[INFO] Novel exploration ideas generated"
@@ -382,9 +407,9 @@ Example descriptions:
382
407
 
383
408
  Add exactly $count parameter tuning rows to the CSV file now."
384
409
 
385
- echo "[INFO] Calling Claude Opus to generate $count hill climbing ideas..."
386
- if ! call_claude_with_limit_check "$prompt" "opus"; then
387
- echo "[WARN] Claude failed to generate hill climbing ideas" >&2
410
+ echo "[INFO] Generating $count hill climbing ideas..."
411
+ if ! call_ai_with_limit_check "$prompt" "opus"; then
412
+ echo "[WARN] AI failed to generate hill climbing ideas" >&2
388
413
  return 1
389
414
  fi
390
415
  echo "[INFO] Hill climbing ideas generated"
@@ -435,9 +460,9 @@ Example descriptions:
435
460
 
436
461
  Add exactly $count structural modification rows to the CSV file now."
437
462
 
438
- echo "[INFO] Calling Claude Opus to generate $count structural mutation ideas..."
439
- if ! call_claude_with_limit_check "$prompt" "opus"; then
440
- echo "[WARN] Claude failed to generate structural mutation ideas" >&2
463
+ echo "[INFO] Generating $count structural mutation ideas..."
464
+ if ! call_ai_with_limit_check "$prompt" "opus"; then
465
+ echo "[WARN] AI failed to generate structural mutation ideas" >&2
441
466
  return 1
442
467
  fi
443
468
  echo "[INFO] Structural mutation ideas generated"
@@ -488,9 +513,9 @@ Example descriptions:
488
513
 
489
514
  Add exactly $count hybrid combination rows to the CSV file now."
490
515
 
491
- echo "[INFO] Calling Claude Opus to generate $count crossover hybrid ideas..."
492
- if ! call_claude_with_limit_check "$prompt" "opus"; then
493
- echo "[WARN] Claude failed to generate crossover ideas" >&2
516
+ echo "[INFO] Generating $count crossover hybrid ideas..."
517
+ if ! call_ai_with_limit_check "$prompt" "opus"; then
518
+ echo "[WARN] AI failed to generate crossover ideas" >&2
494
519
  return 1
495
520
  fi
496
521
  echo "[INFO] Crossover hybrid ideas generated"
@@ -498,9 +523,9 @@ Add exactly $count hybrid combination rows to the CSV file now."
498
523
 
499
524
  # Legacy AI generation mode (for backward compatibility)
500
525
  ideate_ai_legacy() {
501
- # Check for claude CLI
502
- if ! command -v claude >/dev/null 2>&1; then
503
- echo "[WARN] Claude CLI not found. Falling back to manual entry."
526
+ # Check for AI CLI (codex or claude)
527
+ if ! command -v codex >/dev/null 2>&1 && ! command -v claude >/dev/null 2>&1; then
528
+ echo "[WARN] No AI CLI found (codex or claude). Falling back to manual entry."
504
529
  return 1
505
530
  fi
506
531
 
@@ -553,9 +578,9 @@ Requirements for new CSV rows:
553
578
 
554
579
  Add exactly $TOTAL_IDEAS algorithm variation rows to the CSV file now."
555
580
 
556
- echo "[INFO] Calling Claude Opus to generate $TOTAL_IDEAS ideas (legacy mode)..."
557
- if ! call_claude_with_limit_check "$prompt" "opus"; then
558
- echo "[WARN] Claude failed to generate ideas" >&2
581
+ echo "[INFO] Generating $TOTAL_IDEAS ideas (legacy mode)..."
582
+ if ! call_ai_with_limit_check "$prompt" "opus"; then
583
+ echo "[WARN] AI failed to generate ideas" >&2
559
584
  return 1
560
585
  fi
561
586
  echo "[INFO] Legacy ideas generated"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-evolve",
3
- "version": "1.3.15",
3
+ "version": "1.3.16",
4
4
  "bin": {
5
5
  "claude-evolve": "./bin/claude-evolve",
6
6
  "claude-evolve-main": "./bin/claude-evolve-main",