DEV Community

developerz.ai
developerz.ai

Posted on

Automating Pull Request Workflows with Claude Task Master

Automating Pull Request Workflows with Claude Task Master

Claude Task Master, invoked with the claudetm CLI, provides an autonomous loop that keeps Claude working until a defined goal is achieved. The tool reads the codebase, creates a task list, writes code, runs tests, opens a pull request, handles CI failures and review comments, and merges when everything passes. This article explains how the workflow operates, how to get started, and how to integrate the system into larger pipelines.

Core Concepts

The system follows a four stage loop: planning, working, PR lifecycle, and verification. In the planning stage the CLI analyzes the repository and produces a list of tasks that map to individual pull requests. During the working stage it executes each task, committing changes and pushing them to a remote branch. The PR lifecycle stage waits for CI checks, fixes any failures, addresses review comments, and merges the pull request when it is approved. Verification runs a final test suite and lint checks to confirm that the success criteria are met.

State persistence is a key feature. The CLI writes its progress to a local file, so if the process is stopped or the machine restarts the next run resumes exactly where it left off. This makes the system robust to interruptions and suitable for long running feature development.

Getting Started

# Install via uv, pip or Docker
uv tool install claude-task-master

# Authenticate with Claude Code
claude login

# Run a task in your project directory
cd your-project
claudetm start "Add user authentication with tests"
Enter fullscreen mode Exit fullscreen mode

The command above creates a plan, opens a pull request, and continues until the pull request is merged. All actions are recorded in the task log, which can be inspected with claudetm status.

Example Workflow

Consider a Ruby on Rails project that needs a new API endpoint for user registration. The goal is expressed as a plain English sentence. The CLI reads the codebase, generates a migration, adds a controller action, writes model validations, and creates corresponding RSpec tests. It then pushes the changes to a new branch and opens a pull request. CI runs the test suite, reports a failure due to a missing route, and the CLI automatically adds the missing route and pushes the fix. After the reviewer approves the pull request, the CLI merges it.

The entire process requires no manual git commands after the initial start invocation. The state file ensures that if the machine reboots after the CI failure, the next run picks up from the point where the route was added.

REST API and Webhook Integration

Claude Task Master exposes a REST API and an MCP server that allow external systems to dispatch tasks and receive progress updates. The API follows a simple JSON contract: a POST to /tasks with a goal field creates a new task, and a GET to /tasks/{id} returns the current status. Webhooks can be configured to fire on state changes such as "pr_created" or "ci_failed". This makes it possible to embed the tool in CI pipelines, dashboards, or custom orchestration layers.

Profiles and Isolation

Multiple Claude subscriptions can run in parallel using profiles. A profile stores its own Claude configuration and API keys under ~/.claudetm/profiles/<name>/. This isolation prevents credential clashes and allows teams to test different API keys or Anthropic compatible endpoints simultaneously. The CLI can be invoked with --profile <name> to select a specific profile.

Conclusion

Claude Task Master offers a hands off, PR-based development loop that persists state, handles CI, and merges automatically. It is open source under the MIT license and can be installed via PyPI or Docker. Teams that already use Claude Code can extend their automation by integrating the REST API or webhooks. The tool reduces the manual effort required to move from a goal statement to a merged pull request, especially for large codebases where repeatable patterns are common.

For more details and to contribute, visit the GitHub repository: https://github.com/developerz-ai/claude-task-master

Top comments (0)