TodoWrite Sync
CLEO provides bidirectional sync with Claude Code’s built-in TodoWrite tool, enabling seamless workflow between persistent CLEO tasks and ephemeral session tasks.Why Sync?
CLEO (Persistent)
- Full metadata and history
- Survives sessions
- Hierarchies and dependencies
- Verification gates
TodoWrite (Ephemeral)
- Claude Code native
- Session-scoped
- Simplified format
- Immediate visibility
Use CLEO for durable task management, TodoWrite for real-time session tracking.
Sync Workflow
Injecting Tasks
At session start, export CLEO tasks to TodoWrite format:- All Active Tasks
- Focused Task Only
- Preview
Working with TodoWrite
During your Claude Code session, use TodoWrite normally:Extracting Updates
At session end, merge TodoWrite state back to CLEO:Sync Status
Check current sync state:- Last inject timestamp
- Last extract timestamp
- Pending changes count
- Conflict warnings
Handling Conflicts
When CLEO and TodoWrite have conflicting changes:Status Conflicts
Status Conflicts
If TodoWrite marks a task complete but CLEO has it as blocked:
- Default: TodoWrite status wins (more recent)
- Override:
--preserve-cleo-statusto keep CLEO status
Missing Tasks
Missing Tasks
If a CLEO task is missing from TodoWrite:
- Default: Task remains unchanged in CLEO
- Override:
--sync-deletionsto mark as cancelled
New Tasks
New Tasks
If TodoWrite has tasks not in CLEO:
- Default: Tasks are created in CLEO
- Override:
--ignore-newto skip creation
Best Practices
1
Inject at Session Start
Always run
cleo sync --inject before starting work2
Extract Before Ending
Run
cleo sync --extract before cleo session end3
Use Dry-Run First
Preview changes with
--dry-run to avoid surprises4
One Direction at a Time
Don’t inject and extract simultaneously
Session Protocol Integration
The sync workflow integrates with session protocol:Export vs Sync
| Feature | cleo export | cleo sync |
|---|---|---|
| Direction | One-way out | Bidirectional |
| Format | Multiple (CSV, JSON, MD) | TodoWrite only |
| Use case | Backup/reporting | Session integration |
| Preserves | Full metadata | Essential fields |
