Skip to content

v0.40.0 - Actionable Error System (LLM-Agent-First)

Choose a tag to compare

@kryptobaseddev kryptobaseddev released this 29 Dec 05:12
· 7245 commits to main since this release

馃幆 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=1

Errors 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:

  1. Check exit codes
  2. Execute error.fix directly
  3. Choose from error.alternatives based on intent

Full changelog: https://github.com/kryptobaseddev/claude-todo/blob/main/CHANGELOG.md