[Bug] Interactive TUI sessions fail with malformed localhost API endpoint instead of api.anthropic.com
Bug Description
▎ Interactive TUI sessions fail with "Unable to connect to API (ConnectionRefused)", retrying and eventually exhausting all 10 attempts, every time. ANTHROPIC_LOG=debug shows the request is going to http://localhost:20128/v1/v1/messages?beta=true (note the local port and the doubled /v1/v1/ path) instead of https://api.anthropic.com. Non-interactive claude --print from the same shell, same directory, works instantly against the real API. claude daemon status showed the background daemon not running (control.sock: unreachable, ENOENT) with roster.json ~64h stale; manually running claude daemon run brought the control socket up but did not fix the interactive-session failure — nothing listens on port 20128 even with the daemon's control socket reachable, so the 20128 target appears to belong to a separate subsystem (possibly "Remote Control", which /doctor also shows as not connected). Version 2.1.204 on darwin-arm64, npm-global install.
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.204
- Feedback ID: f1c7c53c-01c8-415c-80f6-c008a2b12016
Errors
[]