Learn the fundamentals of Claude Task Master with these simple examples.
Add a utility function to calculate the factorial of a number.
cd my-python-project
claudetm start "Add a factorial function to utils/math.py with tests"-
Planning Phase: Claude creates a task list:
- Create or update utils/math.py
- Add factorial function with proper error handling
- Write unit tests in tests/test_math.py
- Run tests to verify
-
Execution Phase: Claude implements each task:
- Writes the function
- Adds comprehensive tests
- Runs pytest to verify
- Creates a PR with descriptive title and summary
-
PR & CI:
- PR is created automatically
- CI runs tests
- PR auto-merges when CI passes (default behavior)
# While it's running
claudetm status
claudetm plan
claudetm logs -n 50Fix a typo in the README file.
claudetm start "Fix typo: change 'installtion' to 'installation' in README.md"- Claude identifies the typo
- Updates the file
- Creates a PR titled "fix: Correct typo in README.md"
- Auto-merges after CI passes
Should complete in 1-2 sessions (under a minute).
Add support for a new environment variable in your config.
claudetm start "Add DATABASE_TIMEOUT env var to config.py with default value of 30 seconds"config.py- adds new variable.env.example- documents the variableREADME.md- updates configuration docs- Tests - verifies the config loading
You started a task and want to check its progress.
# Start a task
claudetm start "Add logging to the API client"
# In another terminal, check status
claudetm statusTask Status
Goal: Add logging to the API client
Status: working
Model: opus
Current Task: 2
Sessions: 3
Run ID: 1234567890
Options:
Auto-merge: True
Max sessions: unlimited
Pause on PR: False
# View the plan
claudetm planTask Plan
- [x] Add logging import to api/client.py
- [ ] Configure logger with appropriate level
- [ ] Add debug logs for request/response
- [ ] Add error logs for failures
- [ ] Update tests to verify logging
- [ ] Create PR
You need to stop the task temporarily.
# Start task
claudetm start "Refactor authentication module"
# Press Ctrl+C to interrupt
^C
# Later, resume
claudetm resume- State is preserved in
.claude-task-master/ - Resume continues from where it left off
- All context and progress is maintained
Task completed successfully and you want to start fresh.
# Check status (should show "success")
claudetm status
# Clean up state
claudetm clean.claude-task-master/goal.txt.claude-task-master/plan.md.claude-task-master/state.json.claude-task-master/progress.md.claude-task-master/context.md
.claude-task-master/logs/(last 10 log files)
Task is stuck or you want to abandon it.
claudetm clean -f # No confirmation promptYou want to see what Claude did.
# Show last 100 lines
claudetm logs
# Show last 50 lines
claudetm logs -n 50
# View full logs
cat .claude-task-master/logs/run-*.txtclaudetm start "Task" && claudetm status# Start with manual review
claudetm start "Task" --no-auto-merge
# Check when PR is ready
claudetm pr-status $(gh pr list --limit 1 --json number -q '.[0].number')
# Manually merge when satisfied
gh pr merge --squash --delete-branch# Stop after 5 sessions to prevent runaway execution
claudetm start "Complex task" --max-sessions 5- Start Simple: Try a typo fix or simple function first
- Watch It Work: Keep
claudetm statusrunning in another terminal - Read the Plan: Use
claudetm planto see what Claude intends to do - Check Logs: If confused,
claudetm logsshows detailed execution - Don't Worry: You can always
claudetm clean -fto start over - Review PRs: Even though it auto-merges, review what gets merged
- Use Git: Everything is in git, you can revert if needed
- Feature Development - Build complete features
- Bug Fixing - Debug and fix issues
- Testing - Add test coverage