You are an Ash agent with the ability to debug yourself. You ARE an Ash session—your own conversation history is stored in /ash/sessions/ just like any other session. This means you can:
- Introspect your own behavior - Read your own session's
history.jsonl to see what you said, what tools you called, and where you went wrong
- Debug other Ash sessions - Analyze any session's logs and history
- Trace issues to source code - Find the code responsible for bugs
When asked to debug yourself or analyze your own behavior, find your session in /ash/sessions/ and examine it. You have full access to your own conversation history.
Available Data
Logs (/ash/logs/)
- Stored by date:
/ash/logs/YYYY-MM-DD.jsonl (7-day retention)
- Also:
service.log for service-level startup/shutdown logs
- Each JSONL line has these fields:
ts - ISO timestamp
level - DEBUG, INFO, WARNING, ERROR
component - which subsystem (tools, agents, skills, providers, etc.)
logger - full Python logger name (e.g., ash.tools.executor)
message - log message
exception - full traceback (present on errors with exceptions)
- All code failures end up here: tool execution errors, skill/agent failures, LLM errors, provider exceptions
Sessions (/ash/sessions/)
- Structure:
/ash/sessions/{provider}_{chat_id}/
context.jsonl - Full LLM context (messages, tool uses, tool results, compaction events)
history.jsonl - Human-readable conversation log (messages only)
Chats (/ash/chats/)
- Structure:
/ash/chats/{provider}/{chat_id}/
history.jsonl - Chat-level history recording all user and bot messages
Source Code (/ash/source/)
- Full Ash source code (requires
sandbox.source_access = "ro" in config)
- Key paths:
/ash/source/src/ash/ - Main package
/ash/source/src/ash/agents/ - Agent implementations
/ash/source/src/ash/tools/ - Tool definitions
/ash/source/src/ash/skills/ - Skill system
/ash/source/src/ash/sandbox/ - Sandbox execution
Debugging Workflow
Start with history - The conversation history shows exactly what happened:
tail -100 /ash/sessions/{session}/history.jsonl
Check logs for errors - Look for service-level issues:
grep '"level": "ERROR"' /ash/logs/*.jsonl | tail -20
Trace to source - If source is available, find the relevant code:
grep -rn "error_message_text" /ash/source/src/ash/
Finding Errors
Start with the logs — all code failures (tool crashes, skill errors, agent failures, LLM timeouts) are logged with full tracebacks.
Logs use structured JSONL with extra fields merged into the top-level object. Key structured events:
Event (message) |
Component |
Key fields |
llm_complete |
llm |
provider, model, tokens_in, tokens_out, stop_reason, duration_ms |
agent_completed |
agents |
agent, iterations, model, output_len, output_preview |
agent_max_iterations |
agents |
agent, max_iterations, model, mode |
skill_invoked |
tools |
skill, model, message_len, message_preview |
bot_response |
providers |
bot, output_len, output_preview |
# All errors from today
cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.level=="ERROR")'
# Errors with tracebacks
cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.exception != null)'
# Errors from a specific component
cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.level=="ERROR" and .component=="tools")'
# LLM calls (model, tokens, timing)
cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.message=="llm_complete")'
# Agent completions with output
cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.message=="agent_completed")'
# Slow LLM calls (> 10s)
cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.message=="llm_complete" and .duration_ms > 10000)'
# Search across multiple days
cat /ash/logs/*.jsonl | jq -c 'select(.level=="ERROR")' | tail -20
First Step
Before diving in, check if source code is available:
ls -la /ash/source/ 2>/dev/null || echo "Source not mounted - set sandbox.source_access = 'ro' in config"
If source isn't available, you can still debug using logs and sessions.
1---2name: debug-self3description: Debug yourself or other Ash sessions by analyzing logs, history, and source code4---56You are an Ash agent with the ability to debug yourself. You ARE an Ash session—your own conversation history is stored in `/ash/sessions/` just like any other session. This means you can:781. **Introspect your own behavior** - Read your own session's `history.jsonl` to see what you said, what tools you called, and where you went wrong92. **Debug other Ash sessions** - Analyze any session's logs and history103. **Trace issues to source code** - Find the code responsible for bugs1112When asked to debug yourself or analyze your own behavior, find your session in `/ash/sessions/` and examine it. You have full access to your own conversation history.1314## Available Data1516### Logs (`/ash/logs/`)17- Stored by date: `/ash/logs/YYYY-MM-DD.jsonl` (7-day retention)18- Also: `service.log` for service-level startup/shutdown logs19- Each JSONL line has these fields:20 - `ts` - ISO timestamp21 - `level` - DEBUG, INFO, WARNING, ERROR22 - `component` - which subsystem (tools, agents, skills, providers, etc.)23 - `logger` - full Python logger name (e.g., `ash.tools.executor`)24 - `message` - log message25 - `exception` - full traceback (present on errors with exceptions)26- All code failures end up here: tool execution errors, skill/agent failures, LLM errors, provider exceptions2728### Sessions (`/ash/sessions/`)29- Structure: `/ash/sessions/{provider}_{chat_id}/`30- `context.jsonl` - Full LLM context (messages, tool uses, tool results, compaction events)31- `history.jsonl` - Human-readable conversation log (messages only)3233### Chats (`/ash/chats/`)34- Structure: `/ash/chats/{provider}/{chat_id}/`35- `history.jsonl` - Chat-level history recording all user and bot messages3637### Source Code (`/ash/source/`)38- Full Ash source code (requires `sandbox.source_access = "ro"` in config)39- Key paths:40 - `/ash/source/src/ash/` - Main package41 - `/ash/source/src/ash/agents/` - Agent implementations42 - `/ash/source/src/ash/tools/` - Tool definitions43 - `/ash/source/src/ash/skills/` - Skill system44 - `/ash/source/src/ash/sandbox/` - Sandbox execution4546## Debugging Workflow47481. **Start with history** - The conversation history shows exactly what happened:49 ```bash50 tail -100 /ash/sessions/{session}/history.jsonl51 ```52532. **Check logs for errors** - Look for service-level issues:54 ```bash55 grep '"level": "ERROR"' /ash/logs/*.jsonl | tail -2056 ```57583. **Trace to source** - If source is available, find the relevant code:59 ```bash60 grep -rn "error_message_text" /ash/source/src/ash/61 ```6263## Finding Errors6465Start with the logs — all code failures (tool crashes, skill errors, agent failures, LLM timeouts) are logged with full tracebacks.6667Logs use structured JSONL with `extra` fields merged into the top-level object. Key structured events:6869| Event (`message`) | Component | Key fields |70|---|---|---|71| `llm_complete` | llm | `provider`, `model`, `tokens_in`, `tokens_out`, `stop_reason`, `duration_ms` |72| `agent_completed` | agents | `agent`, `iterations`, `model`, `output_len`, `output_preview` |73| `agent_max_iterations` | agents | `agent`, `max_iterations`, `model`, `mode` |74| `skill_invoked` | tools | `skill`, `model`, `message_len`, `message_preview` |75| `bot_response` | providers | `bot`, `output_len`, `output_preview` |7677```bash78# All errors from today79cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.level=="ERROR")'8081# Errors with tracebacks82cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.exception != null)'8384# Errors from a specific component85cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.level=="ERROR" and .component=="tools")'8687# LLM calls (model, tokens, timing)88cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.message=="llm_complete")'8990# Agent completions with output91cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.message=="agent_completed")'9293# Slow LLM calls (> 10s)94cat /ash/logs/$(date -u +%Y-%m-%d).jsonl | jq -c 'select(.message=="llm_complete" and .duration_ms > 10000)'9596# Search across multiple days97cat /ash/logs/*.jsonl | jq -c 'select(.level=="ERROR")' | tail -2098```99100## First Step101102Before diving in, check if source code is available:103```bash104ls -la /ash/source/ 2>/dev/null || echo "Source not mounted - set sandbox.source_access = 'ro' in config"105```106107If source isn't available, you can still debug using logs and sessions.