Exit Codes
CLEO uses structured exit codes for programmatic error handling. This reference documents all exit codes and their meanings.Quick Reference
- Success
- Errors (1-22)
- Special (100+)
- Context (50+)
| Code | Meaning |
|---|---|
0 | Success |
Error Categories
User Errors (2-6)
E_USAGE (2)
E_USAGE (2)
Cause: Invalid command usage or argumentsExample:Fix: Check command syntax with
cleo <command> --helpE_NOT_FOUND (4)
E_NOT_FOUND (4)
Cause: Requested task or resource doesn’t existExample:Fix: Verify task exists with
cleo exists T999 or cleo listE_VALIDATION (6)
E_VALIDATION (6)
Cause: Business validation failedCommon causes:
- Field too long
- Invalid status transition
- Shell variable not escaped in notes
error.fix in JSON response for specific guidanceHierarchy Errors (10-12)
E_PARENT_NOT_FOUND (10)
E_PARENT_NOT_FOUND (10)
Cause: Specified parent task doesn’t existExample:Fix: Verify parent exists with
cleo exists T999E_DEPTH_EXCEEDED (11)
E_DEPTH_EXCEEDED (11)
Cause: Hierarchy exceeds maximum depth (3 levels)Example:Fix: Restructure hierarchy or use a different parent
E_SIBLING_LIMIT (12)
E_SIBLING_LIMIT (12)
Cause: Too many children under same parentFix: Move task to different parent or increase
hierarchy.maxSiblingsOperation Errors (16-17)
E_HAS_CHILDREN (16)
E_HAS_CHILDREN (16)
Cause: Trying to delete task with childrenExample:Fix: Use
--children cascade or --children orphanE_COMPLETED (17)
E_COMPLETED (17)
Cause: Task already completed, cannot deleteFix: Use
cleo archive instead or cleo reopen firstRecoverable Errors (7, 20-22)
These errors may succeed on retry:| Code | Error | Retry Strategy |
|---|---|---|
7 | E_CONCURRENT | Exponential backoff (100ms, 200ms, 400ms) |
20 | E_NETWORK | Network retry with backoff |
21 | E_TIMEOUT | Increase timeout, retry |
22 | E_LOCKED | Wait for lock release, retry |
Special Codes (100+)
Codes 100+ are not errors - they indicate special conditions.
| Code | Meaning | Example |
|---|---|---|
100 | No data | cleo list --status done returns empty |
101 | Already exists | cleo add "Title" when duplicate |
102 | No change | cleo update T001 --priority high when already high |
JSON Error Response
When an error occurs, JSON output includes:Response Fields
| Field | Description |
|---|---|
error.code | Machine-readable error code |
error.exit | Exit code number |
error.message | Human-readable message |
error.fix | Copy-paste command to resolve |
error.alternatives | Array of alternative actions |
error.context | Additional error context |
