mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 22:32:04 +00:00
2.3 KiB
2.3 KiB
Autonomous Coding Agent Setup
This autonomous coding agent now uses the Claude Code CLI directly instead of the Python SDK.
Prerequisites
- Claude Code must be installed on your system
- You must authenticate Claude Code for headless mode (--print flag)
Authentication Setup
The --print (headless) mode requires a long-lived authentication token. To set this up:
Option 1: Setup Token (Recommended)
Run this command in your own terminal (requires Claude subscription):
claude setup-token
This will open your browser and authenticate Claude Code for headless usage.
Option 2: Use API Key
If you have an Anthropic API key instead:
export ANTHROPIC_API_KEY='your-api-key-here'
Or for OAuth tokens:
export CLAUDE_CODE_OAUTH_TOKEN='your-oauth-token-here'
Usage
Once authenticated, run:
python3 autonomous_agent_demo.py --project-dir ./my_project --max-iterations 3
Options:
--project-dir: Directory for your project (default:./autonomous_demo_project)--max-iterations: Maximum number of agent iterations (default: unlimited)--model: Claude model to use (default:opusfor Opus 4.5)
Examples:
# Start a new project with Opus 4.5
python3 autonomous_agent_demo.py --project-dir ./my_app
# Limit iterations for testing
python3 autonomous_agent_demo.py --project-dir ./my_app --max-iterations 5
# Use a different model
python3 autonomous_agent_demo.py --project-dir ./my_app --model sonnet
How It Works
The agent:
- Creates configuration files (
.claude_settings.json,.mcp_config.json) - Calls
claude --printwith your prompt - Captures the output and continues the autonomous loop
- Uses your existing Claude Code authentication
Troubleshooting
"Invalid API key" Error
This means Claude Code isn't authenticated for headless mode. Run:
claude setup-token
Check Authentication Status
Test if headless mode works:
echo "Hello" | claude --print --model opus
If this works, the autonomous agent will work too.
Still Having Issues?
- Make sure Claude Code is installed:
claude --version - Check that you can run Claude normally:
claude - Verify
claudeis in your PATH:which claude - Try re-authenticating:
claude setup-token