Skip to content

Claude CLI auth: browser not launching, OAuth flow hangs #106

@bbsngg

Description

@bbsngg

Parent Issue

Spun off from #32

Problem

When authenticating Claude CLI via dr-claw, the CLI runs inside a server-side PTY where browser launch fails silently. The CLI shows a "Paste code here" prompt but the OAuth URL is not reliably detected or forwarded to the user's browser.

Partially fixed: 0a85acd resolved Windows CLI detection, but the browser/OAuth flow issue remains.

Expected

The auth URL should be automatically detected and opened in the user's browser via the frontend.

Suggested Fix

  1. Frontend (src/components/Shell.jsx): When receiving auth_url with autoOpen=true, auto-call openAuthUrlInBrowser()
  2. Server (server/index.js): Add Claude CLI-specific URL detection patterns (e.g., paste code here, visit this url) to shouldAutoOpenUrlFromOutput
  3. Server: Set BROWSER=none in embedded shell env to force CLI to print URL as text instead of attempting browser launch

Key Files

  • src/components/Shell.jsx (lines 217-221)
  • server/index.js (lines 370-378, buildEmbeddedShellEnv)

Priority

P1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions