debug-tasklisted
Install: claude install-skill vmehera123/leashd
# Debugging Autonomous Tasks
## Data sources
| Surface | Location | Content |
|---------|----------|---------|
| Task runs | `~/.leashd/sessions.db` → `task_runs` table | Phase state, outcome, costs, context, pipeline, timestamps (24 columns) |
| Sessions | `~/.leashd/sessions.db` → `sessions` table | `mode`, `task_run_id` link back to task_runs |
| Audit log | `<approved_directories[0]>/.leashd/audit.jsonl` (pinned/centralized) | Tool-gating decisions (allow/deny/require_approval), all sessions |
| App logs | `{working_directory}/.leashd/logs/app.log` | Structured events: `task_phase_changed`, `task_phase_error`, `task_terminal`, etc. |
| Messages | `~/.leashd/messages.db` (centralized) | Agent messages during the task's session |
> **audit.jsonl is centralized, not per-working-directory.** Since v0.9.0 it is *pinned* to `approved_directories[0]` (the first entry in `~/.leashd/config.yaml`) — NOT `{working_directory}/.leashd/audit.jsonl`, which will look stale for any task that ran outside that dir. The audit queries below resolve the pinned path automatically.
`$ARGUMENTS` is the task_id — full 16-char hex or first 8 chars from `/tasks` output.
> Tasks may have run under v2 (LLM-driven think-act-observe, phases include `explore/plan/retry`) or v3 (linear `plan → implement → verify → review`). Check `phase_pipeline` in Step 1 to tell which.
## Quick diagnosis (run all 5 steps)
### Step 1: Load task state
Query `task_runs` by run_id. Try exact match first, then prefix