A comprehensive integration system that bridges Claude Code's TodoWrite tool with TaskWarrior, providing persistent task management across sessions.
- Persistent Tasks: Tasks survive Claude Code session restarts
- Bidirectional Sync: Import from TaskWarrior, export to TaskWarrior
- Session Management: Organized project-based sessions
- Automatic Backups: Every sync creates timestamped backups
- Priority Mapping: Claude Code priorities (high/medium/low) ↔ TaskWarrior (H/M/L)
- Status Tracking: pending, in_progress, completed status sync
- Multi-Project Support: Organize tasks by project
- Data Validation: Ensures data integrity during sync
- Rich CLI: Full-featured command-line interface
- Global Access: Works from any directory with any Claude Code session
- Tested on: Ubuntu-based Linux systems (Ubuntu, Debian, Pop!_OS, Linux Mint)
- Should work on: Most Linux distributions with bash shell
- Not tested on:
- macOS (may work with modifications to paths and commands)
- Windows WSL (untested but likely compatible)
- Native Windows (requires significant modifications)
Note: The installation instructions use apt package manager. For other systems:
- macOS: Use
brew install task node jq - Fedora/RHEL: Use
dnf install task nodejs jq - Arch: Use
pacman -S task nodejs jq
# Install dependencies
sudo apt install taskwarrior nodejs jq
# Global installation (recommended)
mkdir -p ~/bin
cp -r claude-taskwarrior ~/bin/
chmod +x ~/bin/claude-taskwarrior/claude-tw
chmod +x ~/bin/claude-taskwarrior/sync.js
# Add to PATH
echo 'export PATH="$PATH:$HOME/bin/claude-taskwarrior"' >> ~/.bashrc
source ~/.bashrc# Initialize TaskWarrior
task add "test task"
task 1 delete# Start with default project (works from any directory)
claude-tw start
# Or start with custom project
claude-tw start my-project-nameWhen Claude Code updates todos, sync them to TaskWarrior:
# Example: sync current todos
claude-tw sync '[{"id":"1","content":"Task 1","status":"pending","priority":"high"}]'Import existing TaskWarrior tasks into Claude Code:
# Export tasks for Claude Code import
claude-tw export# Start new session
claude-tw start [project-name]
# Check session status
claude-tw status
# End current session
claude-tw end# Sync Claude Code todos to TaskWarrior
claude-tw sync '<claude-todos-json>'
# Export TaskWarrior tasks for Claude Code
claude-tw export
# Create manual backup
claude-tw backupView your tasks in TaskWarrior:
# List all project tasks
task project:claude-session list
# Show only pending tasks
task project:claude-session status:pending
# Show task summary
task project:claude-session summary
# Mark task complete
task <id> done
# Start working on task
task <id> start[
{
"id": "unique-id",
"content": "Task description",
"status": "pending|in_progress|completed",
"priority": "high|medium|low",
"due": "2024-01-15",
"tags": ["tag1", "tag2"]
}
][
{
"id": "tw-12345678",
"content": "Task description",
"status": "pending",
"priority": "high",
"created": "2024-01-01T10:00:00Z",
"modified": "2024-01-01T10:00:00Z",
"due": "2024-01-15",
"tags": ["tag1", "tag2"]
}
]Configuration file: ~/.claude-taskwarrior.conf
# Default project name
PROJECT=claude-session
# Enable automatic sync
AUTO_SYNC=true
# Backup directory
BACKUP_DIR=/home/user/.claude-taskwarrior-backups
# Creation timestamp
CREATED=2024-01-01T10:00:00Zclaude-taskwarrior/
├── claude-tw # Main CLI script
├── sync.js # Core sync engine
├── README.md # This file
└── examples/ # Usage examples
├── basic-workflow.md
└── advanced-usage.md
- Automatic: Backups created before each sync operation
- Location:
~/.claude-taskwarrior-backups/ - Format:
backup-project-timestamp-operation.json - Manual:
claude-tw backupcreates manual backup
Example backup filename:
backup-claude-session-2024-01-01T10-00-00Z-pre-import.json
The system includes comprehensive error handling:
- Validation: Ensures todo structure integrity
- Graceful Degradation: Continues processing if some tasks fail
- Detailed Logging: Clear error messages with context
- Rollback: Backups enable easy recovery
- Session Start:
claude-tw start - Import Existing: Shows existing TaskWarrior tasks for Claude Code import
- Work in Claude Code: Use TodoWrite as normal
- Sync Changes:
claude-tw sync "$(claude-todos-json)" - Persistent Storage: Tasks persist in TaskWarrior
- Session End:
claude-tw endfor summary
- Export TaskWarrior tasks:
claude-tw export - Copy output to Claude Code:
TodoWrite <exported-json> - Work with todos in Claude Code
- Sync back to TaskWarrior:
claude-tw sync '<claude-json>'
The integration works from any directory and with any Claude Code session:
# Install globally
mkdir -p ~/bin
cp -r claude-taskwarrior ~/bin/
echo 'export PATH="$PATH:$HOME/bin/claude-taskwarrior"' >> ~/.bashrc
source ~/.bashrc
# Now works from anywhere
cd /any/directory
claude-tw start my-project# Test basic functionality
node sync.js import test-project '[{"id":"test","content":"Test task","status":"pending","priority":"medium"}]'
node sync.js export test-project
node sync.js summary test-project
# Test CLI
./claude-tw start test-session
./claude-tw status
./claude-tw endThe sync engine is modular and extensible:
const ClaudeTaskWarriorSync = require('./sync.js');
const sync = new ClaudeTaskWarriorSync();
// Custom usage
const todos = sync.exportTodos('my-project');
sync.importTodos('my-project', customTodos);-
TaskWarrior not initialized
task add "init task" task 1 delete -
Permission denied
chmod +x ~/bin/claude-taskwarrior/claude-tw -
Node.js not found
sudo apt install nodejs npm
-
jq not found
sudo apt install jq
Enable verbose output:
export CLAUDE_TW_DEBUG=1
claude-tw statusSession logs: /tmp/claude-tw-session.json
Error logs: Check terminal output during sync operations
This project is open source. Contributions welcome:
- Fork the repository
- Create feature branch
- Add tests for new functionality
- Submit pull request
MIT License - see LICENSE file for details.
Built for integration with:
- Claude Code - Anthropic's AI coding assistant
- TaskWarrior - Command-line task management