[BUG] claude auth login — copy function copies entire screen instead of URL, wrapped URL breaks OAuth
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When running claude auth login, the OAuth URL is too long for the terminal and
wraps across multiple lines. This causes two problems:
- The "c to copy" function copies the entire terminal screen (including the
"Login" header, instructions, and line-wrapped text with spaces), not just the
URL.
- The line wrapping inserts spaces/newlines into the URL, breaking the
redirect_uri parameter (e.g., code/callback becomes code/ callback) and the
code_challenge value. This causes OAuth to fail with errors like:
- "Redirect URI is not supported by client"
- "Invalid code_challenge_method: missing"
Workaround: Had to manually stitch the URL back together by removing spaces at
each line break, which took multiple attempts since the code_challenge
expires quickly.
Environment: Linux, Claude Code CLI
What Should Happen?
Expected behavior: Pressing c should copy the raw, unwrapped URL to the
clipboard. Ideally the browser should just open automatically, or a
shortened/localhost redirect URL should be used.
Error Messages/Logs
Steps to Reproduce
- Open GNOME Terminal on Ubuntu
- Run claude auth login
- Browser fails to open automatically (or user needs to manually copy the
URL)
- The OAuth URL is ~500 characters and wraps across 3+ lines in the terminal
- Press c when prompted "(c to copy)"
- Paste into browser — the pasted content includes the "Login" header,
instructions text, and the URL with spaces/newlines at each line wrap
- OAuth fails because the URL contains spaces in the redirect_uri and
code_challenge parameters
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.84
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗