What the skill is about
Get reliable trace intelligence from local Codex/Claude logs via agentlens CLI.
When to use the skill
- •User asks for trace analysis, session debugging, tool-call inspection, or event timeline evidence.
- •Need quick aggregate stats before deep dive.
- •Need machine-readable outputs (
--json,--jsonl) for downstream reasoning.
What to do
- •Confirm CLI availability and command surface:
- •
agentlens --help - •If local dev needed:
npm -w apps/cli run dev -- --help - •If
agentlensis missing or conflicting on PATH, use local entrypoint: - •
npm -w apps/cli run dev -- <command...>
- •Start with high-signal summary:
- •
agentlens summary --json - •Optional filters:
- •
agentlens summary --json --agent codex - •
agentlens summary --json --since 24h
- •Find candidate sessions:
- •
agentlens sessions list --json --limit 50 - •Agent filter:
- •
agentlens sessions list --json --agent claude --limit 50 - •Pick
id(orsessionId; both resolve) with relevant time/error/tool profile.
- •Inspect a specific session:
- •
agentlens session <id> --json --events 120 - •Include tool details:
- •
agentlens session <id> --show-tools --events 120 - •Include meta/system records when needed:
- •
agentlens session <id> --json --include-meta --events 200
- •Page raw events for deeper forensics:
- •
agentlens sessions events <id> --jsonl --limit 200 - •Backward pagination:
- •
agentlens sessions events <id> --jsonl --limit 200 --before <next_before> - •Live tail:
- •
agentlens sessions events <id> --jsonl --follow
- •Report findings with evidence:
- •Cite command used.
- •Include concrete IDs/kinds/timestamps/tool names.
- •Separate facts from inference.
Output and interpretation notes
- •Prefer
--json/--jsonlfor LLM consumption; avoid fragile table parsing. - •
summarygives counts and distributions; use for triage only. - •
session/sessions showgives event previews; add--show-toolsfor tool args/results. - •
sessions eventsis best for full timeline extraction and pagination.
Guardrails
- •Read-only default; do not run
agentlens config setunless user asks. - •Do not fabricate missing events; if data absent, say so.
- •If trace IDs are ambiguous, list candidates and disambiguate by updated time/path.