← Hacker News

Claude Code's OAuth Flow Broken When Pasting

Hacker News · rynn · April 14, 2026

Detailed Analysis

Claude Code's OAuth authentication flow has become a persistent source of friction for developers, with a deceptively simple root cause at the center of many reported failures: invisible line breaks introduced when terminal output wraps across lines. When users copy the authorization code generated during the OAuth process, the terminal's line-wrapping behavior embeds hidden characters into the clipboard content. Pasting that corrupted string back into the terminal then causes authentication to fail silently or with cryptic errors. A widely circulated workaround involves routing the copied code through a text-cleaning tool — such as Claude Desktop — to strip the extraneous whitespace and line-break characters before re-pasting into the terminal, allowing the flow to complete successfully.

Beyond the line-break issue, several other failure vectors have been identified by users and documented across GitHub issue threads. Model selection has emerged as a surprisingly impactful variable: using a model with a 1M token context window — rather than options like Sonnet 4.6 or Opus 4.6, which cap at 200k tokens — has been observed to break the OAuth flow in certain tooling environments, including the third-party client OpenClaw. Windows users face an additional complication in the form of a terminal prompt that hangs indefinitely after browser-based authorization completes, with the cursor stalling on the "Paste code here if prompted >" line. Separately, remote MCP (Model Context Protocol) configurations with incorrect endpoint settings — such as specifying a localhost address in a remote environment — can cause the CLI to freeze entirely on launch.

The more consequential development underlying these technical issues is Anthropic's apparent move to sunset OAuth support for third-party applications. Reports indicate that Anthropic has begun revoking OAuth refresh tokens and flagging accounts attempting to re-authenticate through third-party OAuth flows, even when direct access via claude.ai remains functional. Evidence cited in community discussions points to GitHub commits and what some users describe as legal communications confirming this directional shift. The practical implication is that even users who successfully troubleshoot the immediate pasting or configuration problems may find that OAuth-based authentication becomes unavailable as a durable solution.

This situation reflects a broader tension in the AI developer tooling ecosystem between the rapid proliferation of third-party integrations and the control that AI providers seek to maintain over API access and authentication pathways. Anthropic's movement toward restricting OAuth for third-party apps aligns with an industrywide pattern of tightening access governance as AI tools move from experimental to commercially critical infrastructure. For developers who have built workflows around Claude Code's OAuth flow — particularly those using community clients or orchestration layers like OpenClaw — the recommended migration path toward manual API keys or officially sanctioned authentication methods represents a meaningful disruption. The frequency and variety of these OAuth failure reports on GitHub also underscore how authentication edge cases, often treated as secondary concerns during product development, become acute pain points at scale when developer tooling reaches a broad and technically diverse user base.

Read original article →