[BUG] --brief mode silently swallows authentication errors (401), showing no output

Resolved 💬 3 comments Opened Mar 19, 2026 by poteat Closed Mar 23, 2026

Environment

  • Claude Code CLI with --brief flag
  • Any authentication method (OAuth)

Bug Description

When running Claude Code with --brief mode and the OAuth token has expired (or any other authentication error occurs), the CLI outputs nothing at all instead of displaying the error. This causes users to repeatedly retry their prompts thinking it's a transient issue, when in reality they need to re-authenticate.

Without --brief, the error is properly shown:

Please run /login · API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token."},"request_id":"req_011CZCUmznbR6ccUSaYECZJA"}

With --brief, there is no output at all.

Steps to Reproduce

  1. Authenticate with Claude Code via OAuth
  2. Wait for the OAuth token to expire (or manually invalidate it)
  3. Run claude --brief "any prompt"
  4. Observe: no output is produced
  5. Run claude "any prompt" (without --brief)
  6. Observe: the authentication error is now visible

Expected Behavior

Even in --brief mode, critical errors like authentication failures (401), rate limits (429), and other API errors should be emitted to stderr so users can diagnose and fix the issue.

Actual Behavior

--brief mode produces no output when authentication fails, making it impossible to diagnose the issue without switching output modes.

Suggested Fix

Ensure that API errors (especially 4xx/5xx responses) are always written to stderr regardless of output mode. The --brief flag should only suppress non-essential output (progress indicators, thinking, intermediate steps), not critical error messages.

Related

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗