Skip to content

Cannot paste OAuth code into auth prompt (bracketed paste not handled) #47745

Description

@tenpast

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions