From claude-evolve
Installs, verifies, or refreshes claude-evolve plugin via Python dependency management, venv setup, Claude CLI checks, and MCP server registration. Invoke after plugin installation.
npx claudepluginhub samuelzxu/claude-evolve --plugin claude-evolveThis skill uses the workspace's default tool permissions.
This is the setup command for claude-evolve. Run it once after installing the plugin to verify Python dependencies, create a virtual environment if needed, and confirm the MCP server is registered.
Provides reverse-engineered docs for Claude Code CLI v2.1.84 internals: agent loop, tool execution, MCP, plugins/skills, prompt assembly, session persistence, and rewrite architecture. Use to build alternatives or study agentic shells.
Runs bash script to diagnose Claude Code plugin issues, checking Node.js, build tools, dependencies, MCP wrapper, Python, and Playwright. Provides fix instructions for failures.
Installs MCP tools (Serena, Sequential Thinking, Context7, Playwright MCP) for Claude Code/Codex, rebuilds host configs, bootstraps Serena for repo, verifies host readiness ledger.
Share bugs, ideas, or general feedback.
This is the setup command for claude-evolve. Run it once after installing the plugin to verify Python dependencies, create a virtual environment if needed, and confirm the MCP server is registered.
When this skill is invoked, immediately execute the workflow below. Do not only restate or summarize these instructions back to the user.
Check for flags in the user's invocation:
--help → Show Help Text (below) and stop--force → Skip Pre-Setup Check, run full setup from scratch--verify → Only run the verification phase (Phase 4), skip install/env setup--local → Install into a project-local .venv--global → Use the system Python (no venv)When user runs with --help, display this and stop:
claude-evolve Install - Set up evolutionary code discovery plugin
USAGE:
/evolve-install Install or verify (auto-detect)
/evolve-install --local Install into a project-local .venv
/evolve-install --global Use system Python (no venv)
/evolve-install --verify Only verify existing install
/evolve-install --force Force full reinstall
/evolve-install --help Show this help
PHASES:
1. Python check Verify Python >= 3.10 is available
2. Environment setup Create venv (if --local or auto) and install claude-evolve
3. Claude CLI check Verify `claude` is on PATH and authenticated
4. MCP verification Confirm claude-evolve MCP server registers and exposes tools
5. Smoke test Run a trivial claude call to confirm the bridge works
NEXT STEPS:
After install completes, run `/evolve-interview` to define your first
evolution task, or `/evolve` if you already have initial.py + evaluate.py.
Before doing anything else, check if the plugin is already installed and working. Read the state file:
CLAUDE_EVOLVE_STATE="${CLAUDE_PLUGIN_ROOT:-.}/state/install-state.json"
If the state file exists AND reports "status": "ok" AND no --force flag is set, use AskUserQuestion to prompt:
Question: "claude-evolve is already installed. What would you like to do?"
Options:
On "Verify install" → jump to Phase 4. On "Reinstall" → continue with Phase 1 below. On "Cancel" → exit.
Use Bash to verify Python:
python3 --version 2>&1 || python --version 2>&1
Requirements:
Report the detected Python path and version.
Determine installation mode:
--global: use system Python, skip venv creation--local or default: create core/.venv/ in the plugin directorySteps:
Check if core/.venv/ exists. If not (and mode is local), create it:
python3 -m venv "${CLAUDE_PLUGIN_ROOT:-.}/core/.venv"
Install claude-evolve into that Python:
PYTHON="${CLAUDE_PLUGIN_ROOT:-.}/core/.venv/bin/python" # or system python3 if --global
"$PYTHON" -m pip install -e "${CLAUDE_PLUGIN_ROOT:-.}/core"
Check for install errors. Common issues:
setuptools, wheel)mcp package on PyPIIf install fails, report the stderr tail and stop.
Verify the Claude CLI is available and authenticated:
claude --version 2>&1
If not installed, tell the user:
The
claudeCLI is required. Install it from https://claude.com/code/install
Then run a tiny non-authenticated smoke:
claude --help 2>&1 | head -5
Verify the MCP server starts and exposes all expected tools.
Important: Do NOT use the timeout or gtimeout shell commands here. They are Linux-only and GNU-coreutils-on-macOS respectively, and neither is guaranteed to exist on a fresh install. Use Python's built-in subprocess timeout instead, which works everywhere Python works (and Python is guaranteed present by Phase 2).
Run the probe by inlining a short Python script that drives the MCP handshake. Use Popen + a deadline reader — do not use subprocess.run(input=...), because closing stdin triggers FastMCP shutdown before the tools/list response is flushed.
"$PYTHON" - <<'PYEOF'
import json, subprocess, sys, time
init = {"jsonrpc":"2.0","id":1,"method":"initialize",
"params":{"protocolVersion":"2024-11-05","capabilities":{},
"clientInfo":{"name":"evolve-install","version":"1.0"}}}
notif = {"jsonrpc":"2.0","method":"notifications/initialized"}
list_req = {"jsonrpc":"2.0","id":3,"method":"tools/list","params":{}}
payload = "\n".join(json.dumps(m) for m in [init, notif, list_req]) + "\n"
proc = subprocess.Popen(
[sys.executable, "-m", "claude_evolve.server"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
bufsize=1,
)
proc.stdin.write(payload)
proc.stdin.flush()
deadline = time.time() + 15
tools_line = None
try:
while time.time() < deadline:
line = proc.stdout.readline()
if not line:
break
if '"id":3' in line and '"tools"' in line:
tools_line = line
break
finally:
try:
proc.stdin.close()
except Exception:
pass
proc.terminate()
try:
proc.wait(timeout=3)
except subprocess.TimeoutExpired:
proc.kill()
if tools_line is None:
err = proc.stderr.read()[:500] if proc.stderr else ""
print(f"MCP_PROBE_FAIL: no tools/list response within deadline. stderr={err}")
sys.exit(1)
data = json.loads(tools_line)
tools = [t["name"] for t in data["result"]["tools"]]
expected = {"evolve_start", "evolve_status", "evolve_stop", "evolve_visualize", "evaluator_create"}
missing = expected - set(tools)
if missing:
print(f"MCP_PROBE_FAIL: missing tools {sorted(missing)}. Got: {tools}")
sys.exit(1)
print(f"MCP_PROBE_OK: {len(tools)} tools exposed: {sorted(tools)}")
PYEOF
Parse the output — look for MCP_PROBE_OK on success or MCP_PROBE_FAIL: on failure. If it fails, report the stderr tail and stop.
Also run claude mcp list 2>&1 and confirm an entry matching claude-evolve (or the short name e) appears with ✓ Connected. If it doesn't, the user may need to restart Claude Code or run claude mcp add manually — provide the exact command.
Run one real Claude CLI call through the bridge to confirm end-to-end:
"$PYTHON" -c "
import asyncio
from claude_evolve.ensemble.bridge import query_claude_async
result = asyncio.run(query_claude_async(arm='haiku/low', prompt='Respond with just OK', timeout=60))
print('Bridge smoke test:', result.content[:50])
"
If this succeeds, the full stack works.
If it fails with an auth error, tell the user to run claude once interactively to authenticate.
Set up the claude-evolve HUD that displays evolution progress in the Claude Code status bar. This appends a second line below any existing HUD (e.g. OMC's).
Steps:
Read the current statusLine.command from ~/.claude/settings.json (or $CLAUDE_CONFIG_DIR/settings.json).
If a statusLine already exists (e.g. OMC's HUD), save it to ~/.claude-evolve/original-hud.json so the combiner can chain it:
{"command": "<the existing statusLine.command value>"}
If no statusLine exists yet, write ~/.claude-evolve/original-hud.json with {"command": null}.
Set the statusLine command to the claude-evolve combiner:
{
"statusLine": {
"type": "command",
"command": "node ${CLAUDE_PLUGIN_ROOT}/bridge/hud-combiner.mjs"
}
}
IMPORTANT: Use the statusline-setup agent or directly patch ~/.claude/settings.json to update the statusLine field. Do NOT overwrite other settings.json fields.
If the current statusLine already points to hud-combiner.mjs, skip (already configured).
What the HUD shows during an active evolution run:
evolve │ ⟳ gen 15 │ best 2.4103 │ 30 calls │ 12 progs
Status icons: ⟳ (yellow, running) | ✓ (green, complete) | ✗ (red, crashed/dead)
When no evolution run is active, the evolve line is hidden — only the original HUD shows.
After all phases succeed, write state to state/install-state.json:
{
"status": "ok",
"installed_at": "<ISO timestamp>",
"python_path": "<path>",
"python_version": "<version>",
"venv_path": "<path or null>",
"mcp_tools": 5,
"claude_cli_version": "<version>",
"plugin_version": "0.1.0"
}
Tell the user:
✅ claude-evolve installed and verified.
- Python: at
- Venv: <path or "system">
- MCP tools: 5 (evolve_start, evolve_status, evolve_stop, evolve_visualize, evaluator_create)
- Claude CLI:
- HUD: <configured / already configured / skipped>
Next step: Run
/evolve-interviewto define your first optimization task interactively, or/evolveif you already haveinitial.pyandevaluate.py.
If any phase fails, save partial state to state/install-state.json with "status": "partial" and the phase that failed. On next invocation, offer to resume from the failed phase.
pip install mcp into the target Pythonpython -m claude_evolve.server directly for traceback--bare flag if present; run claude interactively once