Loading...
Loading...
Analyze traces of Claude Code sessions. Use this Skill when users mention session IDs in UUID format (composed of numbers and lowercase letters), time clues such as "just now", "today", "last time", troubleshooting Agent behavior reasons, wanting to view the content of a specific Claude Code session, or analyzing trace content.
npx skill4agent add ningzimu/claude-code-lens cclens-trace-analyzercclens tracelist → show → export → Read markdowncclens tracecclens trace --help 2>&1Usage: cclens tracecclens traceUsage: claude [options]cclensnpm install -g claude-code-lenscclens trace --help 2>&1cclens trace-f jsonlead--debugstartedAtcontextstatuscclens trace list -f json| Parameter | Purpose |
|---|---|
| Match sessionId, context, status, agents, or agent names |
| Only return sessions after the specified ISO 8601 timestamp |
| Limit the number of returns (truncate before building summaries; non-positive integers will trigger |
| Truncate summary fields such as context, status, does, outcome (default 120–220 characters) |
cclens trace listsessionIdshowexportstartedAtcontextstatusagentslead + 6 subagentscclens trace show --session <sessionId> -f jsonidexport --agentroleleadsubagentname<type> · <description>doesoutcome| User Intent | Export Target | Matching Method |
|---|---|---|
| Troubleshoot overall process or task orchestration issues | | Directly specify |
| Investigate the behavior or failure cause of a specific subagent | | Match by |
| Compare collaboration between Lead and Subagent | Export | First use |
contextstatuslistshowcclens trace export --session <sessionId> --agent <agentId|lead> -f json| Value | Scope |
|---|---|
| Only the main Agent |
| Specified subagent (id comes from |
cclens trace export --session <sessionId> --agent <id> --out /tmp/cclens-<session>-<agent>.md -f jsonmarkdownPathagent.doesagent.outcome--out~/.claude-code-lens/exports/trace-<first 8 digits of session>-<agentId>.mdReadmarkdownPathdoeserror.codemessage| Error Code | Trigger Condition | Recovery Method |
|---|---|---|
| No sessions captured in | Prompt the user to run CCLens to capture a session first |
| Empty list | | Inform the user: This session was not started via cclens, so trace data cannot be obtained. It is recommended to start Claude Code using cclens in the future |
| The specified | Re-run |
| The specified agent id does not exist in the session | Re-run |
| Markdown writing failed | Retry with |
| Formats other than | Use |
| | Check parameter values and pass a valid positive integer |
sessionIdstartedAtidrolenamedoes--debuglead