OpenClaw Tips: Configuration, Optimization & Security
By Riz Pabani on 31-Jan-2026

Here are expanded tips for using OpenClaw (formerly ClawdBot / Moltbot) effectively and securely. This covers core configuration, optimization strategies, thinking levels, Telegram usage, proactive automation, and critical security best practices.
1. Master the Core Configuration Files
Edit these files directly in ~/.openclaw/ to shape behavior.
SOUL.md — Core personality and principles (e.g., proactive, witty, privacy-first).
IDENTITY.md — Name, emoji, theme (e.g., Molty the lobster).
USER.md — Facts about you including goals, schedule, and preferences. Update this regularly as your needs change.
MEMORY.md (long-term) + daily memory files — Persistent knowledge. Review and edit periodically to prune bloat and keep context relevant.
openclaw.json — Main configuration file. Key areas include:
gateway— mode (local recommended), auth token, ports (default often 18789 — change it!), bind to 127.0.0.1agents.defaults— primary model, temperature, thinking levelmodels.providers— API keys and endpoints (never commit to git!)channels.telegram— botToken, groups allowlist, requireMention, etc.
2. Optimize for Context Size, Rate Limits, and Reasoning Depth
Use skills like qmd (quick markdown summarizer) to instruct the bot to summarize long threads or research before continuing.
Route simple tasks to local models (Ollama) and heavy reasoning to cloud providers (Claude/GPT) via config routing.
Add your Brave Search API key in models.providers and tell the bot: "Default to Brave for web searches."
Set Thinking / Reasoning Levels
OpenClaw supports adjustable reasoning depth via slash commands or config defaults. Higher levels use more tokens for deeper chain-of-thought but improve complex problem-solving.
Use these commands in chat:
/think low(or/reason low) — "think hard" — balanced default for most tasks/think medium— "think harder" — good for research and planning/think high— "ultrathink" — max effort, best for hard problems (uses highest token budget)/think xhigh— "ultrathink+" (only on supported models like GPT-5.2 or Codex variants)/think offorminimal— minimal or no visible reasoning (faster, cheaper)/reasoning(no argument) — check current level
Set the global default in config:
"agents": {
"defaults": {
"thinkingDefault": "medium"
}
}
Start with medium for proactive or recurring tasks. Switch to high for deep analysis, but watch costs.
3. Leverage Proactive Features and Automation
Set recurring jobs by telling your bot: "Create a cron to research [topic] every Monday 9 AM and send summary via Telegram."
Enable heartbeat by asking: "Set up daily heartbeat to check tools and online status and git-pull updates."
Keep tools fresh by asking the bot to "Update skills and tools if outdated" or run openclaw update manually.
For a practical example of these automation features in action, see OpenClaw SEO Stack: Spotting Newsjack Opportunities.
4. Using OpenClaw via Telegram
Telegram is one of the most popular ways to interact with OpenClaw remotely — it turns your bot into a mobile CLI-like interface for tasks, while the real CLI lives in your terminal (openclaw / clawdbot commands).
Quick Setup Recap
If not already connected:
- Create your bot via @BotFather in Telegram (
/newbotto get your token) - During
openclaw onboardor manual config, paste the token intochannels.telegram.botToken - Start a chat with your bot and send
/start(it often replies with a pairing code) - Approve pairing in terminal:
openclaw pairing approve telegram <code> - Test by sending any message (e.g., "Hey, what's my status?") — the bot should respond
Using It Like a CLI from Telegram
Just chat naturally — no special prefix needed for most things.
Examples:
- "Run
ls -lain my home dir" — executes shell (if tool allowed) - "Read the last 20 lines of ~/.clawdbot/logs/gateway.log"
- "Create a new file called notes.md with content: ..."
- "Search web for latest OpenClaw updates"
- "Summarize my MEMORY.md and qmd it"
The bot treats your messages as prompts to its agent (Pi) — same as terminal CLI but routed through Telegram.
Common Telegram Commands
/start— Initiate or restart session, get pairing code or welcome info/help— Lists available slash commands or basic usage (bot-dependent; some setups add custom ones)/statusor "status" — Check if bot is online, model used, tools active/think low/medium/high— Switch reasoning level mid-chat/reasoning— Show current thinking mode
For groups, mention the bot (@yourbotname) to trigger it, unless requireMention: false is set in config for that group or topic.
Pro Tips for Telegram
Use DMs for private CLI-like control and groups for shared tasks. Configure per-group settings in your config file.
Streaming replies — The bot edits its message in real-time for long responses in both DMs and groups.
If no response — Check terminal logs, ensure bot token is valid, and verify pairing is approved.
Privacy — The bot only sees messages in allowed chats and groups as controlled by your configuration.
Advanced — Ask the bot "How do I use you in Telegram?" — it often explains its own capabilities.
5. Security Checks and Best Practices
OpenClaw gives powerful local access — treat it like a high-privilege process. Common pitfalls include exposed gateways leaking keys and chats, and prompt injection leading to remote code execution or file exfiltration.
API Keys and Credentials
Never paste raw keys (OpenAI, Anthropic, Gmail OAuth, etc.) into prompts or shareable files.
Use environment variables or .env files with strict permissions:
chmod 600 .env
Prefer Composio Managed Auth or similar middleware for integrations so the bot never sees raw tokens.
Rotate and revoke keys immediately if you suspect compromise. Use fine-grained tokens (e.g., GitHub read-only) where possible.
For highest security, use local models only with zero cloud keys.
Gateway Protection
Bind to localhost only by setting gateway.bind to 127.0.0.1 — never use 0.0.0.0 or a public IP.
Enable strong auth using gateway.auth.token with a long random string — never expose the gateway without it.
Change the default port (18789 is widely scanned) to a random high port.
For remote access, use Tailscale, Cloudflare Tunnel, or SSH reverse tunnel — never direct port forward.
Monitor logs regularly and check gateway logs for unexpected tool calls or sessions.
Tool and Execution Hardening
Disable risky tools (shell, file write, browser) for non-trusted agents via exec-approvals.json or per-agent config.
Run in hardened Docker with non-root user, --cap-drop=ALL, read-only filesystem, no --privileged flag, strict seccomp/AppArmor profiles, no sensitive mounts, and limited network access.
Use sandboxed agents for dangerous tasks.
Enable approvals by turning on manual confirmation for high-risk actions.
Audit regularly by running openclaw security audit (or --deep/--fix if available) and review HEARTBEAT.md plus recent transcripts.
Other Risks to Consider
Prompt injection — Treat incoming DMs and messages as untrusted. Harden SOUL.md against overrides.
Data exfiltration — Never grant unnecessary file or network access. Encrypt sensitive storage if possible.
Cost monitoring — Set strict token limits and watch for anomalous high usage which could indicate abuse.
Community consensus — For sensitive data, run on an isolated VPS with no local host access, or use local-only mode with no cloud models.
The Bottom Line
Follow these practices and OpenClaw becomes a secure, always-available remote brain via Telegram or other channels. It's especially powerful for mobile CLI-style control without opening a terminal.
Backup configs often, start conservative with low thinking and restricted tools, and scale up as you build trust with your setup.
Related Articles

Kimi K2: The Open Source Model Changing Enterprise AI
Kimi K2 is a 1 trillion parameter open source model rivaling closed models. Learn why this matters f...

OpenClaw SEO Stack: Spotting Newsjack Opportunities in 2026
An OpenClaw SEO stack for solopreneurs: research, trend-jacking, task automation, and the Moltbook a...

How to Set Up OpenClaw on a Hostinger VPS with Ubuntu 24.04
A complete step-by-step guide to installing OpenClaw on a Hostinger VPS running Ubuntu 24.04, with s...