Skip to content

OpenClaw Debugging — Watch Mode, Raw Streams, and Dev Profiles

When something breaks, you need to see what’s actually happening—not what should be happening. These debugging tools let you inspect raw model output, run fast iteration loops, and isolate your dev environment from production.


Use /debug in chat to set config overrides without editing files:

/debug show # View current overrides
/debug set messages.responsePrefix="[test]" # Set a value
/debug unset messages.responsePrefix # Remove override
/debug reset # Clear all overrides

Note: Enable with commands.debug: true in config. These are memory-only—they don’t persist.


For fast iteration, run the Gateway with file watching:

Terminal window
pnpm gateway:watch --force

This restarts the Gateway automatically when you save files. Same as:

Terminal window
tsx watch src/entry.ts gateway --force

Use a dev profile to isolate your debugging from production state:

Terminal window
pnpm gateway:dev
OPENCLAW_PROFILE=dev openclaw tui

What dev profile does:

  • State directory: ~/.openclaw-dev
  • Gateway port: 19001
  • Skips BOOTSTRAP.md
  • Creates a minimal default config
  • Default identity: C3-PO (protocol droid)
  • Skips channel providers

Fresh start:

Terminal window
pnpm gateway:dev:reset

This wipes dev config, credentials, and sessions (uses trash, not rm).


See exactly what the model returns before any filtering:

Terminal window
pnpm gateway:watch --force --raw-stream

Default file:

~/.openclaw/logs/raw-stream.jsonl

Custom path:

Terminal window
pnpm gateway:watch --force --raw-stream --raw-stream-path /custom/path.jsonl

Environment variables:

Terminal window
OPENCLAW_RAW_STREAM=1
OPENCLAW_RAW_STREAM_PATH=~/.openclaw/logs/raw-stream.jsonl

This is the best way to see if reasoning content is leaking into regular text output.


To capture OpenAI-compatible chunks before parsing:

Terminal window
PI_RAW_STREAM=1
PI_RAW_STREAM_PATH=~/.pi-mono/logs/raw-openai-completions.jsonl

VariableDescription
OPENCLAW_PROFILE=devUse dev profile
OPENCLAW_STATE_DIR=~/.openclaw-devOverride state directory
OPENCLAW_GATEWAY_PORT=19001Override gateway port
OPENCLAW_RAW_STREAM=1Enable raw stream logging
OPENCLAW_SKIP_CHANNELS=1Skip channel providers

  • Raw stream logs can include prompts, tool output, and user data
  • Keep logs local and delete after debugging
  • Scrub secrets and PII before sharing

Still stuck? Our AI Setup Assistant can help debug your setup.



Need help? Join the OpenClaw Discord or check the GitHub Issues.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.