Skip to content

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

Description

@JMo8675309

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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.
  2. 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)
  4. The OAuth URL is ~500 characters and wraps across 3+ lines in the terminal
  5. Press c when prompted "(c to copy)"
  6. Paste into browser — the pasted content includes the "Login" header,
    instructions text, and the URL with spaces/newlines at each line wrap
  7. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions