openclaw - 💡(How to fix) Fix Feature: slim mode to pass --bare to claude-cli backend (unlock sub-opus models on heavy workspaces) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#70782Fetched 2026-04-24 05:53:42
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Error Message

$ openclaw capability model run --model claude-cli/claude-sonnet-4-6 --prompt "hi" [agent/cli-backend] cli exec: provider=claude-cli model=sonnet promptChars=2 [agent/cli-backend] claude live session start: provider=claude-cli model=claude-sonnet-4-6 [agent/cli-backend] claude live session turn failed: provider=claude-cli model=claude-sonnet-4-6 durationMs=3933 error=FailoverError FailoverError: Prompt is too long

Root Cause

  • Unlocks sonnet-4.6 and haiku-4.5 for cron jobs on heavy workspaces — meaningful cost savings for high-frequency jobs (our task-watcher fires 48×/day, school-inbox-guard 36×/day, etc.).
  • Keeps opus-4.7 as the default for interactive sessions that need the full harness.
  • Non-breaking: opt-in, default false.

Code Example

$ openclaw capability model run --model claude-cli/claude-sonnet-4-6 --prompt "hi"
[agent/cli-backend] cli exec: provider=claude-cli model=sonnet promptChars=2
[agent/cli-backend] claude live session start: provider=claude-cli model=claude-sonnet-4-6
[agent/cli-backend] claude live session turn failed: 
  provider=claude-cli model=claude-sonnet-4-6 durationMs=3933 error=FailoverError
FailoverError: Prompt is too long

---

// openclaw.json
"agents": {
  "defaults": {
    "claudeBackend": {
      "slimMode": false
    }
  }
}

---

"payload": {
  "kind": "agentTurn",
  "model": "claude-cli/claude-sonnet-4-6",
  "slimMode": true,
  ...
}
RAW_BUFFERClick to expand / collapse

Problem

On a workspace with many skills / a rich CLAUDE.md / ShieldCortex-style plugin hooks, the OpenClaw claude-cli backend builds a pre-turn harness (auto-discovered CLAUDE.md up the tree, plugin sync, hooks, skill catalog, auto-memory) that can exceed the context window of smaller Claude models.

Concrete reproduction on our E.D.I.T.H. host (OpenClaw 2026.4.22, Claude Code subscription):

$ openclaw capability model run --model claude-cli/claude-sonnet-4-6 --prompt "hi"
[agent/cli-backend] cli exec: provider=claude-cli model=sonnet promptChars=2
[agent/cli-backend] claude live session start: provider=claude-cli model=claude-sonnet-4-6
[agent/cli-backend] claude live session turn failed: 
  provider=claude-cli model=claude-sonnet-4-6 durationMs=3933 error=FailoverError
FailoverError: Prompt is too long
  • Same command with --model claude-cli/claude-haiku-4-5 and a 9-character prompt → same FailoverError: Prompt is too long.
  • --model claude-cli/claude-opus-4-7 (1024k ctx) works fine — the harness fits in opus's window but not in sonnet's 195k / haiku's 200k.

Result: even though the Claude Code subscription allows sonnet/haiku model IDs to pass through the claude-cli provider, sub-opus models are effectively unusable on heavy workspaces — requests silently fail over to fallback (gpt-5.4), which for .sh script invocation then blocks on interactive approval.

Claude Code already supports this

claude CLI has a --bare flag:

Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and CLAUDE.md auto-discovery. Sets CLAUDE_CODE_SIMPLE=1. Skills still resolve via /skill-name. Explicitly provide context via: --system-prompt[-file], --append-system-prompt[-file], --add-dir (CLAUDE.md dirs), --mcp-config, --settings, --agents, --plugin-dir.

But the OpenClaw claude-cli backend doesn't currently surface this. There's also no knob to pass --bare or equivalent trimming flags per-session or per-job.

Proposed feature

A config/flag combination that lets cron jobs (and one-shot openclaw capability model run / openclaw infer model run invocations) opt into a slim mode which maps to claude --bare under the hood, with optional explicit context via --append-system-prompt-file / --add-dir.

Ideal shape:

// openclaw.json
"agents": {
  "defaults": {
    "claudeBackend": {
      "slimMode": false
    }
  }
}

Plus per-job override in cron payload:

"payload": {
  "kind": "agentTurn",
  "model": "claude-cli/claude-sonnet-4-6",
  "slimMode": true,
  ...
}

Also surface --slim / --bare on openclaw capability model run and openclaw infer model run for parity.

Why this matters

  • Unlocks sonnet-4.6 and haiku-4.5 for cron jobs on heavy workspaces — meaningful cost savings for high-frequency jobs (our task-watcher fires 48×/day, school-inbox-guard 36×/day, etc.).
  • Keeps opus-4.7 as the default for interactive sessions that need the full harness.
  • Non-breaking: opt-in, default false.

Host details

  • OpenClaw 2026.4.22 (build 00bd2cf)
  • Node (from ~/.npm-global)
  • Model catalog shows claude-cli/claude-sonnet-4-6 (195k), claude-cli/claude-haiku-4-5 (200k), claude-cli/claude-opus-4-7 (1024k) all as configured
  • Auth: anthropic:claude-cli OAuth via Claude Code subscription
  • Workspace size: 20 skills under ~/skills, 3 under ~/.openclaw/workspace/skills, plus a ~/.openclaw/workspace/memory/ dir (~1.4 MB across 58 daily files). Stripping skills alone was insufficient — harness still overflows 200k with zero skills present.

Happy to test any prototype branches on our host.

extent analysis

TL;DR

Implement a slimMode configuration option in OpenClaw's claude-cli backend to enable a minimal mode, similar to Claude's --bare flag, to reduce the context window size for smaller Claude models.

Guidance

  • Introduce a slimMode flag in the openclaw.json configuration file to opt into a slim mode for the claude-cli backend.
  • Add a per-job override for slimMode in the cron payload to allow for flexible configuration.
  • Surface --slim or --bare flags on openclaw capability model run and openclaw infer model run commands for parity with the claude CLI.
  • Test the implementation with the provided claude-sonnet-4-6 and claude-haiku-4-5 models to ensure the slim mode reduces the context window size effectively.

Example

// openclaw.json
"agents": {
  "defaults": {
    "claudeBackend": {
      "slimMode": true
    }
  }
}

Notes

The proposed slimMode feature should be tested thoroughly to ensure it works as expected and does not introduce any regressions. The implementation should also consider the trade-offs between the reduced context window size and the potential loss of functionality due to the minimal mode.

Recommendation

Apply the proposed slimMode feature to enable the use of smaller Claude models, such as claude-sonnet-4-6 and claude-haiku-4-5, on heavy workspaces, while keeping the default mode for interactive sessions that require the full harness.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Feature: slim mode to pass --bare to claude-cli backend (unlock sub-opus models on heavy workspaces) [1 participants]