Bug
When running claude login in a narrow terminal (common when SSH'd into a remote server), the OAuth URL wraps with hard line breaks. When the user copies the URL — either manually or via the c to copy prompt — the line breaks are included, splitting parameter names like redirect_uri and code_challenge across lines. The OAuth server then rejects the request with errors like:
Missing redirect_uri parameter
Missing code_challenge parameter
Repro
- SSH into a remote server with a typical ~80-column terminal
- Run
claude login
- The generated URL is ~500+ characters and wraps across 3-4 lines
- Copy the URL (manually or via
c prompt) and paste into browser
- OAuth fails because parameter names are broken by newlines
Why c to copy doesn't help over SSH
Over SSH there's no access to the local machine's clipboard, so the c shortcut either doesn't work or copies with the line breaks intact.
Suggested fixes
- Write the URL to a temp file and tell the user to
cat or open it (this is what we did as a workaround and it worked immediately)
- Detect narrow terminals and automatically write the URL to a file
- Use a short-lived redirect/URL shortener for the auth URL
- At minimum, warn the user if the terminal width is too narrow for the URL
Environment
- Claude Code v2.1.76
- SSH session to Ubuntu server
- Terminal width ~80-120 columns
- macOS client -> Ubuntu remote
🤖 Generated with Claude Code
Bug
When running
claude loginin a narrow terminal (common when SSH'd into a remote server), the OAuth URL wraps with hard line breaks. When the user copies the URL — either manually or via thecto copy prompt — the line breaks are included, splitting parameter names likeredirect_uriandcode_challengeacross lines. The OAuth server then rejects the request with errors like:Missing redirect_uri parameterMissing code_challenge parameterRepro
claude logincprompt) and paste into browserWhy
cto copy doesn't help over SSHOver SSH there's no access to the local machine's clipboard, so the
cshortcut either doesn't work or copies with the line breaks intact.Suggested fixes
catoropenit (this is what we did as a workaround and it worked immediately)Environment
🤖 Generated with Claude Code