21 OpenClaw Hacks: Memory, Model Routing & Automations
Power-user tips for memory management, model routing and workflow automation in OpenClaw
These 21 hacks separate casual OpenClaw users from power users. They cover memory that compounds over time, model routing that slashes costs, automation patterns that work while you sleep, and India-specific tricks for running a capable AI agent at near-zero cost. Work through them in order — each one builds on the previous.
Memory Hacks
Persistent memory is OpenClaw's superpower over stateless chatbots. These hacks make that memory system work harder for you.
Hack 1: Install the Pearl Memory Layer
Pearl is the single highest-leverage upgrade you can make to OpenClaw. Without Pearl, OpenClaw only remembers things you explicitly command it to save ("remember that I prefer short responses"). With Pearl, it automatically extracts memorable information from every conversation and uses it to enrich future prompts.
clawhub install pearl-proxy
openclaw config set memory.provider pearl
How Pearl works:
- You send a message to OpenClaw
- Pearl intercepts it before it reaches the AI model
- Pearl scans the conversation for memorable facts (preferences, decisions, context)
- Those facts are stored in
~/clawd/memory/pearl/as structured entries - Next time you send a message, Pearl injects relevant memories into the prompt context
- The AI model sees your current message plus relevant personal context
Over weeks, Pearl builds a rich model of how you work, what you prefer, and what context matters to you. Your agent gets measurably better over time.
Hack 2: Edit Memory Files Directly
Pearl's automated extraction is good but not perfect. You can manually add facts to your memory files — they are just markdown:
nano ~/clawd/memory/user-profile.md
# User Profile
## Personal Context
- Name: Rajesh Sharma
- Location: Bengaluru, Karnataka (IST timezone)
- Profession: Fullstack developer, 6 years experience
- Languages: English, Hindi, Kannada
- Current project: E-commerce platform for saree business
## Preferences
- Response length: Concise. Use bullet points over paragraphs.
- Code language: TypeScript preferred, Python when needed
- Tone: Professional but casual, no unnecessary formality
- Currency: Always show in INR (₹) first, then USD in parentheses
## Important Context
- My company uses Jira for project management
- I work 9 AM – 7 PM IST, no notifications after 9 PM
- My Telegram username: @rajesh_dev
This profile is injected into every prompt context. Your agent knows these facts permanently without you ever repeating them.
Hack 3: Create Specialized Context Files
Instead of one giant profile, create separate memory files for different contexts:
~/clawd/memory/
├── user-profile.md # Who you are
├── work-context.md # Current projects, team, stack
├── preferences.md # Communication and format preferences
├── clients.md # Client list and status
├── recurring-tasks.md # Ongoing responsibilities
└── shortcuts.md # Your personal aliases and shortcuts
In shortcuts.md, define personal shorthand:
# My Shortcuts
- "standup" = generate daily standup update from my recent activity
- "invoice client" = draft GST invoice using gst-invoice-helper skill
- "eod" = end-of-day summary: what I did, what's pending, tomorrow's priorities
- "news" = india-news-briefing filtered to tech and startup categories
Now you can send "standup" and OpenClaw knows exactly what you mean.
Hack 4: Session Continuity Across Restarts
By default, conversation context resets when OpenClaw restarts. Enable session persistence to carry context forward:
{
"memory": {
"enabled": true,
"sessionPersistence": true,
"sessionFile": "~/clawd/memory/last-session.md"
}
}
With this enabled, the last 10 messages of each conversation are saved and reinjected when you start a new session. This means you can pick up mid-task after a restart without re-explaining the context.
Hack 5: Memory Pruning to Keep Prompts Lean
Memory files grow over time. Old entries make prompts longer and more expensive (every token costs money). Prune stale memories monthly:
# Ask OpenClaw to audit its own memory
# Send this message to your agent:
Audit your memory files in ~/clawd/memory/. List all entries older than 30 days that are no longer relevant. Then delete them after I confirm.
You can also ask OpenClaw to automatically consolidate memory: "Consolidate your memory files — merge related entries, remove duplicates, and summarize older context." This keeps your effective memory lean without losing important history.
Model Routing Hacks
API costs are the main ongoing expense for OpenClaw users. Smart routing can reduce your monthly spend by 70–90%.
Hack 6: Route Simple Queries to Cheap Models
Most of your daily interactions with OpenClaw are simple: set a reminder, look something up, format a response, check the weather. These do not need Claude 4 or GPT-5. Route them to free or cheap models:
{
"ai": {
"routing": {
"default": {
"provider": "groq",
"model": "llama-3.1-8b-instant"
},
"complex": {
"provider": "anthropic",
"model": "claude-sonnet-4-6"
}
}
}
}
Groq's llama-3.1-8b-instant handles 80% of typical tasks excellently and is free. You save Claude credits for genuinely complex requests.
Hack 7: Route Complex Reasoning to Claude 4 Sonnet
For tasks that genuinely require strong reasoning — writing code, analyzing documents, multi-step planning, nuanced email drafting — Claude 4 Sonnet offers the best quality-to-cost ratio:
Add this annotation to your skills file to explicitly request a premium model:
---
name: complex-analysis
model_preference: claude-sonnet-4-6
reason: requires multi-step reasoning and document analysis
---
OpenClaw respects model_preference in skill files, upgrading to the specified model for those tasks while keeping everything else on the cheap default.
Hack 8: Pearl's Automatic Model Router
Pearl's model router classifies tasks automatically and routes them to the appropriate model without any manual annotation:
clawhub install pearl-router
The Pearl router uses a tiny local classifier (running on your machine, zero cost) to categorize each request:
| Task Type | Routed To | Typical Cost | |---|---|---| | Reminders, alarms, timers | Groq Llama 8B instant | Free | | Simple lookups, weather, news | Groq Llama 70B | Free | | Email drafting, writing | Gemini 1.5 Flash | ~₹0.25/1K tokens | | Code generation, debugging | Claude Sonnet | ~₹4/1K tokens | | Complex analysis, planning | Claude Sonnet | ~₹4/1K tokens |
For most Indian users doing 50–100 interactions per day, this routing setup reduces monthly spend from ₹2,000+ to under ₹300.
Hack 9: Failover Routing for 100% Uptime
Cloud AI APIs occasionally hit rate limits or go down briefly. Without failover, OpenClaw returns an error and you lose the task. With failover routing, it automatically tries the next provider:
{
"ai": {
"failover": ["groq", "anthropic", "google", "ollama"],
"failoverOnErrors": ["rate_limit", "service_unavailable", "timeout"]
}
}
With this config, if Groq is rate-limited, OpenClaw automatically tries Anthropic, then Google, then falls back to local Ollama. You never get stuck. Ollama as the final fallback means you always get a response even if all cloud providers are down.
Hack 10: The India Cost Hack — 80% Local with Ollama
This is the most powerful cost hack for Indian users. Run 80% of your queries locally via Ollama and only send the complex 20% to a cloud API:
# Install Ollama and download Llama 3.2
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.2
ollama pull codellama # For code tasks
Configure your routing:
{
"ai": {
"routing": {
"default": {
"provider": "ollama",
"model": "llama3.2"
},
"code": {
"provider": "ollama",
"model": "codellama"
},
"complex": {
"provider": "groq",
"model": "llama-3.1-70b-versatile"
}
}
}
}
With 8 GB RAM, this setup handles reminders, scheduling, note-taking, file management, simple code questions, and most daily tasks at ₹0. You use cloud API only for things that genuinely need it.
Cron and Automation Hacks
Background automation is where OpenClaw earns its keep. These hacks make your agent work while you sleep.
Hack 11: Use Cron Instead of Heartbeat for Monitoring
Heartbeat mode polls your agent on a regular interval — by default, every 15 minutes. This means 96 LLM calls per day just for monitoring tasks that change slowly. Use cron instead:
{
"monitoring": {
"mode": "cron",
"jobs": [
{
"name": "morning-check",
"cron": "0 7 * * *",
"task": "Check my email for urgent messages and send me a summary"
},
{
"name": "price-alert",
"cron": "0 9,15 * * 1-5",
"task": "Check if my watchlist stocks have moved more than 3%"
}
]
}
}
This reduces from 96 LLM calls/day to 3 calls/day for the same monitoring tasks — a 97% cost reduction. Use cron for anything that only needs to run at specific times.
Hack 12: Dream Routines
"Dream routines" are background tasks that run overnight and prepare your day for you. Send this instruction to your agent once:
Every night at 11 PM IST:
1. Summarize everything I accomplished today based on our conversation history
2. List the 3 highest-priority items I mentioned for tomorrow
3. Archive completed tasks from my task list
4. Generate a brief agenda for tomorrow morning
5. Save all of this to ~/clawd/memory/daily-journal/[date].md
6. Send me a WhatsApp summary under 150 words
Every morning you wake up to a recap of yesterday and a clear agenda for today, prepared automatically while you slept.
Hack 13: Silent Background Automations
Not every automation needs to notify you. Silent automations run in the background without sending messages unless they find something important:
Monitor my Gmail for emails from [client name] or [boss name].
Only send me a Telegram notification if an email arrives that:
- Contains the words "urgent," "ASAP," "deadline," or "emergency"
- Is a reply to an email thread I have not responded to in 48 hours
Otherwise, do nothing.
This eliminates notification noise while ensuring you never miss genuinely urgent messages.
Hack 14: Shell Script Pre-Filter
For monitoring tasks, you can use a shell script to do the cheap filtering work before calling the LLM — only invoking the AI when truly necessary:
#!/bin/bash
# check-log-errors.sh — called by OpenClaw cron every 15 minutes
ERROR_COUNT=$(grep -c "ERROR\|CRITICAL\|FATAL" /var/log/app.log | tail -100)
if [ "$ERROR_COUNT" -gt "5" ]; then
# Only now call OpenClaw (costs API tokens)
openclaw task "Analyze the last 100 lines of /var/log/app.log and summarize the errors"
fi
Configure this in your cron:
{
"crons": [{
"name": "log-monitor",
"cron": "*/15 * * * *",
"type": "shell",
"command": "~/.openclaw/scripts/check-log-errors.sh"
}]
}
The shell script runs every 15 minutes at near-zero cost. OpenClaw only gets involved when there is an actual problem to analyze.
Hack 15: Webhook Triggers
Trigger OpenClaw actions from external events without polling. Any service that can send an HTTP POST can trigger your agent:
Enable the webhook server in config:
{
"webhooks": {
"enabled": true,
"port": 18790,
"secret": "your-webhook-secret-here"
}
}
Now configure external services to POST to http://your-server:18790/webhook:
# GitHub Actions: notify OpenClaw when a build fails
curl -X POST http://your-server:18790/webhook \
-H "X-OpenClaw-Secret: your-webhook-secret" \
-d '{"trigger": "github_build_failed", "repo": "my-app", "branch": "main"}'
Add a skill that handles github_build_failed triggers and sends you a formatted Telegram alert. Now you get instant notifications when your CI breaks, without any polling.
Other useful webhook triggers: form submissions (Typeform, Google Forms), payment confirmations (Razorpay webhooks), new customer signups, UPI payment notifications.
Productivity Hacks
Hack 16: Task Queuing for Parallel Work
You do not have to wait for OpenClaw to finish one task before giving it another. Queue multiple tasks and it processes them in order:
Queue these tasks:
1. Draft a professional email to client Sharma declining the project extension
2. Generate a GST invoice for ₹75,000 for last month's work
3. Check if there are any new comments on my GitHub PR #247
4. Set a reminder for Tuesday at 3 PM for the team sync call
OpenClaw works through the queue while you do other things. Come back in 10 minutes to find four completed tasks waiting for your review.
Hack 17: Three Concurrent Channel Sessions
OpenClaw supports multiple simultaneous channel connections. Open three different conversations across your channels — one for work tasks, one for personal tasks, one for monitoring — and they run fully independently:
{
"channels": [
{ "type": "telegram", "name": "work", "tokenEnv": "TELEGRAM_WORK_TOKEN" },
{ "type": "telegram", "name": "personal", "tokenEnv": "TELEGRAM_PERSONAL_TOKEN" },
{ "type": "webchat", "name": "monitoring", "port": 18789 }
]
}
Your work bot handles code reviews and Jira tickets. Your personal bot handles reminders and household tasks. The web UI handles background monitoring reports. They never interfere with each other.
Hack 18: Sub-Agents for Parallel Work
For tasks with independent subtasks, spawn sub-agents that work in parallel:
I need to prepare for a client presentation on Friday. Split this into parallel workstreams:
- Sub-agent 1: Research the client's company, recent news, and competitors
- Sub-agent 2: Pull together our project deliverables from the last 3 months
- Sub-agent 3: Generate a slide outline with 8 sections
Combine all three results into a single briefing document when done.
The three sub-agents run concurrently, then merge their outputs. This collapses multi-hour prep work into a few minutes.
Hack 19: Skill Templating for Recurring Workflows
Every time you do the same type of work, you burn time on setup and explanation. Write a skill template that codifies the workflow once, then trigger it instantly forever:
Create ~/clawd/skills/weekly-report.md:
---
name: weekly-report
triggers:
- "generate weekly report"
- "weekly update"
tools:
- file_read
- memory_read
- gmail_draft
---
## Weekly Report Skill
When triggered, generate a professional weekly status report:
1. Read this week's journal entries from ~/clawd/memory/daily-journal/
2. Summarize completed work in 3-5 bullet points
3. List blockers and risks in 1-3 bullets
4. List next week's priorities in 3-5 bullets
5. Keep tone professional, length under 300 words
6. Draft the email to [[email protected]] with subject "Weekly Update – [Week of date]"
7. Ask for confirmation before sending
Now "generate weekly report" turns an hour of work into 30 seconds, every week, forever. The compounding effect of skill templates is enormous over months.
India-Specific Cost Hacks
Hack 20: The Full Local Stack — ₹0 Total Cost
This is the ultimate setup for Indian users who want a capable AI agent with zero recurring costs:
# 1. Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# 2. Download Llama 3.3 (best quality local model as of early 2026)
# Requires 16 GB RAM for the 70B model
ollama pull llama3.3
# Or Llama 3.2 for 8 GB RAM systems
ollama pull llama3.2
# 3. Install OpenClaw with Ollama provider
npm install -g openclaw clawhub
openclaw init --provider ollama --model llama3.3
Configure Telegram as your channel (free) and you have:
- AI agent: ₹0 (open source)
- AI model: ₹0 (local via Ollama)
- Channel: ₹0 (Telegram)
- Server: ₹0 (your existing laptop/desktop)
- Monthly cost: ₹0
What you sacrifice: local models are slower than cloud APIs and less capable for complex multi-step reasoning. But for daily task management, reminders, scheduling, simple automation, and note-taking, Llama 3.3 on decent hardware is genuinely excellent.
Hack 21: Groq Free Tier Routing for Cloud Speed at Zero Cost
When you need cloud speed and quality but do not want to pay, route eligible queries to Groq's free inference tier:
{
"ai": {
"routing": {
"default": {
"provider": "groq",
"model": "llama-3.1-70b-versatile",
"apiKeyEnv": "GROQ_API_KEY",
"rateLimit": {
"requestsPerMinute": 25,
"requestsPerDay": 13000
}
},
"overflow": {
"provider": "ollama",
"model": "llama3.2"
}
}
}
}
Groq gives you Llama 3.1 70B inference at cloud speed — noticeably faster than local models — for free, with 14,400 requests/day. If you hit the rate limit (unusual for personal use), it automatically falls back to your local Ollama instance. You get cloud speed most of the time and local fallback when needed, at total cost ₹0.
Putting the Hacks Together: A Power User Config
Here is a complete openclaw.config.json that applies the most important hacks:
{
"ai": {
"routing": {
"default": { "provider": "groq", "model": "llama-3.1-70b-versatile" },
"complex": { "provider": "anthropic", "model": "claude-sonnet-4-6" },
"overflow": { "provider": "ollama", "model": "llama3.2" }
},
"failover": ["groq", "anthropic", "ollama"]
},
"memory": {
"enabled": true,
"provider": "pearl",
"sessionPersistence": true
},
"channels": [
{ "type": "telegram", "tokenEnv": "TELEGRAM_BOT_TOKEN", "allowedUsers": ["your_username"] }
],
"crons": [
{ "name": "morning-briefing", "cron": "0 7 * * *", "task": "Send my morning briefing" },
{ "name": "dream-routine", "cron": "0 23 * * *", "task": "Run daily journal and archive routine" }
],
"webhooks": { "enabled": true, "port": 18790, "secret": "your-secret" },
"monitoring": { "mode": "cron" }
}
This setup gives you: free routing with smart failover, Pearl memory that improves over time, Telegram channel, morning and evening automations, webhook triggers, and cron-based monitoring. Estimated monthly API cost for typical personal use: ₹50–₹300 depending on usage, compared to ₹2,000–₹5,000 without routing optimization.
Where to Go Next
- OpenClaw Security Guide — Protect your powerful setup before going live
- OpenClaw India Guide — WhatsApp setup, Hindi prompts, India automations
- OpenClaw Skills Guide — Add India-specific skills to your setup
- OpenClaw on PromptAndSkills — Community prompts and skill templates
Community Questions
0No questions yet. Be the first to ask!