v0.40.0 - Actionable Error System (LLM-Agent-First)
馃幆 Actionable Error System
Errors now include executable recovery commands that LLM agents can directly execute.
New Error Fields
| Field | Description |
|---|---|
error.fix |
Primary recovery command (copy-paste ready) |
error.alternatives |
Array of {action, command} options |
error.context |
Structured error data for decision-making |
Example Error Output
{
"error": {
"code": "E_DEPTH_EXCEEDED",
"message": "Cannot add child to T550: max depth exceeded",
"fix": "ct add 'My Task' --type task",
"alternatives": [
{"action": "Create as standalone", "command": "ct add 'My Task' --type task"},
{"action": "Add to grandparent", "command": "ct add 'My Task' --parent T545"}
],
"context": {"parentId": "T550", "parentType": "subtask", "parentDepth": 2}
}
}Compact JSON for Agents
Set CLEO_AGENT_MODE=1 for single-line JSON output (prevents "+N lines" truncation):
export CLEO_AGENT_MODE=1Errors with Actionable Fixes
E_DEPTH_EXCEEDED(exit 11)E_SIBLING_LIMIT(exit 12)E_PARENT_NOT_FOUND(exit 10)E_INVALID_PARENT_TYPE(exit 13)
Updated Agent Instructions
The CLAUDE.md injection now includes a CRITICAL: Error Handling section at the top, instructing agents to:
- Check exit codes
- Execute
error.fixdirectly - Choose from
error.alternativesbased on intent
Full changelog: https://github.com/kryptobaseddev/claude-todo/blob/main/CHANGELOG.md