debug-leashdlisted
Install: claude install-skill vmehera123/leashd
# Debugging leashd
leashd uses **two-tier storage**:
- **Session store** — `{leashd_root}/.leashd/sessions.db` (fixed, never switches). Tracks user→directory mapping, session IDs, costs.
- **Per-project store** — `{project}/.leashd/messages.db` (switches with `/dir`). Stores messages and conversation history.
- **Audit log** — `{project}/.leashd/audit.jsonl` (per-project)
- **App logs** — `{project}/.leashd/logs/app.log` (per-project)
The leashd root is the directory containing the `leashd/` package (i.e., the repo root).
## First: Determine which project to inspect
If the user provides a project directory as an argument, use that. Otherwise, ask:
1. Check the session store to find which directories have active sessions:
```bash
uv run python -c "
import sqlite3, pathlib
db = pathlib.Path('__file__').resolve().parent.parent / '.leashd' / 'sessions.db'
# Fallback: try common locations
for candidate in [db, pathlib.Path('.leashd/sessions.db')]:
if candidate.exists():
conn = sqlite3.connect(str(candidate))
conn.row_factory = sqlite3.Row
for r in conn.execute('SELECT user_id, chat_id, working_directory, last_used, is_active FROM sessions ORDER BY last_used DESC LIMIT 10'):
print(dict(r))
break
else:
print('No sessions.db found')
"
```
2. Use the `working_directory` from the session to locate per-project files.
## 1. SQLite Session Store (`sessions.db`)
Fixed at `{leashd_root}/.leashd/sessions.db`. Default storage backen