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

Resolved 💬 20 comments Opened Apr 14, 2026 by tenpast Closed Apr 15, 2026
💡 Likely answer: A maintainer (mhegazy, contributor) responded on this thread — see the highlighted reply below.

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)

View original on GitHub ↗

20 Comments

itsgitz · 3 months ago

<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.

kkeil91 · 3 months ago

Same here

depinspirationhub · 3 months ago

same here, happy am not the only one

tobyhede · 3 months ago

Same issue
Claude Code v2.1.107
OSX: 14.7

Thunderwagon · 3 months ago

same 2.1.105
running on bash with rocky 9.7 linux through ssh tunnel from windows terminal.

mickaeldanslenowhere · 3 months ago

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

bignand · 3 months ago

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)

itsgitz · 3 months ago

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:

curl -fsSL https://claude.ai/install.sh | bash -s 2.1.104

And it works!

Yeahhh meanwhile I'm waiting for the fix on the latest version.

dataforge-dev · 3 months ago

Open powershell then:
pip install pynput

Create a python script called auto_typer.py and save it in C:\

import tkinter as tk
import threading
import time
from pynput.keyboard import Controller

keyboard = Controller()


def start_typing():
    text = text_box.get("1.0", "end-1c")
    if not text:
        status_var.set("Nothing to type.")
        return

    go_btn.config(state="disabled")

    def run():
        for i in range(3, 0, -1):
            root.after(0, lambda i=i: status_var.set(f"Typing in {i}..."))
            time.sleep(1)
        root.after(0, lambda: status_var.set("Typing..."))
        keyboard.type(text)
        root.after(0, lambda: status_var.set("Done!"))
        root.after(0, lambda: go_btn.config(state="normal"))

    threading.Thread(target=run, daemon=True).start()


root = tk.Tk()
root.title("Auto Typer")
root.resizable(False, False)

frame = tk.Frame(root, padx=12, pady=12)
frame.pack(fill="both", expand=True)

tk.Label(frame, text="Paste your string below:").pack(anchor="w")

text_box = tk.Text(frame, width=60, height=5, wrap="word", font=("Consolas", 10))
text_box.pack(pady=(4, 8))

go_btn = tk.Button(frame, text="Go", width=12, command=start_typing, bg="#4CAF50", fg="white", font=("Arial", 11, "bold"))
go_btn.pack()

status_var = tk.StringVar(value="Paste a string and click Go.")
tk.Label(frame, textvariable=status_var, fg="gray").pack(pady=(8, 0))

root.mainloop()

If you want a .bat file on your desktop to run it:
@echo off
python 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.

wusche1 · 3 months ago

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.

jonyskids · 3 months ago

Revert to 2.1.107 (Claude Code) until fixed.

lesisty7 · 3 months ago

If paste does not work in Claude Code login under WSL, this is quick tmux workaround. It should also work over SSH, as long as both terminals are connected to the same host and user :)

# Install tmux
sudo apt-get update && sudo apt-get install -y tmux

Terminal 1

tmux new -s claude-login
claude
/login
  • Copy the login URL from Claude
  • Open it in your browser
  • Generate the login token/code

Terminal 2

read -s MYTOKEN && tmux set-buffer -t claude-login "$MYTOKEN" && tmux paste-buffer -t claude-login && tmux send-keys -t claude-login Enter && tmux set-buffer -t claude-login '' && unset MYTOKEN
  • Paste the command above and press Enter
  • Paste the token/code now
  • The input is invisible
  • Press Enter again

This sends the token/code into the active Claude session through tmux, so you do not need to type it manually.

tenpast · 3 months ago

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:

  1. The underlying paste issue was fixed in a recent Claude Code update, or
  2. The auth flow itself changed to use automatic redirect instead of manual code entry, sidestepping the paste issue entirely

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.

msingh0101 · 3 months ago

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).

polhel · 3 months ago

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.

mhegazy contributor · 3 months ago
msdrx · 3 months ago

Same here, windows 11 docker sandbox

Thunderwagon · 3 months ago

100% a problem with versions 2.1.105 and up, 2.1.104 works fine.

ashwin-ant collaborator · 3 months ago

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.

github-actions[bot] · 2 months ago

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.