claude-evolve 1.5.2 → 1.5.3
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 +16 -1
- package/bin/claude-evolve-analyze +6 -3
- package/bin/claude-evolve-autostatus +2 -2
- package/bin/claude-evolve-ideate +64 -36
- package/bin/claude-evolve-status +3 -1
- package/lib/config.sh +2 -2
- package/package.json +1 -1
- package/templates/config.yaml +2 -2
package/README.md
CHANGED
|
@@ -30,14 +30,29 @@ Evolution runs indefinitely until you stop it. Perfect for overnight optimizatio
|
|
|
30
30
|
|
|
31
31
|
## Commands
|
|
32
32
|
|
|
33
|
+
### Core Commands
|
|
33
34
|
```bash
|
|
34
35
|
claude-evolve # Interactive menu
|
|
35
36
|
claude-evolve setup # Initialize workspace
|
|
36
37
|
claude-evolve ideate # Generate new algorithm ideas
|
|
37
38
|
claude-evolve run # Start evolution loop (runs forever)
|
|
38
|
-
claude-evolve analyze # View results and progress
|
|
39
|
+
claude-evolve analyze # View results and progress with charts
|
|
39
40
|
claude-evolve status # Quick progress overview
|
|
41
|
+
claude-evolve autostatus # Live auto-updating status display
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Management Commands
|
|
45
|
+
```bash
|
|
40
46
|
claude-evolve edit # Manage candidate statuses
|
|
47
|
+
claude-evolve config # View/edit configuration
|
|
48
|
+
claude-evolve cleanup # Clean up old lock files
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Maintenance Commands
|
|
52
|
+
```bash
|
|
53
|
+
claude-evolve clean-invalid # Remove invalid candidates
|
|
54
|
+
claude-evolve cleanup-duplicates # Remove duplicate entries
|
|
55
|
+
claude-evolve csv-fix # Fix CSV formatting issues
|
|
41
56
|
```
|
|
42
57
|
|
|
43
58
|
## Working with Multiple Projects
|
|
@@ -246,7 +246,8 @@ with open('$csv_file', 'r') as f:
|
|
|
246
246
|
"
|
|
247
247
|
|
|
248
248
|
# Process generation stats
|
|
249
|
-
|
|
249
|
+
# Sort generations numerically
|
|
250
|
+
for gen in $(cut -d' ' -f1 "$gen_stats_file" | sort -u | awk '{print substr($0,4), $0}' | sort -n | cut -d' ' -f2 || echo ""); do
|
|
250
251
|
[[ -z "$gen" ]] && continue
|
|
251
252
|
total_in_gen=$(grep -c "^$gen " "$gen_stats_file" 2>/dev/null || echo "0")
|
|
252
253
|
completed_in_gen=$(grep -c "^$gen completed" "$gen_stats_file" 2>/dev/null || echo "0")
|
|
@@ -461,7 +462,8 @@ print(f'max_desc=\"{desc_escaped}\"')
|
|
|
461
462
|
# Create generation averages file and track max generation
|
|
462
463
|
gen_index=1
|
|
463
464
|
max_gen_num=0
|
|
464
|
-
|
|
465
|
+
# Sort generations numerically for graph
|
|
466
|
+
for gen in $(cut -d' ' -f1 "$gen_data_temp" | sort -u | awk '{print substr($0,4), $0}' | sort -n | cut -d' ' -f2); do
|
|
465
467
|
if grep -q "^$gen " "$gen_data_temp"; then
|
|
466
468
|
# Calculate median for this generation
|
|
467
469
|
# AIDEV-NOTE: Changed from mean to median to be more robust to outliers
|
|
@@ -568,7 +570,8 @@ print(f'max_desc=\"{desc_escaped}\"')
|
|
|
568
570
|
# Build x-axis labels for generation chart (include all generations from data)
|
|
569
571
|
xtics_labels=""
|
|
570
572
|
label_index=1
|
|
571
|
-
|
|
573
|
+
# Sort generations numerically for graph
|
|
574
|
+
for gen in $(cut -d' ' -f1 "$gen_data_temp" | sort -u | awk '{print substr($0,4), $0}' | sort -n | cut -d' ' -f2); do
|
|
572
575
|
if [[ -n $gen ]]; then
|
|
573
576
|
gen_display=$(echo "$gen" | sed 's/gen0*//')
|
|
574
577
|
if [[ -n $xtics_labels ]]; then
|
|
@@ -246,8 +246,8 @@ class AutoStatus:
|
|
|
246
246
|
print("-" * min(self.display.cols, len(header_fmt)))
|
|
247
247
|
row += 1
|
|
248
248
|
|
|
249
|
-
# Sort generations
|
|
250
|
-
sorted_gens = sorted(generations.keys())
|
|
249
|
+
# Sort generations numerically by extracting the number after 'gen'
|
|
250
|
+
sorted_gens = sorted(generations.keys(), key=lambda g: int(g[3:]) if g.startswith("gen") and g[3:].isdigit() else 0)
|
|
251
251
|
|
|
252
252
|
# Calculate how many generations we can show
|
|
253
253
|
available_rows = self.display.rows - row - 1 # Leave room at bottom
|
package/bin/claude-evolve-ideate
CHANGED
|
@@ -90,34 +90,26 @@ call_ai_for_ideation() {
|
|
|
90
90
|
local ai_exit_code=$?
|
|
91
91
|
|
|
92
92
|
# Handle special exit codes
|
|
93
|
-
#
|
|
93
|
+
# Always check if the file was modified, regardless of exit code
|
|
94
|
+
# This is the only test that matters - did the CSV change?
|
|
94
95
|
|
|
95
|
-
if [[
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
echo "[INFO] AI completed successfully and modified CSV ($new_csv_count vs $original_csv_count rows)" >&2
|
|
103
|
-
return 0
|
|
104
|
-
else
|
|
105
|
-
echo "[INFO] $model returned exit code 0 but didn't modify CSV file" >&2
|
|
106
|
-
echo "[DEBUG] Expected file: $temp_csv_file" >&2
|
|
107
|
-
echo "[DEBUG] Original count: $original_csv_count, New count: $new_csv_count" >&2
|
|
108
|
-
return 1
|
|
109
|
-
fi
|
|
96
|
+
if [[ -f "$temp_csv_file" ]]; then
|
|
97
|
+
local new_csv_count
|
|
98
|
+
new_csv_count=$(grep -v '^[[:space:]]*$' "$temp_csv_file" | tail -n +2 | wc -l)
|
|
99
|
+
|
|
100
|
+
if [[ $new_csv_count -gt $original_csv_count ]]; then
|
|
101
|
+
echo "[INFO] CSV was modified ($new_csv_count vs $original_csv_count rows) - success!" >&2
|
|
102
|
+
return 0
|
|
110
103
|
else
|
|
111
|
-
echo "[INFO]
|
|
112
|
-
echo "[DEBUG]
|
|
113
|
-
echo "[DEBUG] Files matching temp-csv-*.csv:" >&2
|
|
114
|
-
ls -la temp-csv-*.csv 2>&1 >&2
|
|
104
|
+
echo "[INFO] CSV unchanged after AI call (exit code: $ai_exit_code)" >&2
|
|
105
|
+
echo "[DEBUG] Original count: $original_csv_count, New count: $new_csv_count" >&2
|
|
115
106
|
return 1
|
|
116
107
|
fi
|
|
108
|
+
else
|
|
109
|
+
echo "[INFO] Temp CSV file not found after AI call: $temp_csv_file" >&2
|
|
110
|
+
echo "[DEBUG] Exit code was: $ai_exit_code" >&2
|
|
111
|
+
return 1
|
|
117
112
|
fi
|
|
118
|
-
|
|
119
|
-
echo "[INFO] No AI model successfully modified the CSV file" >&2
|
|
120
|
-
return 1
|
|
121
113
|
}
|
|
122
114
|
|
|
123
115
|
# Parse arguments
|
|
@@ -461,8 +453,14 @@ Instructions:
|
|
|
461
453
|
1. Add exactly $count new rows to the CSV
|
|
462
454
|
2. Use the next available generation numbers (gen$CURRENT_GENERATION-XXX format)
|
|
463
455
|
3. For each idea, create a row with: id,parent_id,description,,pending
|
|
464
|
-
4.
|
|
465
|
-
|
|
456
|
+
4. CRITICAL CSV FORMATTING RULES:
|
|
457
|
+
- ALWAYS wrap the description field in double quotes
|
|
458
|
+
- If the description contains quotes, escape them by doubling them (" becomes "")
|
|
459
|
+
- Example: gen01-001,gen00-000,"Implement adaptive RSI thresholds",,pending
|
|
460
|
+
- BAD: gen01-001,gen00-000,Implement adaptive RSI thresholds,,pending
|
|
461
|
+
- NEVER omit quotes - unquoted descriptions cause CSV corruption
|
|
462
|
+
5. For novel ideas: leave parent_id empty
|
|
463
|
+
6. For other idea types: use appropriate parent IDs from these top performers:
|
|
466
464
|
$top_performers
|
|
467
465
|
|
|
468
466
|
IMPORTANT: Output the complete modified CSV file. Do not add any explanation or other text - just output the CSV."
|
|
@@ -839,9 +837,15 @@ CRITICAL INSTRUCTIONS:
|
|
|
839
837
|
prompt+="
|
|
840
838
|
6. Use the Edit or MultiEdit tool to APPEND exactly $count new rows AT THE END of the CSV file
|
|
841
839
|
7. For each idea, create a row with: id,,description,,pending (empty parent_id for novel ideas)
|
|
842
|
-
8.
|
|
843
|
-
|
|
844
|
-
|
|
840
|
+
8. CRITICAL CSV FORMATTING RULES:
|
|
841
|
+
- ALWAYS wrap the description field in double quotes
|
|
842
|
+
- If the description contains quotes, escape them by doubling them (" becomes "")
|
|
843
|
+
- Example: gen01-001,,"Implement adaptive RSI thresholds based on volatility",,pending
|
|
844
|
+
- BAD: gen01-001,,Implement adaptive RSI thresholds based on volatility,,pending
|
|
845
|
+
- NEVER omit quotes around descriptions - this causes CSV parsing errors
|
|
846
|
+
9. Each description should be one clear sentence describing a novel algorithmic approach
|
|
847
|
+
10. Focus on creative, ambitious ideas that haven't been tried yet
|
|
848
|
+
11. Consider machine learning, new indicators, regime detection, risk management, etc.
|
|
845
849
|
|
|
846
850
|
IMPORTANT: You must APPEND new rows to the existing CSV file. DO NOT replace the file contents. All existing rows must remain unchanged.
|
|
847
851
|
CRITICAL: You must use your file editing tools (Edit/MultiEdit) to modify the CSV file. DO NOT return CSV text - use your tools to edit the file directly.
|
|
@@ -939,8 +943,14 @@ CRITICAL INSTRUCTIONS:
|
|
|
939
943
|
5. Use the Edit or MultiEdit tool to APPEND exactly $count new rows AT THE END of the CSV file
|
|
940
944
|
6. For each idea, create a row with: id,parent_id,description,,pending
|
|
941
945
|
7. Each parent_id MUST be one of: $valid_parent_ids
|
|
942
|
-
8.
|
|
943
|
-
|
|
946
|
+
8. CRITICAL CSV FORMATTING RULES:
|
|
947
|
+
- ALWAYS wrap the description field in double quotes
|
|
948
|
+
- If the description contains quotes, escape them by doubling them (" becomes "")
|
|
949
|
+
- Example: gen01-001,gen00-000,"Lower rsi_entry from 21 to 18",,pending
|
|
950
|
+
- BAD: gen01-001,gen00-000,Lower rsi_entry from 21 to 18,,pending
|
|
951
|
+
- NEVER omit quotes around descriptions - this causes CSV parsing errors
|
|
952
|
+
9. Each description should focus on adjusting specific parameters that exist in the parent's source code
|
|
953
|
+
10. Include current and new parameter values (e.g., "Lower rsi_entry from 21 to 18")
|
|
944
954
|
|
|
945
955
|
IMPORTANT: You must APPEND new rows to the existing CSV file. DO NOT replace the file contents. All existing rows must remain unchanged.
|
|
946
956
|
CRITICAL: You must use your file editing tools (Edit/MultiEdit) to modify the CSV file. DO NOT return CSV text - use your tools to edit the file directly.
|
|
@@ -1020,8 +1030,14 @@ CRITICAL INSTRUCTIONS:
|
|
|
1020
1030
|
5. Use the Edit or MultiEdit tool to APPEND exactly $count new rows AT THE END of the CSV file
|
|
1021
1031
|
6. For each idea, create a row with: id,parent_id,description,,pending
|
|
1022
1032
|
7. Each parent_id MUST be one of: $valid_parent_ids
|
|
1023
|
-
8.
|
|
1024
|
-
|
|
1033
|
+
8. CRITICAL CSV FORMATTING RULES:
|
|
1034
|
+
- ALWAYS wrap the description field in double quotes
|
|
1035
|
+
- If the description contains quotes, escape them by doubling them (" becomes "")
|
|
1036
|
+
- Example: gen01-001,gen00-000,"Add ML-based regime detection using LSTM",,pending
|
|
1037
|
+
- BAD: gen01-001,gen00-000,Add ML-based regime detection using LSTM,,pending
|
|
1038
|
+
- NEVER omit quotes around descriptions - this causes CSV parsing errors
|
|
1039
|
+
9. Each description should focus on architectural/structural changes based on the parent's actual code
|
|
1040
|
+
10. Reference actual components/methods found in the source code
|
|
1025
1041
|
|
|
1026
1042
|
IMPORTANT: You must APPEND new rows to the existing CSV file. DO NOT replace the file contents. All existing rows must remain unchanged.
|
|
1027
1043
|
CRITICAL: You must use your file editing tools (Edit/MultiEdit) to modify the CSV file. DO NOT return CSV text - use your tools to edit the file directly.
|
|
@@ -1101,8 +1117,14 @@ CRITICAL INSTRUCTIONS:
|
|
|
1101
1117
|
5. Use the Edit or MultiEdit tool to APPEND exactly $count new rows AT THE END of the CSV file
|
|
1102
1118
|
6. For each idea, create a row with: id,parent_id,description,,pending
|
|
1103
1119
|
7. Each parent_id MUST be one of: $valid_parent_ids (choose the primary parent)
|
|
1104
|
-
8.
|
|
1105
|
-
|
|
1120
|
+
8. CRITICAL CSV FORMATTING RULES:
|
|
1121
|
+
- ALWAYS wrap the description field in double quotes
|
|
1122
|
+
- If the description contains quotes, escape them by doubling them (" becomes "")
|
|
1123
|
+
- Example: gen01-001,gen00-000,"Combine gen01-123's RSI logic with gen01-456's volatility scaling",,pending
|
|
1124
|
+
- BAD: gen01-001,gen00-000,Combine gen01-123's RSI logic with gen01-456's volatility scaling,,pending
|
|
1125
|
+
- NEVER omit quotes around descriptions - this causes CSV parsing errors
|
|
1126
|
+
9. Each description should combine actual elements from 2+ algorithms based on their source code
|
|
1127
|
+
10. Reference specific components/features found in the actual source code
|
|
1106
1128
|
|
|
1107
1129
|
IMPORTANT: You must APPEND new rows to the existing CSV file. DO NOT replace the file contents. All existing rows must remain unchanged.
|
|
1108
1130
|
CRITICAL: You must use your file editing tools (Edit/MultiEdit) to modify the CSV file. DO NOT return CSV text - use your tools to edit the file directly.
|
|
@@ -1195,8 +1217,14 @@ CRITICAL INSTRUCTIONS:
|
|
|
1195
1217
|
4. If no gen$CURRENT_GENERATION entries exist yet, start with gen$CURRENT_GENERATION-001
|
|
1196
1218
|
5. Use the Edit or MultiEdit tool to APPEND exactly $TOTAL_IDEAS new rows AT THE END of the CSV file
|
|
1197
1219
|
6. For each idea, create a row with: id,parent_id,description,,pending
|
|
1198
|
-
7.
|
|
1199
|
-
|
|
1220
|
+
7. CRITICAL CSV FORMATTING RULES:
|
|
1221
|
+
- ALWAYS wrap the description field in double quotes
|
|
1222
|
+
- If the description contains quotes, escape them by doubling them (" becomes "")
|
|
1223
|
+
- Example: gen01-001,gen00-000,"Implement adaptive RSI thresholds based on volatility",,pending
|
|
1224
|
+
- BAD: gen01-001,gen00-000,Implement adaptive RSI thresholds based on volatility,,pending
|
|
1225
|
+
- NEVER omit quotes around descriptions - this causes CSV parsing errors that corrupt the data
|
|
1226
|
+
8. Mix both parameter tuning and structural changes
|
|
1227
|
+
9. If building on existing algorithms, use their ID as parent_id, otherwise leave parent_id empty
|
|
1200
1228
|
|
|
1201
1229
|
⚠️ AVOID ONLY: Kelly floor/cap adjustments that assume leverage > 1.0 (these get clamped and have no effect)
|
|
1202
1230
|
|
package/bin/claude-evolve-status
CHANGED
|
@@ -244,7 +244,9 @@ try:
|
|
|
244
244
|
# Show per-generation breakdown (unless brief mode)
|
|
245
245
|
if not show_brief and stats_by_gen:
|
|
246
246
|
print('📈 BY GENERATION:')
|
|
247
|
-
|
|
247
|
+
# Sort generations numerically by extracting the number after 'gen'
|
|
248
|
+
sorted_gens = sorted(stats_by_gen.keys(), key=lambda g: int(g[3:]) if g.startswith('gen') and g[3:].isdigit() else 0)
|
|
249
|
+
for gen in sorted_gens:
|
|
248
250
|
data = stats_by_gen[gen]
|
|
249
251
|
total = sum(data.values())
|
|
250
252
|
|
package/lib/config.sh
CHANGED
|
@@ -58,8 +58,8 @@ DEFAULT_LLM_CLI_VALUES[1]='codex exec --dangerously-bypass-approvals-and-sandbox
|
|
|
58
58
|
DEFAULT_LLM_CLI_VALUES[2]='gemini -y -p "{{PROMPT}}"'
|
|
59
59
|
DEFAULT_LLM_CLI_VALUES[3]='claude --dangerously-skip-permissions --model opus -p "{{PROMPT}}"'
|
|
60
60
|
DEFAULT_LLM_CLI_VALUES[4]='claude --dangerously-skip-permissions --model sonnet -p "{{PROMPT}}"'
|
|
61
|
-
DEFAULT_LLM_RUN="sonnet
|
|
62
|
-
DEFAULT_LLM_IDEATE="
|
|
61
|
+
DEFAULT_LLM_RUN="sonnet"
|
|
62
|
+
DEFAULT_LLM_IDEATE="gemini o3 opus"
|
|
63
63
|
|
|
64
64
|
# Load configuration from config file
|
|
65
65
|
load_config() {
|
package/package.json
CHANGED
package/templates/config.yaml
CHANGED
|
@@ -70,5 +70,5 @@ llm_cli:
|
|
|
70
70
|
# What to run for each sub-command
|
|
71
71
|
# Models are tried in order, with round-robin distribution across candidates
|
|
72
72
|
# You can repeat models for weighted selection (e.g., "sonnet sonnet gemini" for 2:1 ratio)
|
|
73
|
-
run: sonnet
|
|
74
|
-
ideate:
|
|
73
|
+
run: sonnet
|
|
74
|
+
ideate: gemini o3 opus
|