Initial Setup
You need Claude Code installed and signed in (runclaude once) and Node.js 22.13 or later. TaskGraph needs no API keys.
- Install the package
- Initialize your project from its folder:
.taskgraph/ and imports TaskGraph’s workflow guide from your project’s CLAUDE.md. Add --mcp to also write a .mcp.json entry for the MCP server.
- (Optional) Use the MCP server. Slash commands and the CLI do everything without it. To drive TaskGraph in plain language, register the server and run
/mcpin Claude Code to check that it is connected:
-
Place your PRD in
.taskgraph/docs/(for example.taskgraph/docs/prd.md). -
Talk to Claude Code (or use the
/taskgraph:slash commands from the plugin or the CLI):
Common Commands
After setting up TaskGraph, you can use these commands via slash commands, AI prompts or the CLI:Initial Task Generation
In Claude Code, instruct the agent to generate tasks from your PRD:- Parse your PRD document
- Generate a structured
tasks.jsonfile with tasks, dependencies, priorities, and test strategies - The agent will understand this process due to the imported
CLAUDE.mdguide
Generate Individual Task Files
Next, ask the agent to generate individual task files:AI-Driven Development Workflow
Claude Code is pre-configured (via the importedCLAUDE.md guide) to follow this workflow:
1. Task Discovery and Selection
Ask the agent to list available tasks:- Run
taskgraph listto see all tasks - Run
taskgraph nextto determine the next task to work on - Run
taskgraph show 1,3,5to display multiple tasks with interactive options - Analyze dependencies to determine which tasks are ready to be worked on
- Prioritize tasks by priority, then by how much work they unblock, then fewer dependencies, then ID order
- Suggest the next task(s) to implement
2. Task Implementation
When implementing a task, the agent will:- Reference the task’s details section for implementation specifics
- Consider dependencies on previous tasks
- Follow the project’s coding standards
- Create appropriate tests based on the task’s testStrategy
2.1. Viewing Multiple Tasks
For efficient context gathering and batch operations:- Run
taskgraph show 5,7,9to display a compact summary table - Show task status, priority, and progress indicators
- Provide an interactive action menu with batch operations
- Allow you to perform group actions like marking multiple tasks as in-progress
3. Task Verification
Before marking a task as complete, verify it according to:- The task’s specified testStrategy
- Any automated tests in the codebase
- Manual verification if required
4. Task Completion
When a task is completed, tell the agent:5. Handling Implementation Drift
If during implementation, you discover that:- The current approach differs significantly from what was planned
- Future tasks need to be modified due to current implementation choices
- New dependencies or requirements have emerged
6. Reorganizing Tasks
If you need to reorganize your task structure:- Moving a standalone task to become a subtask:
--from=5 --to=7 - Moving a subtask to become a standalone task:
--from=5.2 --to=7 - Moving a subtask to a different parent:
--from=5.2 --to=7.3 - Reordering subtasks within the same parent:
--from=5.2 --to=5.4 - Moving a task to a new ID position:
--from=5 --to=25(even if task 25 doesn’t exist yet) - Moving multiple tasks at once:
--from=10,11,12 --to=16,17,18(must have same number of IDs, TaskGraph will look through each position)
- The system automatically creates placeholder tasks for non-existent destination IDs
- This prevents accidental data loss during reorganization
- Any tasks that depend on moved tasks will have their dependencies updated
- When moving a parent task, all its subtasks are automatically moved with it and renumbered
7. Resolving Merge Conflicts with Tasks
When working with a team, you might encounter merge conflicts in your tasks.json file if multiple team members create tasks on different branches. The move command makes resolving these conflicts straightforward:- Keep your teammates’ tasks (10-15)
- Move your tasks to new positions to avoid conflicts:
8. Breaking Down Complex Tasks
For complex tasks that need more granularity:Example Claude Code Interactions
Starting a new project
Working on tasks
Implementing a specific task
Managing subtasks
Handling changes
Completing work
Analyzing complexity
Viewing complexity report
Research-Driven Development
TaskGraph includes a powerful research tool that provides fresh, up-to-date information beyond the AI’s knowledge cutoff. This is particularly valuable for:Getting Current Best Practices
Research with Project Context
Research and Update Pattern
A powerful workflow is to research first, then update tasks with findings:- Run research:
taskgraph research "Node.js performance optimization 2024" --id=12 - Update the task:
taskgraph update-subtask --id=12.2 --prompt="Updated with latest performance findings: [research results]"
When to Use Research
- Before implementing any new technology
- When encountering security-related tasks
- For performance optimization tasks
- When debugging complex issues
- Before making architectural decisions
- When updating dependencies
Git Integration and Tag Management
TaskGraph supports tagged task lists for multi-context development, which is particularly useful when working with git branches or different project phases.Working with Tags
Tags provide isolated task contexts, allowing you to maintain separate task lists for different features, branches, or experiments:Switching Between Contexts
When working on different features or branches:Copying Tasks Between Tags
When you need to duplicate work across contexts:Tag Management
View and manage your tag contexts:Benefits of Tagged Task Lists
- Branch Isolation: Each git branch can have its own task context
- Merge Conflict Prevention: Tasks in different tags don’t interfere with each other
- Parallel Development: Multiple team members can work on separate contexts
- Context Switching: Easily switch between different project phases or features
- Experimentation: Create experimental task lists without affecting main work
Git Workflow Integration
A typical git workflow with TaskGraph tags:- Create feature branch:
git checkout -b feature/user-auth - Create matching tag: Ask the agent to run
taskgraph tags add <name> --from-branch - Work in isolated context: All task operations work within the new tag
- Switch contexts as needed: Use
taskgraph tags use <name>to switch between different work streams - Merge and cleanup: After merging the branch, optionally delete the tag with
taskgraph tags remove <name>

