DEV Community

Victor Aguilar C.
Victor Aguilar C.

Posted on

6. OpenClaw en MacMini, Mantenimiento.

Mantenimiento y Monitoreo

Optimizar costos con Multi-Model Routing

Ahora que tu agent ya está corriendo y te sientes cómodo con cómo funciona, es momento de dejar de pagar precios premium por tareas que no necesitan modelos premium. OpenClaw te permite asignar distintos AI models a distintas tareas. El heartbeat fix del Step 13b fue tu primer “taste” de esto — aquí va el panorama completo.

El concepto: Piensa en tu agent como si tuviera un “brain” (con el que chateas) y “muscles” (tareas especializadas que el brain delega). Quieres un brain smart y personable, pero no todos los muscles necesitan ser el modelo más caro disponible.

Best model for each task (will be updated periodically):

Source: Alex Finn’s cost optimization guide for OpenClaw. See Helpful Resources al final de este documento.

Cómo configurarlo: No necesitas editar config files. Solo dile a tu agent en natural language:

  • “Use Deepseek v3 whenever you’re browsing the web or crawling pages.”
  • “Use Codex GPT 5.2 xHigh when I ask you to code.”
  • “Use Gemini 2.5 Flash for image understanding tasks.”

Tu agent te pedirá las API keys relevantes, configurará el routing, y confirmará. Cada provider requiere su propia API key, así que necesitarás cuentas con los providers que quieras usar.

Recomendación para empezar: No cambies todo de golpe. Empieza con los mayores cost savers:

  • Heartbeat → Haiku, hourly (ya hecho en Step 13b)
  • Image understanding → Gemini 2.5 Flash (free tier available — ahorra más por call)
  • Web search → Deepseek v3 (muy barato — ahorra bastante en workflows con mucho browse)

Mantén Opus como tu brain hasta que estés listo para experimentar con Kimi K2.5.

Siempre puedes volver atrás. Dile a tu agent “go back to using Opus for web search” y listo.

Source: Alex Finn’s cost optimization guide for OpenClaw. See Helpful Resources al final de este documento.

Regular Updates

# Check for updates
openclaw update --channel stable

# Or via npm
npm install -g openclaw@latest

# After updating, verify
openclaw --version
openclaw doctor
Enter fullscreen mode Exit fullscreen mode

Review Logs Regularly

Agarra el hábito de revisar qué ha estado haciendo tu agent:

# Quick look at recent gateway activity
openclaw channels status --probe

# Full status
openclaw status --all
Enter fullscreen mode Exit fullscreen mode

Si ves tool executions que no pediste, mensajes que no enviaste, o configuration changes que no hiciste, trátalo como un potential compromise y sigue los emergency procedures de arriba.


Set Up a Daily Self-Review

En vez de depender de ti para auditar manualmente los files del agent, haz que tu agent lo haga. Dile (vía Telegram o Discord):

“Set up a daily cron job that runs each morning. Review your own core files: MEMORY.md, SOUL.md, identity.md, agents.md, and your skills folder. Look for outdated information, conflicting rules, undocumented workflows, skills you created but no longer use, and lessons from recent failures. Summarize what you found and recommend any changes. Do not make changes without my approval.”

El bot creará un cron job y te mandará cada mañana un resumen. Esto evita que la configuración de tu agent se “desvíe” con semanas de uso. Se acumulan memories, se apilan skills, y aparecen conflictos sutiles. El housekeeping diario automatizado atrapa esto antes de que se vuelva problema.


Review MEMORY.md Yourself Monthly

El self-review diario atrapa drift técnico, pero igual deberías leer tú mismo ~/.openclaw/workspace/MEMORY.md una vez al mes. Después de algunas semanas, este file puede contener un profile detallado: tu situación de trabajo, relaciones, patrones de agenda, detalles de salud, frustraciones, y más. Si este file se exfiltra (por ejemplo vía prompt injection), es una mina de oro para social engineering.

Setea un recordatorio mensual en tu calendario para:

  1. Leer el memory file.
  2. Borrar cualquier cosa que no quieras que un attacker vea.
  3. Quitar lo que ya no sea accurate.

Rotate Credentials Quarterly

Setea un recordatorio para rotar:

  • Anthropic/OpenAI API keys
  • Discord bot token
  • Telegram bot token
  • Brave Search API key
  • Cualquier otro token que hayas conectado

Back Up Your Configuration and Data

Si llevas semanas construyendo skills, afinando la memoria del agent y conectando integraciones, perder eso dolería. Un simple config backup no basta. Necesitas una estrategia que cubra tanto tu code (configuration files, markdown files, skills) como tu data (databases, memory, logs).

Code backups: Push a GitHub

Tu ~/.openclaw/workspace/ contiene tus skills, markdown configuration files y prompts. Esto debería ser un repo privado de Git que syncée regularmente.

# Initialize the workspace as a git repo (one-time setup)
cd ~/.openclaw/workspace
git init
git remote add origin https://github.com/yourusername/openclaw-workspace.git
git add -A
git commit -m "Initial workspace backup"
git push -u origin main
Enter fullscreen mode Exit fullscreen mode

Una vez inicializado, puedes automatizar syncs por hora diciéndole a tu agent:

“Set up a cron job that runs every hour. Check for any changes in the workspace directory. If there are changes, commit them and push to GitHub. Include a brief commit message describing what changed.”

Esto captura cambios ya sea que los hiciste manualmente, con Cursor, o que el agent modificó sus propios files. Si llegas a un bad state, puedes hacer roll back a cualquier commit anterior.

Data backups: Guardar en Google Drive

Databases, analytics snapshots, CRM data y knowledge base content no deberían ir a GitHub (son muy grandes y cambian demasiado seguido). En su lugar, respáldalos a Google Drive en un schedule.

Si tienes Google Workspace conectado vía el goog plugin, dile a tu agent:

“Set up a daily cron job that backs up all local databases and data files to a dedicated folder in Google Drive. Timestamp each backup so I can restore to any specific date if needed.”

Documenta tu restore procedure

Los backups solo sirven si sabes restaurar. Crea un file en tu workspace llamado RESTORE.md que documente exactamente cómo reconstruir tu instancia de OpenClaw desde cero usando tu GitHub repo y Google Drive backups. Incluye pasos para reinstalar OpenClaw, clonar tu workspace repo, restaurar databases y reconectar integraciones. Actualiza este file cada vez que agregues una nueva integración o data source.

Crédito: Matthew Berman cubre esta arquitectura de backups en su OpenClaw deep dive: hourly GitHub syncs para code y Google Drive para database backups, con un restore procedure documentado en caso de pérdida total.

Moving to a new machine: Si alguna vez necesitas migrar tu instancia completa de OpenClaw a hardware nuevo (reemplazar la Mac Mini, upgrade, o recovery), los official docs ya incluyen un migration guide dedicado en https://docs.openclaw.ai/install/migration. Cubre transferencia de config, workspace, credentials y agent data. Tu RESTORE.md y tus backups de GitHub/Google Drive harán este proceso mucho más rápido.


Key Directories to Know

  • ~/.openclaw/ directorio de configuración principal
  • ~/.openclaw/openclaw.json archivo de configuración principal
  • ~/.openclaw/workspace Skills, prompts, memorias, esto puede ir en un private github repo.
  • ~/.openclaw/credentials. oauth an channel connections.
  • ~/.openclaw/agents datos y configuracion por agente.

Environment variable overrides: Si necesitas cambiar dónde OpenClaw guarda sus files (por ejemplo, en un external drive montado o un path no estándar), puedes setear estas environment variables en tu shell profile:

  • OPENCLAW_HOME Sbre escribe el directorio principal, por defect es ~/.openclaw/.
  • OPENCLAW_STATE_DIR Sobre escribe solo el directorio de estado.
  • OPENCLAW_CONFIG_PATH Sobre la ruta del archivo de configuracion

Para la mayoría en una Mac Mini dedicada, los defaults están bien. Estos overrides sirven sobre todo si corres OpenClaw en una máquina compartida, un server con data volume separado, o quieres mantener el config directory en encrypted external storage.


Useful Commands Reference

  • openclaw status Quick status check
  • openclaw health Health check
  • openclaw status –all Full debug report
  • openclaw doctor Diagnose issues and risky configs
  • openclaw doctor –fix Auto-fix issues found by doctor
  • openclaw security audit –deep Security audit
  • openclaw dashboard Open Control UI in browser
  • openclaw dashboard –no-open Print tokenized Control UI URL (for remote access or bookmarking)
  • openclaw gateway status Check if gateway is running
  • openclaw gateway restart Restart the gateway (after config changes)
  • openclaw channels status –probe Verify all messaging channels are connected
  • openclaw channels login Connect/reconnect messaging channels
  • openclaw pairing list List pending pairing requests
  • openclaw pairing approve Approve a pairing request
  • openclaw configure –section web Configure web search
  • openclaw update –channel stable Update to latest stable

In-session slash commands (use these inside the TUI or chat):

  • /new Start a fresh session (clears context window, keeps memories)
  • /compact Compress the current context window without losing the session - useful when you’re running long and want to keep going without starting over
  • /restart Restart the agent within the current session
  • /think high Set thinking level to high (deeper reasoning, slower, more expensive)
  • /think low Set thinking level to low (faster, cheaper, less deliberation)
  • /set Access runtime settings (model, thinking level, etc.)
  • /memory View or manage the agent’s memory files
  • /models List and switch available models

Fase 10: Set Up Outbound Email (Future Step)

Cuando estés listo para que tu agent mande emails a otras personas en tu nombre, vuelve a esta sección.

Why a Separate Email?

Tu infrastructure Gmail (yourname@gmail.com) maneja OAuth, account recovery y system operations. Nadie lo ve. Pero cuando tu agent le escribe a un recruiter, colleague o contacto, el “from” address es visible y debería ser claramente tuyo.

Step A: Preparar tu Outbound Email

Usa una cuenta Gmail separada que tenga tu nombre real — esto es lo que los recipients verán cuando tu agent mande email en tu nombre. Por ejemplo: firstname.lastname@gmail.com. Tu agent es tu assistant, no el autor.

  1. Verifica que puedes log in en https://accounts.google.com con firstname.lastname@gmail.com.
  2. Actualiza el password si hace falta y guárdalo en tu password manager.
  3. Habilita two-factor authentication si aún no está on.

Future upgrade: Si después quieres algo más polished, puedes setear un custom domain email vía Google Workspace (p. ej., you@yourdomain.com o ai@yourdomain.com, ~$7/mes). Pero firstname.lastname@gmail.com funciona bien para empezar.

Step B: Conectar el Gmail Skill

Instala el Gmail skill vía el Control UI o pidiéndoselo a tu agent (p. ej., “Set up Gmail integration”).

Cuando te pida authentication, sign in con firstname.lastname@gmail.com (no con el infrastructure Gmail).

Otorga los permisos solicitados (read, send, manage labels, etc.).

Prueba pidiéndole a tu agent: “Send a test email to [your personal email].”

Step C: Set Up Proactive Email Triggers (Optional)

Para Gmail Pub/Sub triggers (para que tu agent reaccione a incoming emails automáticamente), ve los official docs: https://docs.openclaw.ai (busca “Gmail Pub/Sub triggers”).

Key point: OpenClaw soporta múltiples account connections. Tu infrastructure Gmail (yourname@gmail.com) hace la plumbing, tu outbound email (firstname.lastname@gmail.com) hace la comunicación “human-facing”, y nunca se mezclan.


Quick Reference: The Critical Path

Si quieres el camino más corto desde máquina wiped a assistant funcionando, aquí va la versión condensada:

# 0. BEFORE wiping: Prepare Apple ID details and secure yourname@gmail.com

# 1. Erase Mac Mini via System Settings > General > Transfer or Reset
#    Create Apple ID during Setup Assistant with yourname@gmail.com
#    Decline Location Services, Siri, analytics, screen time

# 2. After setup, open Terminal
xcode-select --install

# 3. Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# (follow the PATH instructions it gives you)

# 4. Install Node.js
brew install node@22

# 5. Install OpenClaw
curl -fsSL https://openclaw.ai/install.sh | bash

# 6. Run onboarding (have your Anthropic API key ready)
openclaw onboard --install-daemon

# 7. Fix the heartbeat (biggest single cost saver)
#    Edit ~/.openclaw/openclaw.json, merge into agents.defaults:
#    "agents": { "defaults": { "heartbeat": { "model": "anthropic/claude-3-5-haiku-20241022", "every": "1h" } } }

# 8. Verify
openclaw health

# 9. SECURITY: Run the audit, lock permissions, set up Tailscale
openclaw security audit --deep
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/openclaw.json

# 10. Open dashboard and start chatting
openclaw dashboard --no-open   # Copy the tokenized URL to your browser
Enter fullscreen mode Exit fullscreen mode

Recursos Útiles

Top comments (0)