{"record":{"id":"9766bb5e1b9c35db","repo":"chenhg5/cc-connect","slug":"claudecode-claude-code-exited-before-usage-rende","errorCode":null,"errorMessage":"claudecode: Claude Code exited before /usage rendered: %w","messagePattern":"claudecode: Claude Code exited before /usage rendered: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/claudecode/claude_usage.go","lineNumber":173,"sourceCode":"\t\t\t\treturn usageScreen, nil\n\t\t\t}\n\t\t\tif screenErr := detectClaudeUsageOutputError(lastScreen, stderr.String()); screenErr != nil {\n\t\t\t\treturn \"\", screenErr\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"claudecode: timed out waiting for Claude Code /usage panel: %w\", probeCtx.Err())\n\t\tcase err := <-readDone:\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"claudecode: read Claude Code /usage output: %w\", err)\n\t\t\t}\n\t\tcase <-processDone:\n\t\t\tif usageScreen != \"\" {\n\t\t\t\treturn usageScreen, nil\n\t\t\t}\n\t\t\tif screenErr := detectClaudeUsageOutputError(lastScreen, stderr.String()); screenErr != nil {\n\t\t\t\treturn \"\", screenErr\n\t\t\t}\n\t\t\tif waitErr != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"claudecode: Claude Code exited before /usage rendered: %w\", waitErr)\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"claudecode: Claude Code exited before /usage rendered\")\n\t\tcase <-ticker.C:\n\t\t\tscreen := normalizeClaudeUsageText(terminal.String())\n\t\t\tif screen != lastScreen {\n\t\t\t\tlastScreen = screen\n\t\t\t\tlastChange = time.Now()\n\t\t\t}\n\t\t\tif usageReady(lastScreen) {\n\t\t\t\tif usageScreen == \"\" {\n\t\t\t\t\tusageScreen = lastScreen\n\t\t\t\t}\n\t\t\t}\n\t\t\tif screenErr := detectClaudeUsageOutputError(lastScreen, stderr.String()); screenErr != nil {\n\t\t\t\treturn \"\", screenErr\n\t\t\t}\n\t\t\tif usageScreen != \"\" && time.Since(lastChange) >= claudeUsageStableFor {\n\t\t\t\treturn usageScreen, nil","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/claudecode/claude_usage.go#L155-L191","documentation":"Raised by the /usage probe when the Claude Code process exits (cmd.Wait returns) before a usable usage screen was captured, and the exit produced a non-zero status. The wrapped error is the process's exit error; no recognized error-screen pattern matched first.","triggerScenarios":"Thrown at agent/claudecode/claude_usage.go:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run claude manually to see why it exits early","Check authentication and network connectivity for the Claude CLI","Update Claude Code to the latest version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}