claude-code - 💡(How to fix) Fix Cannot paste OAuth code into auth prompt (bracketed paste not handled) [19 comments, 17 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47745Fetched 2026-04-15 06:43:28
View on GitHub
Comments
19
Participants
17
Timeline
33
Reactions
17

Error Message

Actual: Nothing appears. No error, no text. The prompt remains empty as if no paste occurred.

Fix Action

Fix / Workaround

Workarounds found:

  1. Authenticate on another machine and copy ~/.claude/.credentials.json to the target machine
  2. Pipe the code: echo 'CODE' | claude auth login (accepts the code via stdin)
RAW_BUFFERClick to expand / collapse

Bug: Cannot paste OAuth code into Claude Code auth prompt

Environment:

  • Claude Code CLI (latest as of 2026-04-14)
  • Tested on: Kitty 0.46.2, Emacs Eat terminal
  • OS: Arch Linux x86_64, kernel 6.19.10, i3wm, X11

What happened:

Claude Code was working fine ~8 hours ago. Went to sleep, did not update the system (no pacman upgrades overnight, verified via /var/log/pacman.log). Woke up, reconnected to an SSH server (office-jump) where a Claude Code session needed re-authentication. Could not paste the OAuth code into the Eat terminal auth prompt. Switched to a Kitty terminal and tried middle-mouse-button paste -- also failed. Typing characters works fine at the same prompt; only paste is broken.

This was working earlier the same day with the same setup.

Steps to reproduce:

  1. Run claude or claude auth login when authentication is needed
  2. Browser opens, authenticate, copy the OAuth code
  3. Return to terminal, attempt to paste the code (Ctrl+Shift+V in Kitty, or middle-click for X11 primary selection, or C-y / M-x clipboard-yank in Emacs Eat)

Expected: Code is pasted into the prompt

Actual: Nothing appears. No error, no text. The prompt remains empty as if no paste occurred.

Verification that clipboard works:

  • xclip -selection clipboard -o returns the correct OAuth code
  • xclip -selection primary -o also returns the code
  • Paste works normally in every other application and prompt
  • Only the Claude Code OAuth input prompt is affected

Details:

  • Typing the code character by character WORKS at the same prompt
  • Tested in two independent terminal emulators (Kitty 0.46.2 and Emacs Eat) -- same failure in both
  • No system updates between working and broken states
  • The Claude Code process itself was restarted (new session, not a stale process)

Likely cause: The OAuth code input prompt may not handle bracketed paste mode. Modern terminals wrap pasted content in ESC[200~ / ESC[201~ escape sequences. If the prompt reads stdin in raw mode without interpreting these sequences, the pasted text is silently dropped while typed characters pass through fine.

Workarounds found:

  1. Authenticate on another machine and copy ~/.claude/.credentials.json to the target machine
  2. Pipe the code: echo 'CODE' | claude auth login (accepts the code via stdin)

extent analysis

TL;DR

The most likely fix is to modify the Claude Code OAuth input prompt to handle bracketed paste mode, which wraps pasted content in escape sequences.

Guidance

  • Verify that the issue is indeed related to bracketed paste mode by checking the terminal emulator settings and the Claude Code source code for any mentions of this feature.
  • Test the workarounds provided, such as authenticating on another machine and copying the ~/.claude/.credentials.json file or piping the code via echo 'CODE' | claude auth login, to confirm they resolve the issue.
  • Investigate the Claude Code source code to determine how it reads stdin and handles escape sequences, and consider modifying it to interpret the bracketed paste mode sequences correctly.
  • Check the terminal emulator documentation to see if there are any settings or configurations that can be changed to disable bracketed paste mode or modify its behavior.

Example

No code snippet is provided as the issue does not explicitly mention any specific code that needs to be modified.

Notes

The issue seems to be specific to the Claude Code OAuth input prompt and its handling of bracketed paste mode. The workarounds provided suggest that the issue is not related to the system or terminal emulator configuration, but rather the Claude Code implementation.

Recommendation

Apply the workaround of piping the code via echo 'CODE' | claude auth login until a fix is implemented in the Claude Code source code to handle bracketed paste mode correctly. This reason is that the workaround is a simple and effective solution that allows users to authenticate without modifying their system or terminal emulator configuration.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING