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

Make OpenClaw Smarter: Challenge False Premises with a Direction Check Skill
A new skill for OpenClaw adds decision quality guidelines to AGENTS.md, forcing the agent to challenge user assumptions before acting on costly or irreversible changes.

OpenClaw v2026.3.13 adds per-agent cacheRetention config for OpenAI token cost savings
OpenClaw v2026.3.13 adds per-agent cacheRetention configuration that enables OpenAI's 24-hour prompt cache retention, potentially cutting input token costs by up to 90% for agents with heartbeat cycles longer than 10 minutes.

OpenClaw Installation Tips: Skip Onboarding and Use Diagnostic Commands
A Reddit user shares practical OpenClaw installation advice: skip the onboarding process to avoid common issues, especially on VPS setups, and use the openclaw doctor and openclaw status commands to diagnose configuration problems.

How to Cut OpenClaw Agent Costs by 80% with Model Switching
A user tracked token usage for 14 days and found 67% of spend was on tasks where cheap Flash models matched Opus quality. Switching to Flash by default and using /model mid-session cut costs from ~$170 to ~$35/month.