#Change anthropic to claude-cli

1 messages · Page 1 of 1 (latest)

rare scroll
#

I changed anthropic to claude-cli/claude-sonnet-5-6 and i'm having the same error all the time:

⚠️ Something went wrong while processing your request. Please try again, or use /new to start a fresh session.

With model status send this:

Current: claude-cli/claude-sonnet-4-6
Default: claude-cli/claude-sonnet-4-6
Agent: main
Auth file: ~.openclaw\agents\main\agent\auth-profiles.json

[anthropic] endpoint: default auth: anthropic:default=token:sk-ant-o...3EjGPwAA (next, lastGood) (auth-profiles.json: ~.openclaw\agents\main\agent\auth-profiles.json)
• anthropic/claude-sonnet-4-6 (sonnet)

[claude-cli] endpoint: default auth: missing
• claude-cli/claude-sonnet-4-6

Windows 10 install

lone basinBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

lament mesaBOT
#

Yep — your status output already points to the likely issue:

  • your session is still on claude-cli/claude-sonnet-4-6 (not ...5-6)
  • and claude-cli shows auth: missing
  • so OpenClaw is trying the CLI backend, but that backend isn’t ready on your machine

On Windows this is usually one of:

  1. Claude CLI not logged in
  2. claude not visible to the Gateway service PATH

Please run these and paste output:

openclaw --version
where claude
claude auth login
#
claude -p "say hi"
openclaw models status

Then make sure OpenClaw uses the full Claude CLI path in config (%USERPROFILE%\.openclaw\openclaw.json), e.g.:

{
agents: {
defaults: {
cliBackends: {
"claude-cli": {
command: "C:\\Users\\<you>\\AppData\\Roaming\\npm\\claude.cmd"
}
}
#
}
}
}

Restart gateway after editing:

openclaw gateway restart

If it still errors, run once in foreground to capture the real backend error:

openclaw gateway --claude-cli-logs --verbose
rare scroll
#

OpenClaw 2026.4.2 (d74a122)

where claude doesn't show nothing

PS C:\Users\Adrián> claude -p "say hi"
Hi! How can I help you today?

PS C:\Users\Adrián> openclaw gateway --claude-cli-logs --verbose

🦞 OpenClaw 2026.4.2 (d74a122) — Open source means you can see exactly how I judge your config.

00:41:02+02:00 Registered plugin command: /pair (plugin: device-pair)
00:41:04+02:00 Registered plugin command: /phone (plugin: phone-control)
00:41:04+02:00 Registered plugin command: /voice (plugin: talk-voice)
00:41:04+02:00 bonjour: starting (hostname=openclaw, instance="DESKTOP-S7EON2I (OpenClaw)", gatewayPort=18789, minimal=true)
00:41:56+02:00 Registered plugin command: /pair (plugin: device-pair)
00:41:56+02:00 Registered plugin command: /phone (plugin: phone-control)
00:41:57+02:00 Registered plugin command: /voice (plugin: talk-voice)
00:41:57+02:00 [routing] resolveAgentRoute: channel=telegram accountId=fumi peer=none guildId=none teamId=none bindings=1
00:41:57+02:00 [routing] binding: agentId=fumi accountPattern=fumi peer=none guildId=none teamId=none roles=0
00:41:57+02:00 [routing] match: matchedBy=binding.account agentId=fumi
00:42:01+02:00 bonjour: ignoring unhandled ciao rejection: CIAO ANNOUNCEMENT CANCELLED
00:42:01+02:00 [routing] resolveAgentRoute: channel=telegram accountId=default peer=none guildId=none teamId=none bindings=1
00:42:01+02:00 [routing] binding: agentId=main accountPattern=default peer=none guildId=none teamId=none roles=0
00:42:01+02:00 [routing] match: matchedBy=binding.account agentId=main
00:42:02+02:00 telegram: command menu unchanged; skipping sync
00:42:02+02:00 [routing] resolveAgentRoute: channel=telegram accountId=sora peer=none guildId=none teamId=none bindings=1
00:42:02+02:00 [routing] binding: agentId=sora accountPattern=sora peer=none guildId=none teamId=none roles=0
00:42:02+02:00 [routing] match: matchedBy=binding.account agentId=sora
00:42:04+02:00 telegram: command menu unchanged; skipping sync
00:42:04+02:00 telegram: command menu unchanged; skipping sync
00:42:04+02:00 discord: config dm=on dmPolicy=allowlist allowFrom=428654591421317123, 1488514786726645800 groupDm=off groupDmChannels=any groupPolicy=allowlist guilds=1488510104041947218 historyLimit=20 mediaMaxMb=8 native=on nativeSkills=on accessGroups=on threadBindings=on threadIdleTimeout=24h threadMaxAge=off
00:42:04+02:00 discord: config dm=on dmPolicy=allowlist allowFrom=428654591421317123, 1488514786726645800 groupDm=off groupDmChannels=any groupPolicy=allowlist guilds=1488510104041947218 historyLimit=20 mediaMaxMb=8 native=on nativeSkills=on accessGroups=on threadBindings=on threadIdleTimeout=24h threadMaxAge=off
00:42:04+02:00 discord: config dm=on dmPolicy=pairing allowFrom=any groupDm=off groupDmChannels=any groupPolicy=allowlist guilds=1488510104041947218 historyLimit=20 mediaMaxMb=8 native=on nativeSkills=on accessGroups=on threadBindings=on threadIdleTimeout=24h threadMaxAge=off
00:42:09+02:00 discord: native commands using Carbon reconcile path
00:42:13+02:00 discord: native commands using Carbon reconcile path
00:42:17+02:00 discord: native commands using Carbon reconcile path
00:42:18+02:00 discord voice: autoJoin: 0 entries
00:42:18+02:00 discord: drop bot message (allowBots=false)
00:42:18+02:00 discord: drop bot message (allowBots=false)

lament mesaBOT
#

Perfect, this helps a lot.

Two important things from your output:

  1. where claude in PowerShell is misleading (where is an alias there).
    Use this instead:
where.exe claude
Get-Command claude
  1. Your foreground logs don’t show a claude-cli run yet — so we still need one failing call while that terminal is open.

Do this exact test:

#

A) Keep this running in terminal 1

openclaw gateway --claude-cli-logs --verbose

B) In terminal 2, force one claude-cli run

openclaw agent --message "test cli backend" --model claude-cli/claude-sonnet-4-6

Then paste the error block from terminal 1 (look for agent/claude-cli, spawn, ENOENT, model, etc.).


Also: claude-sonnet-5-6 probably won’t stick in your current setup (your status stays on ...4-6).
For now, keep testing with claude-cli/claude-sonnet-4-6 until backend is stable.

#

If we confirm PATH issue, set explicit command path in config (%USERPROFILE%\.openclaw\openclaw.json):

{
agents: {
defaults: {
cliBackends: {
"claude-cli": {
command: "C:\\full\\path\\to\\claude.cmd"
}
}
}
}
}

Then restart gateway.

rare scroll
#

CommandType Name Version Source


Application claude.exe 2.1.92.0 C:\Users\Adrián.local\bin\claude.exe

Path added to openclaw.json

ns=undefined persistedFresh=true promptTokensEst=81 transcriptPromptTokens=undefined transcriptOutputTokens=undefined projectedTokenCount=undefined transcriptBytes=undefined forceFlushTranscriptBytes=2097152 forceFlushByTranscriptSize=false
00:43:13+02:00 [agent/cli-backend] cli exec: provider=claude-cli model=sonnet promptChars=322
00:43:13+02:00 [agent/cli-backend] cli argv: C:\Users\Adrián.local\bin\claude.exe -p --output-format stream-json --verbose --permission-mode bypassPermissions --strict-mcp-config --mcp-config C:\Users\ADRIN~1\AppData\Local\Temp\openclaw-cli-mcp-nsAHbR\mcp.json --model sonnet --append-system-prompt <systemPrompt:32416 chars> --session-id 9d9b0ced-907d-422a-b18a-9978e3cf5294 <prompt:322 chars>
00:43:13+02:00 Embedded agent failed before reply: spawn ENAMETOOLONG
00:43:13+02:00 discord gateway metrics: {"latency":105,"uptime":60003,"reconnects":0,"zombieConnections":0,"messagesReceived":8,"messagesSent":3,"errors":0}
00:43:15+02:00 [telegram] Edited message 4739 in chat 374294224
00:43:15+02:00 telegram ingress: chatId=374294224 dispatchCompleteMs=9157 buffer=inbound-debounce
00:43:17+02:00 discord gateway metrics: {"latency":106,"uptime":60003,"reconnects":0,"zombieConnections":0,"messagesReceived":8,"messagesSent":3,"errors":0}
00:43:21+02:00 discord: drop bot message (allowBots=false)
00:43:21+02:00 discord: drop bot message (allowBots=false)
00:43:21+02:00 discord: drop bot message (allowBots=false)
00:43:52+02:00 discord: drop bot message (allowBots=false)
00:43:52+02:00 discord: drop bot message (allowBots=false)
00:43:52+02:00 discord: drop bot message (allowBots=false)
00:44:09+02:00 discord gateway metrics: {"latency":106,"uptime":120516,"reconnects":0,"zombieConnections":0,"messagesReceived":12,"messagesSent":5,"errors":0}
00:44:13+02:00 discord gateway metrics: {"latency":107,"uptime":120005,"reconnects":0,"zombieConnections":0,"messagesReceived":12,"messagesSent":5,"errors":0}
00:44:17+02:00 discord gateway metrics: {"latency":109,"uptime":120006,"reconnects":0,"zombieConnections":0,"messagesReceived":12,"messagesSent":5,"errors":0}
00:44:22+02:00 discord: drop bot message (allowBots=false)
00:44:22+02:00 discord: drop bot message (allowBots=false)
00:44:22+02:00 discord: drop bot message (allowBots=false)

lament mesaBOT
#

Nice — we got the root cause now ✅

Embedded agent failed before reply: spawn ENAMETOOLONG

That means Windows command-line length limit is being hit.
Your log shows --append-system-prompt <systemPrompt:32416 chars>, so the claude-cli process launch is too long.

So this is not an auth problem anymore.

Fix (Windows workaround)

In your openclaw.json, under agents.defaults.cliBackends."claude-cli", set:

{
agents: {
#
defaults: {
cliBackends: {
"claude-cli": {
command: "C:\\Users\\Adrián\\.local\\bin\\claude.exe",
input: "stdin",
systemPromptWhen: "never"
}
}
}
}
}

Then restart:

#
openclaw gateway restart

Why this works

  • systemPromptWhen: "never" stops passing the huge system prompt as a CLI arg
  • input: "stdin" keeps user prompt off argv too

If you want maximum stability right now, use anthropic/... on Windows native and keep claude-cli as fallback only.

Also, this looks like a legit Windows bug/limitation interaction — please file it with that exact log line + argv snippet:
https://github.com/openclaw/openclaw/issues

Refs:

rare scroll
#

Solved!