claudecodeui icon indicating copy to clipboard operation
claudecodeui copied to clipboard

Add CLI mode for Claude Max/Pro subscription users (v1.13.6)

Open dial481 opened this issue 10 months ago • 13 comments

As of v1.13.6, using Claude Code UI requires an API key. For those of us with Claude Max/Pro subscriptions, there's no way to use our existing subscription auth.

I put together a fix that spawns the actual claude CLI binary instead of the SDK.

Wanted to use this with my Claude Max subscription but couldn't find a way without API keys. Unless I missed something, it looks like the SDK integration requires an API key.

I put together a simple fix that spawns the actual claude CLI binary instead, which uses subscription auth. It works, but I should be upfront about the rough edges:

It's slower than the SDK path - probably the streaming JSON parsing overhead. There's a UI flash bug, the raw JSON stream (session metadata, mcp_servers, model info, etc.) briefly renders in the chat before being replaced by the actual response. Looks like the frontend is showing chunks before parsing them into content messages.

If this is useful to anyone, here's my fork: https://github.com/dial481/claude-code-ui

Key changes:

Added server/claude-cli.js (mirrors the cursor-cli pattern) Toggle with USE_CLAUDE_CLI=true in .env

Related #181

dial481 avatar Jan 15 '26 21:01 dial481

@dial481 I have setup many servers since v 1.1.3.6 and even with the Claude Max subscriptions and haven't noticed any issues.. What is the flow you are following and is there any error that you are getting?

viper151 avatar Jan 16 '26 09:01 viper151

Thanks for the reply!

To clarify I can't figure out how to authenticate at all without an API key.

Looking at the code, server/index.js imports from ./claude.js which uses the Claude Agent SDK (@anthropic-ai/claude-code). The SDK requires ANTHROPIC_API_KEY, I didn't see a way to authorize with Claude Code CLI's subscription-based OAuth.

If you're using API keys, everything works fine. But for those of us wanting to use Claude Max/Pro subscriptions (which work through the actual claude CLI binary), I couldn't figure out how to do.

Are you using API keys or subscription auth? Did I totally misunderstand how this works?

(See PR #208 - didn't this switch from spawning the CLI to using Claude Agent SDK?)

dial481 avatar Jan 16 '26 16:01 dial481

Claude Agent SDK works with claude code installed locally. And by definition claude code can use both Auth and API. Claude Client SDK on the other hand which is not being used on this project, does not use claude code and connects directly to Anthropic's APIs.

If you already have claude code on your local machine and spin up claude code ui, you will not notice that you are not required to login at all as you are already logged in on claude code on your local machine. If you are not then you can go to settings and press the login button. In any case, it is designed to work with your existing claude code installation and cannot be used without it.

If you'd like to avoid all of that, you can also use cloudcli.ai which spin ups instantly an agentic environment with everything ready for you.

If there are no further questions or errors, I'd like to close this issue.

viper151 avatar Jan 21 '26 23:01 viper151

@viper151 I guess the issue is different than I what I thought. I thought that because you were using Claude Agent SDK an API Key was required. I wiped the repo and tried again from scratch. Now I have a different issue, the agent just "thinks" forever and never returns anything. I'll open a separate issue on that if I can't resolve it. Also, the stop button doesn't work.

Image

dial481 avatar Jan 22 '26 10:01 dial481

The shell tab does work. The chat tab does not work (as shown above).

Reopening this because it's not clear to me whether this warrants a new issue or not. I can't get it to work.

I think this may be a bug in Claude Code itself that they have no plans to fix?

• Bug: Chat tab doesn't allocate TTY, causing Claude CLI to hang • Fix needed: Use node-pty or wrap with script command like shell tab does Anthropic Claude CLI:
• Bug: Known issue, reported multiple times since May 2025 • Claude Code Issues: #5925, #9026, #1072, #11898, #404 • Status: Closed as not planned except #1072, #404 which don't seem to have solved the issue.

dial481 avatar Jan 22 '26 12:01 dial481

@dial481 do you see any errors in the backend logs ? Also open developer tools (F12) and search for any error logs in the console or network errors in the websocket. That would help narrow down the issue.

viper151 avatar Jan 22 '26 13:01 viper151

@viper151

The cloudcli command referenced in the log doesn't seem to be installed on my system.

Here's what I see in the log:

[INFO] Running in PRODUCTION mode

═══════════════════════════════════════════════════════════════ Claude Code UI Server - Ready ═══════════════════════════════════════════════════════════════

[INFO] Server URL: http://0.0.0.0:3001 [INFO] Installed at: /home/frank/claudecodeui [TIP] Run "cloudcli status" for full configuration details

The console:

Image

dial481 avatar Jan 22 '26 13:01 dial481

Did you use npm or npx or did you run from dev ?

viper151 avatar Jan 22 '26 13:01 viper151

Trying to run it with npx it doesn't work at all. It loads a blank white page.

cloudcli status is not found on my system.

npx @siteboon/claude-code-ui

════════════════════════════════════════════════════════════ [INFO] App Installation: /home/user/.npm/_npx/844e9b06ba9fb183/node_modules/@siteboon/claude-code-ui [INFO] Database: server/database/auth.db ════════════════════════════════════════════════════════════

No .env file found or error reading it: ENOENT: no such file or directory, open '/home/user/.npm/_npx/844e9b06ba9fb183/node_modules/@siteboon/claude-code-ui/.env' PORT from env: undefined Database initialized successfully Database migrations completed successfully [INFO] Using Claude Agents SDK for Claude integration [INFO] Running in PRODUCTION mode

═══════════════════════════════════════════════════════════════ Claude Code UI Server - Ready ═══════════════════════════════════════════════════════════════

[INFO] Server URL: http://0.0.0.0:3001 [INFO] Installed at: /home/user/.npm/_npx/844e9b06ba9fb183/node_modules/@siteboon/claude-code-ui [TIP] Run "cloudcli status" for full configuration details

Image

dial481 avatar Jan 22 '26 14:01 dial481

@dial481 Ok I think I got the issue. Can you check the new version 1.4.0?

viper151 avatar Jan 26 '26 00:01 viper151

@viper151 did you mean 1.14.0? When I try today I'm seeing 1.15.0.

Running npx @siteboon/claude-code-ui gives me 1.15.0.

It does work now.

I'm not sure how it can be caused merely by the front end but it seems like it "thinks" for an inordinate amount of time before replying even prior to have any real task to accomplish. For example I asked a very simple question with no clear task assigned and it "thought" for 3 minutes. I had to stop it. When I use the stop button Claude doesn't have access to what it was doing (as it would if I interrupted in Claude Code CLI) so it can't give me any insight on what's causing it to get stuck. Some progress but it's still not usable.

dial481 avatar Jan 28 '26 12:01 dial481

Take a look in ~/.claude/projects/ for log files. The session initiated from claudecodeUI should be in there. I'd like the option to start session with --debug so I can get a better understanding when things fail.

stephenfeather avatar Feb 09 '26 01:02 stephenfeather

This issue is marked closed as it seems that it has been resolved.

And @stephenfeather and @dial481 If you’d like to stay in the loop or chat with other contributors, we also have a Discord here: link. Totally optional!

blackmammoth avatar Mar 06 '26 14:03 blackmammoth