[BUG] claude auth login — copy function copies entire screen instead of URL, wrapped URL breaks OAuth

Resolved 💬 3 comments Opened Mar 26, 2026 by JMo8675309 Closed Mar 29, 2026

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:

  1. 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.

  1. 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

  1. Open GNOME Terminal on Ubuntu
  2. Run claude auth login
  3. Browser fails to open automatically (or user needs to manually copy the

URL)

  1. The OAuth URL is ~500 characters and wraps across 3+ lines in the terminal
  2. Press c when prompted "(c to copy)"
  3. Paste into browser — the pasted content includes the "Login" header,

instructions text, and the URL with spaces/newlines at each line wrap

  1. 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_

View original on GitHub ↗

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