A general-purpose autonomous agent runner that continuously refines and evolves any project based on a configurable prompt. Point it at any repository with a project-config.json and let it incrementally improve your codebase over time.
This repository contains only the agent infrastructure. Projects live in their own separate repositories/directories. This clean separation means:
- Your project's git history stays independent
- The agent can evolve multiple projects
- Agent updates don't affect your projects
- Projects can be private while the agent is shared
evolution-agent/ # This repository
├── agent/
│ ├── run.sh # Main runner script
│ ├── c-run.sh # Containerized runner
│ ├── Dockerfile # Container definition
│ ├── config/
│ │ └── agent-config.json # Global agent guidelines
│ ├── state/ # Runtime state (timestamps, markers)
│ └── logs/ # Execution logs
├── ssh/ # SSH keys for GitHub (gitignored)
│ ├── id_ed25519 # Private key
│ └── id_ed25519.pub # Public key
└── README.md
../my-project/ # Your project (separate repo)
├── project-config.json # Evolution instructions
└── ... # Your project files
# Install Claude Code CLI
npm install -g @anthropic-ai/claude-code
# Ensure jq is installed (for JSON processing)
# Ubuntu/Debian
sudo apt install jq
# macOS
brew install jqRun claude once to authenticate:
claudeThis creates ~/.claude/.credentials.json which is required for the agent to run. For containerized runs (c-run.sh), this file is copied into the container at runtime.
If you want the agent to push commits to GitHub, generate an SSH key and place it in the ssh/ directory:
# Generate a new key (or copy an existing one)
ssh-keygen -t ed25519 -f ssh/id_ed25519 -N ""
# Add the public key to your GitHub account
cat ssh/id_ed25519.pub
# Copy this output to GitHub → Settings → SSH KeysThe ssh/ directory is gitignored to keep your keys out of version control.
Note: For non-containerized runs (run.sh), your system's default SSH configuration is used instead.
In any repository you want the agent to evolve, create a project-config.json:
{
"name": "my-project",
"description": "What this project does",
"auto_commit": true,
"auto_push": false,
"min_interval_seconds": 60,
"prompt": "Your detailed instructions for the agent. Describe what you want built, improved, or fixed. Be specific about constraints and goals."
}# From the agent directory, point to your project
./agent/run.sh ../my-project
# Dry run (no changes committed)
./agent/run.sh ../my-project --dry-run
# Using absolute path
./agent/run.sh /home/user/projects/my-app
# Containerized execution (more secure)
./agent/c-run.sh ../my-project| Field | Type | Default | Description |
|---|---|---|---|
name |
string | required | Project identifier (used for logs and state) |
description |
string | - | Human-readable description |
prompt |
string | required | The instructions given to the agent each run |
auto_commit |
boolean | true | Automatically commit changes |
auto_push |
boolean | false | Push commits to remote |
min_interval_seconds |
number | 60 | Minimum time between runs |
Contains guidelines that apply to all projects:
- General coding standards
- Safety constraints
- Improvement priorities
- Trigger:
run.shis called with a project path (manually or via cron) - Safety Checks: Verifies auth status, rate limits, and minimum intervals
- Load Config: Reads project-specific prompt from
project-config.json - Invoke Agent: Runs Claude with the prompt in the project directory
- Auto-Commit: If changes detected and enabled, commits with descriptive message
- Log: Records execution details to
agent/logs/
Add to crontab for continuous evolution:
# Run every 10 minutes
*/10 * * * * /path/to/evolution-agent/agent/run.sh /path/to/my-project >> /path/to/evolution-agent/agent/logs/cron.log 2>&1For added security, use the containerized runner:
# Build and run
./agent/c-run.sh ../my-project
# Rebuild the image
./agent/c-run.sh ../my-project --rebuildThe container:
- Has a read-only filesystem (except
/agentand/project) - Stores credentials in ephemeral tmpfs (never persisted)
- Runs as non-root user
- Prevents concurrent executions
Located in agent/state/:
| File | Purpose |
|---|---|
last_run_<project> |
Unix timestamp of last successful run |
last_prompt_<project>.txt |
The prompt sent on last run |
auth_expired |
Created if API auth fails; remove after claude /login |
rate_limited |
Created if rate limited; auto-clears after 1 hour |
A collection of 42 CLI productivity tools autonomously created by this agent:
# Clone and run
git clone <productivity-suite-repo> ../productivity-suite
./agent/run.sh ../productivity-suite{
"name": "my-webapp",
"auto_commit": true,
"prompt": "You are improving a React web application. Each run, make ONE improvement: fix a bug, add a feature, improve tests, or refactor code. Update CHANGELOG.md with your changes. Focus on code quality and user experience."
}{
"name": "docs-site",
"auto_commit": true,
"prompt": "You maintain a documentation website. Each run: fix typos, improve clarity, add missing examples, or expand incomplete sections. Keep the tone consistent and beginner-friendly."
}- Claude Code CLI (
npm install -g @anthropic-ai/claude-code) jqfor JSON processinggitfor version control- Docker (optional, for containerized runs)
- Be specific: Describe exactly what you want built or improved
- Set constraints: Limit scope per run (e.g., "make ONE change")
- Define structure: Specify directory layout, file naming conventions
- Include examples: Show the agent what good output looks like
- Iterate: Refine your prompt as the project evolves
- Track state: Use a manifest.json or similar to help the agent understand what exists
MIT