Claude Code. Any Model. The most powerful AI coding agent now speaks every language.
description: Analyze claudish debug logs from a failed model run. Extracts SSE fixtures, diagnoses failures, adds regression tests.
Analyze the claudish debug log at: $ARGUMENTS
Step 1: Read and analyze the log file
Read the log file. Look for these patterns:
[SSE:openai] {...}— raw OpenAI-format SSE events from the provider[SSE:anthropic] {...}— raw Anthropic-format SSE events from the provider[Streaming] Text chunk:— parsed text content (OpenAI path)[Streaming] Chunk: content=N chars, finish_reason=— chunk metadata[Streaming] Received N structured tool call(s)— tool calls[AnthropicSSE] Text chunk:— parsed text content (Anthropic path)[AnthropicSSE] Stream complete for— stream summaryHANDLER STARTED for— API turn boundariesCalling API:— provider endpoint callsResponse status:— HTTP status codes[Fallback]— provider fallback chain eventsError/error— any errors
Step 2: Produce a diagnosis report
Summarize what happened:
- Model & Provider: Which model, which provider(s) handled it, any fallback chain
- API turns: How many turns, which succeeded/failed (HTTP status)
- Text content: How many text chunks, total characters, did text reach output?
- Tool calls: How many, which tools, did finish_reason=tool_calls occur?
- Stop reason: What was the final stop_reason? (end_turn vs tool_use vs unexpected)
- Root cause hypothesis: Based on the patterns, what went wrong?
Step 3: Extract SSE fixtures
If the log contains [SSE:openai] or [SSE:anthropic] lines:
- Run the extractor:
bun run packages/cli/src/test-fixtures/extract-sse-from-log.ts <log-path> - Report which fixture files were created
- Show a summary of each fixture (event count, text chunks, tool calls)
If the log does NOT contain raw SSE lines (older claudish version without [SSE:*] logging):
- Report that raw SSE logging is not available
- Still provide the diagnosis from Step 2 using the parsed
[Streaming]lines - Suggest re-running with
claudish v5.13.2+which includes raw SSE capture
Step 4: Add regression test
If fixtures were extracted, add a new describe() block to packages/cli/src/format-translation.test.ts for this specific failure. Use the template at the bottom of that file. The test should assert what SHOULD work (e.g., text content > 0 bytes, correct stop_reason).
Step 5: Run tests
Run bun test packages/cli/src/format-translation.test.ts to see if the new regression test passes or fails. Report the result.
If it fails — that's the regression test capturing the bug. Propose a fix in the relevant parser or adapter. If it passes — the issue may be upstream (Claude Code behavior, not claudish translation).