claude-evolve 1.2.0 → 1.2.1
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 +70 -17
- package/bin/claude-evolve-run +20 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Automated algorithm evolution - let AI evolve your algorithms while you sleep.
|
|
|
6
6
|
|
|
7
7
|
claude-evolve is an automated algorithm evolution system that runs continuous evolution cycles without constant supervision. Start with a base algorithm and let it evolve optimized variants autonomously.
|
|
8
8
|
|
|
9
|
-
Think of it like **genetic algorithms for code** - it handles the mutations and testing,
|
|
9
|
+
Think of it like **genetic algorithms for code** - it handles the mutations and testing, and runs **indefinitely** until you stop it. The system automatically generates new ideas when it runs out of candidates.
|
|
10
10
|
|
|
11
11
|
### How the Evolution System Works
|
|
12
12
|
|
|
@@ -19,10 +19,10 @@ The system operates with specialized phases working together:
|
|
|
19
19
|
|
|
20
20
|
The evolution cycle:
|
|
21
21
|
```
|
|
22
|
-
Ideate → Mutate → Evaluate →
|
|
22
|
+
Ideate → Mutate → Evaluate → (Auto-Generate New Ideas) → Repeat Forever
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
You can leave it running while you
|
|
25
|
+
**Truly autonomous evolution**: The system runs indefinitely, automatically generating new generations of ideas when it exhausts current candidates. You can leave it running overnight, over the weekend, or while you work on other things - it just keeps evolving better algorithms until you manually stop it with Ctrl+C.
|
|
26
26
|
|
|
27
27
|
## Installation
|
|
28
28
|
|
|
@@ -65,19 +65,22 @@ Initializes your evolution workspace with:
|
|
|
65
65
|
- CSV file for tracking evolution progress
|
|
66
66
|
|
|
67
67
|
#### claude-evolve-ideate
|
|
68
|
-
Generates new algorithm variation ideas using
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
68
|
+
Generates new algorithm variation ideas using multi-strategy evolutionary approach:
|
|
69
|
+
- **Novel exploration** - Pure creativity for global search
|
|
70
|
+
- **Hill climbing** - Parameter tuning of top performers
|
|
71
|
+
- **Structural mutation** - Algorithmic changes to successful designs
|
|
72
|
+
- **Crossover hybrid** - Combines successful approaches
|
|
73
|
+
- Uses Claude Opus in megathinking mode for each strategy
|
|
74
|
+
- Configurable strategy distribution (default: 3+5+3+4 = 15 ideas)
|
|
73
75
|
|
|
74
76
|
#### claude-evolve-run
|
|
75
|
-
Executes
|
|
77
|
+
Executes evolution candidates in an **infinite loop**:
|
|
76
78
|
- Picks the next untested idea from your CSV
|
|
77
79
|
- Uses Claude to implement the mutation
|
|
78
80
|
- Runs your evaluator to measure performance
|
|
79
81
|
- Records results and updates the evolution log
|
|
80
|
-
-
|
|
82
|
+
- **When no candidates remain**: Automatically generates new ideas and continues
|
|
83
|
+
- **Runs forever until manually stopped** (Ctrl+C)
|
|
81
84
|
|
|
82
85
|
#### claude-evolve-analyze
|
|
83
86
|
Analyzes evolution progress and generates insights:
|
|
@@ -102,7 +105,8 @@ Manages configuration settings:
|
|
|
102
105
|
- Implements the mutation
|
|
103
106
|
- Evaluates performance
|
|
104
107
|
- Records results
|
|
105
|
-
-
|
|
108
|
+
- **Generates new ideas when candidates are exhausted**
|
|
109
|
+
- **Repeats forever until manually stopped**
|
|
106
110
|
|
|
107
111
|
## Monitoring Progress (Like Genetic Algorithms)
|
|
108
112
|
|
|
@@ -120,10 +124,11 @@ This isn't sci-fi level "sleep through the entire evolution" automation - it's m
|
|
|
120
124
|
- **Restart from best** - Copy top performer to `algorithm.py` and continue evolving
|
|
121
125
|
- **The system adapts** - New ideas will build on your guidance
|
|
122
126
|
|
|
123
|
-
**
|
|
124
|
-
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
+
**Infinite evolution with manual control:**
|
|
128
|
+
- **Runs forever** - automatically generates new generations of ideas
|
|
129
|
+
- **Hit Ctrl+C anytime** to stop the evolution process
|
|
130
|
+
- **Restart later** with `claude-evolve run` to continue from where you left off
|
|
131
|
+
- **Perfect for long-term optimization** - run overnight, over weekends, or while working on other projects
|
|
127
132
|
|
|
128
133
|
## Requirements
|
|
129
134
|
|
|
@@ -173,13 +178,61 @@ evolution_csv: "evolution.csv"
|
|
|
173
178
|
# Parent algorithm selection strategy
|
|
174
179
|
parent_selection: "best" # or "random", "latest"
|
|
175
180
|
|
|
176
|
-
#
|
|
177
|
-
|
|
181
|
+
# Multi-strategy ideation configuration
|
|
182
|
+
ideation_strategies:
|
|
183
|
+
total_ideas: 15 # Total ideas per generation
|
|
184
|
+
novel_exploration: 3 # Pure creativity, global search
|
|
185
|
+
hill_climbing: 5 # Parameter tuning of top performers
|
|
186
|
+
structural_mutation: 3 # Algorithmic changes to top performers
|
|
187
|
+
crossover_hybrid: 4 # Combine successful approaches
|
|
188
|
+
num_elites: 3 # Number of top performers to use as parents
|
|
178
189
|
|
|
179
190
|
# Python command to use for evaluation
|
|
180
191
|
python_cmd: "python3"
|
|
181
192
|
```
|
|
182
193
|
|
|
194
|
+
### Understanding the Multi-Strategy Approach
|
|
195
|
+
|
|
196
|
+
The ideation system uses evolutionary algorithm principles with four complementary strategies:
|
|
197
|
+
|
|
198
|
+
**🎯 Novel Exploration (Global Search)**
|
|
199
|
+
- Generates completely new algorithmic approaches
|
|
200
|
+
- Prevents getting stuck in local optima
|
|
201
|
+
- Explores different paradigms, data structures, mathematical approaches
|
|
202
|
+
- Essential for breakthrough innovations
|
|
203
|
+
|
|
204
|
+
**⛰️ Hill Climbing (Exploitation)**
|
|
205
|
+
- Fine-tunes parameters of successful algorithms
|
|
206
|
+
- Adjusts constants, thresholds, iteration counts
|
|
207
|
+
- Quick wins through incremental improvements
|
|
208
|
+
- Builds on proven approaches
|
|
209
|
+
|
|
210
|
+
**🔧 Structural Mutation (Medium-Distance Search)**
|
|
211
|
+
- Redesigns implementation while keeping core insights
|
|
212
|
+
- Changes data structures, sub-algorithms, execution patterns
|
|
213
|
+
- Balances innovation with proven concepts
|
|
214
|
+
- Explores architectural variations
|
|
215
|
+
|
|
216
|
+
**🧬 Crossover Hybrid (Recombination)**
|
|
217
|
+
- Combines successful elements from different top performers
|
|
218
|
+
- Creates novel interactions between proven approaches
|
|
219
|
+
- Leverages diversity in the population
|
|
220
|
+
- Often produces unexpected breakthrough combinations
|
|
221
|
+
|
|
222
|
+
**⚖️ Strategy Balance**
|
|
223
|
+
The default 3+5+3+4 distribution provides:
|
|
224
|
+
- 20% wild exploration (escape local maxima)
|
|
225
|
+
- 33% focused exploitation (quick improvements)
|
|
226
|
+
- 20% structural innovation (medium jumps)
|
|
227
|
+
- 27% recombination (leverage diversity)
|
|
228
|
+
|
|
229
|
+
**🎛️ Tuning Your Evolution**
|
|
230
|
+
Adjust ratios based on your needs:
|
|
231
|
+
- **Stuck in local optimum?** Increase `novel_exploration` and `structural_mutation`
|
|
232
|
+
- **Need incremental gains?** Increase `hill_climbing`
|
|
233
|
+
- **Population too similar?** Increase `crossover_hybrid`
|
|
234
|
+
- **Want faster convergence?** Decrease `total_ideas`, increase `hill_climbing`
|
|
235
|
+
|
|
183
236
|
## Tips for Success
|
|
184
237
|
|
|
185
238
|
1. **Write a clear BRIEF.md** - Describe your optimization problem, constraints, and goals
|
package/bin/claude-evolve-run
CHANGED
|
@@ -145,8 +145,26 @@ update_csv_row() {
|
|
|
145
145
|
while true; do
|
|
146
146
|
# Find next candidate
|
|
147
147
|
if ! row_num=$(find_empty_row); then
|
|
148
|
-
echo "[INFO] No more pending candidates found.
|
|
149
|
-
|
|
148
|
+
echo "[INFO] No more pending candidates found. Generating new ideas..."
|
|
149
|
+
|
|
150
|
+
# Check if claude-evolve-ideate exists
|
|
151
|
+
ideate_script="$SCRIPT_DIR/claude-evolve-ideate"
|
|
152
|
+
if [[ ! -f "$ideate_script" ]]; then
|
|
153
|
+
echo "[ERROR] claude-evolve-ideate script not found: $ideate_script" >&2
|
|
154
|
+
echo "[INFO] Evolution run complete - no way to generate more ideas."
|
|
155
|
+
exit 0
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
# Generate new ideas using the multi-strategy approach
|
|
159
|
+
echo "[INFO] Calling claude-evolve-ideate to generate new candidates..."
|
|
160
|
+
if ! "$ideate_script"; then
|
|
161
|
+
echo "[ERROR] Failed to generate new ideas" >&2
|
|
162
|
+
echo "[INFO] Evolution run complete - ideation failed."
|
|
163
|
+
exit 1
|
|
164
|
+
fi
|
|
165
|
+
|
|
166
|
+
echo "[INFO] New ideas generated successfully. Continuing evolution..."
|
|
167
|
+
continue # Go back to start of loop to find the new candidates
|
|
150
168
|
fi
|
|
151
169
|
|
|
152
170
|
# Create log file for this iteration
|