[BUG] CLI login fails to allow pasting the code from the browser when terminal paste bracketing is enabled
Resolved 💬 35 comments Opened Apr 13, 2026 by MattMcmullanQumulo Closed Apr 14, 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?
CLI login fails to allow pasting the code from the browser when terminal paste bracketing is enabled.
What Should Happen?
You should be able to paste the login code into the login prompt in the CLI.
Error Messages/Logs
Steps to Reproduce
- Install claude code on a linux machine
- Open a command window using a terminal that has paste bracketing enabled by default. iterm2 ships with this enabled by default, as do many others. I experienced this bug first over ssh with the iterm2 mac client ssh'd into linux.
- Launch claude code
- Optional: Try pasting any text into the main chat window and observe that this works as expected
- Run the /login command
- Log in using subscription
- Click the link and follow directions
- Paste login code back into the terminal. Observe that this fails to work.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.105 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
iTerm2
Additional Information
I've used the same terminal setup for a long time. The last time I needed to login to Claude code, this exact workflow was functional.
Mitigation steps: Disable terminal paste bracketing in the terminal's settings.
35 Comments
I am running WSL2 and I cannot paste my code in any longer and its the only way to login via WSL2.
<img width="697" height="308" alt="Image" src="https://github.com/user-attachments/assets/4cd827dd-718a-4a46-a920-22e2d8105229" />
Turning of bracketed paste does not solve the problem on WSL2
bind 'set enable-bracketed-paste off'
Affected by this as well using devcontainer in zed and vscode on MacOS
Also affected by this, v2.1.105, I'm shelled into my Mac Mini and cannot paste the code. However, I can type into the field where the code goes. It's just that Cmd-V does not work. This is new, has never happened.
same same
Installed for the first time and seeing this as well
v2.1.105 on linux mint
Same issue
Hit this earlier tonight. Sadly, going back to 'stable' doesn't work for me via the 'install' opt, it results in a successful paste & login, followed by 401 on actually trying to do anything, leading you back to login.
Same issue for me on MacOS using iTerm2.
I was able to work around it by going Settings > Profiles > Default > Terminal > [uncheck] Terminal may enable paste bracketing
Got same problem!
Can't paste cde
Linux instance-20260326-042220 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64 GNU/Linux
Me too on debian whats going?
Also affected on this
Also affected on this
Same issue on Google Colab's built-in terminal with v2.1.105. Paste works everywhere else but not at the auth code prompt.
same issue when ssh into remote linux machine
Hitting same issue (Windows Terminal into SSH), whats the fix?
I have been facing the issue as well for the last few hours ...
Facing also same issue under Linux Terminal since today
Issue is also in Claude Code v2.1.107
Hit the same issue. Reverting back to 'stable' seems to work for me, and it's just now that I realized 'stable' isn't the default!
Found Workaround:
Workaround – Disable paste bracketing
iTerm2: Preferences → Profiles → Terminal → disable "Enable bracketed paste mode"
<img width="1026" height="667" alt="Image" src="https://github.com/user-attachments/assets/74e83074-98fd-4164-a04e-97cfbc5855a6" />
But dont forget to reactivate it again after auth...
My workaround was using xdotool to "type" the keys into the terminal:
Then I asked Claude to make a cross-platform script to do just that:
Confirming this issue with Termius (SSH client) connecting to a remote Ubuntu server.
Environment:
Problem:
Pasting the OAuth code into the "Paste code here" prompt does nothing. Ctrl+V, Ctrl+Shift+V, right-click paste — none of them work. The code simply doesn't appear in the input field. Previously this worked fine with the same setup.
What didn't work:
printf '\e[?2004l'before launchingclaude(bracket paste disable escape sequence) — paste still brokenWhat worked — tmux send-keys workaround:
/login, select auth method, open the OAuth URL in browser, get the code.This bypasses the broken paste entirely by injecting the text directly into the tmux pane as literal keystrokes. After that, hit Enter in the Claude Code session and login completes successfully.
Note: The
tmux send-keys -lapproach from the cross-platform script shared above also works. The key insight is that tmux'ssend-keys -lsends text as literal input, avoiding whatever paste bracketing issue is causing the problem in the TUI.Ooh.. a relatively simple workaround if you have the older versions still installed.
.local/share/claude/versions/2.1.104
Authenticate, that version still worked. Then /exit and run the current claude. If you don't have an old version installed you can probably get one by installing 'stable' and then this should work with no hoopty paste tricks.
One workaround that worked for me was to sign in via the Claude Desktop app, and later launch the CLI. (Worked with Enterprise SSO)
Also affected by this. Signing in on an older version workaround worked for me, too. Just make sure to go through the whole onboarding process, then
/exit. If you just go through the auth process the next log in will try to take you through it all again.I have a solution that works for me.
WSL workaround when paste is broken during /login
If you're on WSL, have no browser, and can't paste the token, install wslu so WSL can open your Windows browser for
the OAuth flow:
Run these commands in your WSL terminal:
sudo apt update && sudo apt install -y wslu
echo 'export BROWSER=wslview' >> ~/.bashrc
source ~/.bashrc
claude
/login
(On older Ubuntu: sudo add-apt-repository ppa:wslutilities/wslu first.)
The browser will open automatically and the login will complete automatically. Tested on Windows 11 + WSL2 Ubuntu.
This solved my WSL issue, thanks!
2.1.107
2.1.105
The same phenomenon occurred, but
When I reverted to the version using
npm install -g @anthropic-ai/claude-code@2.1.104Ctrl + V
worked.
could also use
^b+:in tmux console where claude code is waiting for the token and typesend-keys "<token>"in there . no need to juggle with sessionsFound a clean fix for this — skip OAuth entirely and use an API key directly.
Wrote up the full story here: https://www.linkedin.com/posts/mazenalhomsie_claudecode-anthropic-windows-activity-7449839647951622144-G5PS?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAABNVF0kBrx6HcZHpDEaiIi3WDLOn2V-Xp_o
??? then you are not using your subscription, but paying extra for each call
I’m seeing the same issue on Claude Code v2.1.107.
In my case:
What’s notable is that paste works everywhere else:
The only place paste fails is the login flow at the
Paste code here if prompted >prompt. The pasted auth code simply does not appear / is not accepted.Because normal paste works in the same terminal session and even in Claude Code itself, this seems specific to the login prompt rather than SSH, the terminal emulator, or the multiplexer. My guess is that it may be related to whatever special handling is used for hidden/masked auth-code input after paste.
Workaround that succeeded for me:
That worked immediately, which also suggests the problem is in paste handling at the login prompt rather than the auth code itself.
When I revert to .104 or older versions, I don't have the /login command. Anyone else have the same problem?
CLI login fails to allow pasting the code from the browser when terminal paste?? any solution
Fixed via
tmux send-keysinjection — for anyone locked out remotely with no keyboard: start Claude in a tmux session, get the auth URL, open it on another device, then have a remote process inject the auth code directly viatmux send-keys -t <session> "<code>" Enter. Completely bypasses the paste issue.Also recommend adding these three lines to
~/.tmux.conf:This lets tmux handle OSC 52 clipboard sequences properly over SSH. Combined with the
send-keysinjection method, you never need to paste during the login flow at all.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.