Skip to main content

Session Logs

AgentUse automatically tracks every agent execution with detailed logs, providing full visibility into what happened during each run.

Quick Start

# List recent sessions
agentuse sessions

# View session details (partial ID match supported)
agentuse sessions 01JFN8

# Show full tool inputs/outputs
agentuse sessions 01JFN8 --full

# Export as JSON
agentuse sessions 01JFN8 --json

What Gets Tracked

Each session captures:
CategoryData
SessionAgent name, model, MCP servers, project context, timestamps
MessagesUser prompts, system prompts, token usage, cost, duration
PartsText output, tool calls, reasoning, step boundaries
ToolsTool name, input, output, duration, errors

CLI Reference

List Sessions

agentuse sessions [options]
agentuse sessions list [options]
agentuse sessions ls [options]
Options:
  • -a, --all - Include subagent sessions
  • -n, --limit <n> - Limit results (default: 10)
  • -j, --json - Output as JSON
Example output:
ID            AGENT                 MODEL                 DATE
----------------------------------------------------------
01JFN8K3M2P1  daily-reporter        claude-sonnet-4       Today 14:32
01JFN7XYZAB  seo-analyzer          gpt-5                 Yesterday 09:15
01JFN6DEFGH  code-reviewer         claude-sonnet-4       Mon 16:45

Show Session Details

agentuse sessions <id>
agentuse sessions show <id> [options]
Options:
  • -f, --full - Show complete tool input/output (not truncated)
  • -j, --json - Output as JSON
Example output:
════════════════════════════════════════════════════════════
SESSION: 01JFN8K3M2P1NRXZW4Y5V6Q7B8
════════════════════════════════════════════════════════════

Agent:       daily-reporter
Description: Generate daily motivation quotes
Model:       anthropic:claude-sonnet-4-5
Started:     12/21/2025, 2:32:45 PM
MCP Servers: postgres

Project:     /Users/you/project
Working Dir: /Users/you/project

────────────────────────────────────────────────────────────
Task: Generate a daily motivation quote with an interesting fact
Tokens: 1523 (in: 892, out: 631)  Duration: 3.2s
Parts: text: 2, tool: 3

Output:
Here's today's motivation quote...

─── ✓ Postgres{query} (SELECT * FROM quotes...) 0.8s ────────
{"rows": [{"id": 1, "quote": "..."}]}
────────────────────────────────────────────────────────────

Generated your daily quote successfully!

Show Storage Path

agentuse sessions path
Shows where session data is stored for the current project.

Subagent Sessions

Use --all flag to include subagent sessions in listings:
agentuse sessions --all

Use Cases

Debugging Failed Runs

# Find recent failed session
agentuse sessions | grep -i error

# View full details with complete tool outputs
agentuse sessions 01JFN8 --full

Cost Tracking

# Export sessions as JSON for analysis
agentuse sessions --json > sessions.json

# Query costs with jq
cat sessions.json | jq '.[].cost'

Audit Logging

Session logs provide a complete audit trail:
  • What prompts were sent
  • Which tools were called with what inputs
  • What outputs were generated
  • Token usage and costs
  • Error details and stack traces