OpenClaw Hits 33K Context Limit: How to Fix It
A developer on r/openclaw reports a persistent 33K token context cap in OpenClaw, despite configuring a 262K context window. The issue affects every model they load locally, including Qwen3.8-27B, and appears to be outside OpenClaw's control.
What's Happening
The user set the context window correctly:
openclaw config set agents.defaults.contextWindow 262144OpenClaw acknowledges the model supports 262144 tokens, but responses degrade after ~33K tokens, forcing frequent /compact or /new commands on Telegram. Running ollama ps reveals the model only has a 33K context loaded, regardless of the model's native capacity.
Root Cause
The problem is likely in Ollama, not OpenClaw. Ollama defaults to a context size (often 4096 or 8192) unless overridden via the OLLAMA_CONTEXT_LENGTH environment variable or the num_ctx parameter in Modelfile. OpenClaw doesn't pass the context length to Ollama, so Ollama loads with a small window.
Solutions
- Set OLLAMA_CONTEXT_LENGTH: Before starting Ollama, set the environment variable to 262144.
export OLLAMA_CONTEXT_LENGTH=262144 - Update Modelfile: If you're using a custom model, add the parameter
and recreate the model.PARAMETER num_ctx 262144 - Check Docker: If Ollama runs in Docker, ensure the environment variable is passed via
docker run -e OLLAMA_CONTEXT_LENGTH=262144.
Additional Notes
You can verify the loaded context with ollama ps — it should show the new size after the fix. Also, consider using Ollama's OpenAI-compatible endpoint with num_ctx in the request, which some clients support.
For more details, check the source discussion.
📖 Read the full source: r/openclaw
👀 See Also

3 weeks of OpenClaw: token costs, loops, and compaction — lessons from the trenches
After burning tokens on heartbeat checks with Opus, fighting agent loops, and losing context to compaction, a Reddit user shares the hard-won fixes: use cheaper models for trivial tasks, write anti-loop rules, and save decision logs.
Run a Second OpenCLAW Instance as a Safety Net
Deploy a basic OpenCLAW instance with key models to troubleshoot your main instance when it crashes. Works on Raspberry Pi, phone, or Clawx.

Cron Jobs with AI Fallback Can Incur Unexpected API Costs When Tools Hang
A user reported that a cron job in OpenClaw checking an email inbox every 10 minutes using himalaya burned through ~$60 in API credits when the IMAP connection started hanging, triggering Claude agents on each timed-out run despite instructions to only engage AI for inbound emails.

Optimizing CLAUDE.md to Reduce Context Anxiety in Claude AI
A Reddit discussion highlights practical strategies for improving CLAUDE.md effectiveness, including keeping files under 200 lines, using specific verifiable instructions, and leveraging Claude's auto-memory features to prevent token-wasting correction loops.