Automating End-to-End PR Workflows with Claude Task Master
Introduction
Developers spend a large portion of their time creating pull requests, fixing CI failures, and responding to review comments. Claude Task Master (CLI claudetm) removes that manual loop by orchestrating the entire lifecycle from a high-level goal. The tool is built on the Claude Agent SDK and follows a clear plan → work → PR → verification cycle. This article explains how the system works, how to set it up, and how to extend it with the provided REST API.
How Claude Task Master Works
The core philosophy is that Claude can both do the work and verify it. When you give a goal, the CLI generates a task list, writes code, commits changes, pushes a branch, opens a pull request, monitors CI, addresses review feedback, and finally merges the PR when all checks pass. State is persisted between runs, so an interruption does not lose progress. The workflow can be summarized as:
PLANNING → WORKING → PR LIFECYCLE → VERIFICATION
Each stage is autonomous but can be paused for human input when required.
Quick Start
Installation works with uv, pip, or Docker. The following example uses pip:
pip install claude-task-master
# Authenticate with Claude first
claude login
# Run a task in your project directory
cd my-project
claudetm start "Add user authentication with tests"
The command reads the codebase, creates a plan, and starts executing tasks. All changes are pushed as a pull request, never as direct commits.
Profiles for Parallel Instances
Many organizations run multiple Claude subscriptions. Profiles isolate credentials and configuration directories. A profile can be created with an OAuth login or an API key. Example:
claudetm --profile dev start "Implement feature X"
claudetm --profile prod start "Deploy service Y"
Each profile stores its own ~/.claudetm/profiles/<name>/ directory, preventing clashes between API keys.
Extending with the REST API and Webhooks
Claude Task Master exposes a REST API and an MCP server for programmatic control. You can dispatch new goals, query task status, and receive webhook events for state changes. A typical payload for creating a task looks like:
{
"goal": "Refactor payment module",
"profile": "dev",
"callback_url": "https://example.com/webhook"
}
The server returns a task identifier that can be used to poll progress. Webhook events include planning_started, pr_created, ci_failed, and task_completed. This makes it easy to integrate Claude Task Master into existing CI/CD dashboards.
Real-World Example: Handling CI Failures
When a pull request is opened, CI runs automatically. If a check fails, Claude Task Master reads the error output, modifies the code, and pushes a new commit. The loop continues until the CI passes. This behavior is demonstrated in the repository’s examples/ci-loop directory. The tool also parses review comments and applies suggested changes without human intervention.
Verification and Success Criteria
Before a task is marked as complete, Claude runs the defined success criteria. This includes running the full test suite, linting, and any custom checks defined in the plan. Only when all criteria are satisfied does the CLI merge the pull request.
Open Source and Community
Claude Task Master is released under the MIT license. It can be installed via PyPI or Docker. Contributions are welcome on GitHub at https://github.com/developerz-ai/claude-task-master. The community can add support for additional languages, improve the mailbox system, or create custom webhook handlers.
Conclusion
By automating the entire pull-request lifecycle, Claude Task Master lets developers focus on design and architecture while the tool handles repetitive tasks. Its persistence, profile isolation, and API integration make it suitable for both small teams and large enterprises. Try it today and experience a new level of automation in your development workflow.
For more details, see the repository README and the documentation site.
Top comments (0)