Repository: Clawland-AI/Geneclaw (upstream: HKUDS/nanobot)
This runbook gets you from zero to your first evolution proposal using only CLI commands. No source code reading required.
- Python >= 3.11
- Git installed
- nanobot + geneclaw installed:
# Clone and install
git clone https://github.com/Clawland-AI/Geneclaw.git
cd Geneclaw
pip install -e ".[dev]"
# Initial nanobot setup (creates ~/.nanobot/config.json + workspace)
nanobot onboardEdit ~/.nanobot/config.json and add/update the geneclaw section:
{
"geneclaw": {
"enabled": true,
"redactEnabled": true,
"allowApplyDefault": false,
"logMaxChars": 500,
"maxPatchLines": 500,
"allowlistPaths": ["geneclaw/", "nanobot/", "tests/", "docs/"],
"denylistPaths": [".env", "secrets/", ".git/", "config.json"]
},
"tools": {
"restrictToWorkspace": true
}
}Key settings:
enabled: true— activates run event recording in the agent loopallowApplyDefault: false— ensures dry-run is the default (safe)restrictToWorkspace: true— recommended for geneclaw workflows
Verify your setup is healthy:
nanobot geneclaw doctorExpected output:
Geneclaw Doctor
✓ geneclaw.enabled: Geneclaw observability is enabled.
✓ dry_run_default: Dry-run is the default (allow_apply_default=false). Safe.
✓ restrict_to_workspace: tools.restrictToWorkspace is ON. Recommended.
✓ runs_dir_writable: Runs directory does not exist yet. Will be auto-created.
✓ allowlist_paths: Allowlist (4 entries): geneclaw/, nanobot/, tests/, docs/
✓ denylist_paths: Denylist (4 entries): .env, secrets/, .git/, config.json
✓ redact_enabled: Secret redaction is enabled for run logs.
Summary: 7 ok, 0 warnings, 0 errors
Suggested next steps:
...
Fix any errors before proceeding.
Interact with the agent to generate your first run events:
# Single message
nanobot agent -m "Hello, what tools do you have?"
# Or interactive mode
nanobot agentEach interaction records events to:
~/.nanobot/workspace/geneclaw/runs/<session_key>/YYYYMMDD.jsonl
nanobot geneclaw statusShows: enabled state, session count, last run log timestamp.
nanobot geneclaw evolve --dry-runThis will:
- Load recent run events from all sessions
- Run heuristic diagnosis (tool failures, exception clusters)
- Call the LLM to generate an evolution proposal
- Write the proposal JSON to
~/.nanobot/workspace/geneclaw/proposals/ - Display a summary (title, risk, files, diff stats)
The --dry-run flag (default) means no files are modified.
# List proposals
ls ~/.nanobot/workspace/geneclaw/proposals/
# Windows: dir %USERPROFILE%\.nanobot\workspace\geneclaw\proposals\
# Read a proposal
cat ~/.nanobot/workspace/geneclaw/proposals/proposal_YYYYMMDD_HHMMSS.json
# Windows: type %USERPROFILE%\.nanobot\workspace\geneclaw\proposals\proposal_...jsonProposal structure:
{
"id": "uuid",
"title": "short description",
"objective": "what this evolution achieves",
"evidence": ["diagnostic evidence..."],
"risk_level": "low",
"files_touched": ["nanobot/config/schema.py"],
"unified_diff": "--- a/file\n+++ b/file\n...",
"tests_to_run": ["pytest tests/..."],
"rollback_plan": "how to undo"
}JSONL files contain one event per line:
# View recent events
cat ~/.nanobot/workspace/geneclaw/runs/cli_direct/YYYYMMDD.jsonl
# Count events by type (Linux/Mac)
jq -r '.event_type' ~/.nanobot/workspace/geneclaw/runs/*/YYYYMMDD.jsonl | sort | uniq -c
# Find failures
jq 'select(.success == false)' ~/.nanobot/workspace/geneclaw/runs/*/YYYYMMDD.jsonlEvent types:
inbound_msg— user message receivedtool_start/tool_end— tool call with duration and successexception— unhandled erroroutbound_msg— agent response sent
nanobot geneclaw report --since 48Shows: evolve count, apply count, success rate, top failures, risk distribution.
-
Dry-run by default: The
--applyflag is required to modify files. Even then,allow_apply_defaultmust betruein config. -
Secret redaction: All run logs are automatically scrubbed for API keys, tokens, PEM keys, and hex strings before writing to disk.
-
Allowlist/Denylist: Proposals can only touch files matching the allowlist and are blocked from touching denylist paths (
.env,.git/,secrets/). -
Diff scanning: Before apply, diffs are scanned for embedded secrets and suspicious patterns (
eval(),exec(),os.system()). -
Auto-rollback: If tests fail after applying a patch, the change is automatically rolled back (branch deleted, files restored).
-
Workspace restriction: Enable
tools.restrictToWorkspace=trueto prevent agent tools from accessing files outside the workspace.
| Command | Description |
|---|---|
nanobot geneclaw doctor |
Health check (read-only) |
nanobot geneclaw status |
Show enabled state, runs, last log |
nanobot geneclaw evolve --dry-run |
Generate proposal without applying |
nanobot geneclaw evolve --apply |
Generate and apply (requires config) |
nanobot geneclaw apply <file> --dry-run |
Validate a saved proposal |
nanobot geneclaw apply <file> --apply |
Apply a saved proposal |
nanobot geneclaw report |
Show evolution stats (last 24h) |