Cannot paste OAuth code into auth prompt (bracketed paste not handled)
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:
- Run
claudeorclaude auth loginwhen authentication is needed - Browser opens, authenticate, copy the OAuth code
- 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 -oreturns the correct OAuth codexclip -selection primary -oalso 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:
- Authenticate on another machine and copy
~/.claude/.credentials.jsonto the target machine - Pipe the code:
echo 'CODE' | claude auth login(accepts the code via stdin)
20 Comments
<img width="571" height="153" alt="Image" src="https://github.com/user-attachments/assets/4ac07b51-bbb4-4dea-96fe-d5718d46d971" />
Same here, I cannot paste the OAuth code. Yesterday it was working fine.
Same here
same here, happy am not the only one
Same issue
Claude Code v2.1.107
OSX: 14.7
same 2.1.105
running on bash with rocky 9.7 linux through ssh tunnel from windows terminal.
Trick is to connect on a device that have the access to a browser and then copy credentials.json into the one that can't connect
You can even ask Claude to do it for you if you have access through ssh
Same issue. Also inserting code by hand it fails (but I could have make some error.)
Window 11. Different ssh client (Putty, ssh on mingw, OS provided ssh)
Another workaround from https://github.com/anthropics/claude-code/issues/47811#issuecomment-4242525867 to downgrade from version 2.1.107 to 2.1.104.
I've tried this command:
And it works!
Yeahhh meanwhile I'm waiting for the fix on the latest version.
Open powershell then:
pip install pynputCreate a python script called auto_typer.py and save it in C:\
If you want a .bat file on your desktop to run it:
@echo offpython C:\auto_typer.py
ssh via powershell into the box without the browser window and get the request link, run auto typer to type the reply code back in, voila.
same here, makes it completely unusable in my setup. I did not find any workaround, and can not use claude code on remote GPUs right now.
Revert to 2.1.107 (Claude Code) until fixed.
If paste does not work in Claude Code login under WSL, this is quick
tmuxworkaround. It should also work over SSH, as long as both terminals are connected to the same host and user :)Terminal 1
Terminal 2
EnterEnteragainThis sends the token/code into the active Claude session through
tmux, so you do not need to type it manually.Update: The last two login attempts on the same machine completed automatically — the OAuth flow redirected back to the CLI without requiring manual code paste. This is a behavior change from earlier sessions where the code always had to be pasted manually.
I don't know whether this means:
Leaving this open in case someone else encounters the manual-code-paste flow and hits the same problem. The bracketed paste hypothesis (ESC[200~/ESC[201~ sequences being silently dropped) was never confirmed or denied — the symptom just stopped occurring because the flow changed.
The workarounds in the original report (copy .credentials.json, or pipe via stdin) remain valid if anyone needs them.
any work around for this if we are working strictly in a vscode dev container (i.e dont have claude code installed outside that container on the windows host).
Cannot paste OAuth code into the "Paste code here if prompted >" prompt. Ctrl+Shift+V does nothing — the prompt silently swallows the paste. Typing individual characters works fine. This was working earlier today.
Duplicate of https://github.com/anthropics/claude-code/issues/47699
Same here, windows 11 docker sandbox
100% a problem with versions 2.1.105 and up, 2.1.104 works fine.
Duplicate of #47669 — same bug: paste into the
/login"Paste code here" prompt is silently rejected (likely bracketed-paste handling). Closing in favor of that issue; please subscribe there for updates.This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.