An autonomous coding agent powered by Claude Agent SDK and task-master AI that implements features from a structured task list.
This agent:
- Connects to task-master MCP server to fetch tasks
- Reads project context from PRD.md
- Autonomously implements one task at a time
- Creates feature branches and commits changes
- Marks tasks as complete
- Node.js - for task-master-ai
- Python 3.11+ - for Claude Agent SDK
- uv - Python package manager (recommended)
- Git - for version control operations
npm install -g task-master-ai# Initialize project (if not already done)
uv init
# Install dependencies
uv add claude-agent-sdk rich python-dotenvcp .env.example .env
# Edit .env and add your API keysRequired:
ANTHROPIC_API_KEY- Your Anthropic API key
Optional:
PERPLEXITY_API_KEY- For task-master research features
Your target repository should contain:
- tasks.json - Task list managed by task-master
- PRD.md (optional) - Product Requirements Document for context
Initialize task-master in your target repo:
cd /path/to/your/project
task-master inituv run python coding_agent.py --repo-path /path/to/target/repo# Use Haiku (faster, cheaper)
uv run python coding_agent.py --repo-path /path/to/target/repo --model haiku
# Use Sonnet (balanced)
uv run python coding_agent.py --repo-path /path/to/target/repo --model sonnet
# Use Opus (most capable)
uv run python coding_agent.py --repo-path /path/to/target/repo --model opus- Task Fetching: Agent queries task-master MCP to get the next pending task
- Context Gathering: Reads PRD.md and existing codebase to understand requirements
- Planning: Creates its own internal todo list to plan implementation
- Implementation: Writes/modifies code autonomously following existing patterns
- Version Control: Creates a feature branch and commits changes
- Completion: Marks task as complete via task-master
[Start] → Connect to task-master MCP
→ Run 'task-master next'
→ Read PRD.md for context
→ Create internal todo list
→ Implement task
→ Create feature branch
→ Commit changes
→ Mark task complete
→ [Done]
- Agent SDK: Handles Claude API communication and tool orchestration
- MCP Server: task-master-ai provides task management interface
- Autonomous Mode: Agent creates its own plan and executes independently
- Single Task Focus: Implements one task per run for better quality
Starting Coding Agent
Target Repository: /home/user/my-project
Model: sonnet
============================================================
Sending task to agent...
[Agent creates todo list]
[Agent fetches next task from task-master]
[Agent reads PRD and existing code]
[Agent implements feature]
[Agent creates branch and commits]
[Agent marks task complete]
============================================================
Agent completed task!
The agent automatically configures task-master MCP with your environment:
{
"taskmaster-ai": {
"command": "npx",
"args": ["-y", "--package=task-master-ai", "task-master-ai"],
"env": {
"ANTHROPIC_API_KEY": "...",
"MODEL": "claude-3-7-sonnet-20250219",
"REPO_PATH": "/path/to/target/repo"
}
}
}- Ensure
tasks.jsonexists in target repo - Run
task-master listmanually to verify tasks
- Check
ANTHROPIC_API_KEYis set correctly - Verify task-master-ai is installed:
npm list -g task-master-ai
- Ensure target repo is a valid git repository
- Check you have write permissions
- Sub-agent for writing unit tests
- Pre-commit hooks for test validation
- Multi-task batch processing
- PR creation and submission
- Continuous mode (loop through all tasks)
MIT