#Claude-cli context usage over 5 times then pi runtime.

1 messages · Page 1 of 1 (latest)

night tartan
#

Claude-cli context usage over 5 times then pi runtime. Why is that and how I can improve it?

timid lionBOT
#

That usually means the Claude CLI backend is being asked to carry a much larger conversation history than the “runtime” number makes obvious.

A few common causes:

  • Long Discord threads keep accumulating session history; each turn may resend a lot of prior context.
  • Tool output / file reads / browser results can be huge compared with normal chat text.
  • Compaction may not have happened yet, or it may keep a large recent tail.
  • Claude CLI/subscription usage limits are separate from OpenClaw’s local runtime/status accounting, so the numbers won’t always line up 1:1.

Ways to improve it:

  • Start a clean session when changing topics: /new
  • Compact before long work: /compact
  • Keep big project state in files and ask the agent to read only what it needs.
  • Avoid pasting big logs directly; attach/save them and point the bot at the relevant section.
  • Use sub-agents for long/parallel tasks so the main thread stays smaller.
  • If you hit Anthropic 429/long-context errors, either wait for the Claude CLI window to reset, use an eligible API-key/extra-usage path, or set a fallback model.

For diagnosing your exact case, first check your version:

willow lodge
#

how to switch to pi harness?

timid lionBOT
#

To force the built-in PI harness, set the embedded harness runtime to pi, then start a fresh session:

openclaw config set agents.defaults.embeddedHarness.runtime pi
openclaw config set agents.defaults.embeddedHarness.fallback pi
openclaw config validate

Then in the chat/session you want to switch:

/new

or /reset if you specifically want to clear the current session binding.

Important bit: harness choice is pinned per session after the first embedded run, so changing config won’t flip an already-running Codex/native harness thread mid-conversation. Use /status after the new turn; PI shows as Runner: pi (embedded).