Documentation

SafeClaw is small on purpose: every capability should be visible.

SafeClaw runs as a local CLI assistant and optional WhatsApp webhook. It talks to OpenAI-compatible model providers, stores sessions locally, and routes tool calls through explicit permission checks.

Overview

The assistant loop accepts a task, sends the conversation and available tools to the configured model, executes approved tool calls, appends results to the session, and returns a final answer. Tool behavior is constrained by the active permission profile and approval mode.

safeclaw run "inspect my workspace and summarize the README"
safeclaw chat --session personal
safeclaw doctor --strict

CLI commands

CommandPurpose
runRun one task in a named session.
chatStart an interactive task loop.
toolsList available tool capabilities.
doctorCheck local setup, config, WhatsApp, and service readiness.
sessionsList saved sessions.
statusShow session status.
session-configSet per-session model and permission profile metadata.
memoryShow saved memory for a session.
memory-searchSearch local memory notes.
memory-editEdit a memory note by ID.
memory-forgetDelete memory by ID or matching text.
exportExport a session and its memory.
importImport a session export.
whatsappRun the Twilio-compatible WhatsApp webhook.
service-*Install, start, stop, inspect, or uninstall the macOS background service.

Permissions

Set the default profile in .env with SAFECLAW_PERMISSION_PROFILE. Override it per command with --permission-profile or per session with session-config.

SAFECLAW_PERMISSION_PROFILE=readonly
SAFECLAW_APPROVAL_MODE=ask
ALLOW_SHELL=false

safeclaw run "search for TODOs" --permission-profile readonly
safeclaw session-config personal --permission-profile workspace-write

Approval modes are ask, deny, and auto. WhatsApp and other non-interactive contexts block approval-required actions instead of waiting forever for terminal input.

Memory and sessions

Session history and memory are local files. Memory supports create, list, search, edit, delete, export, import, and automatic session compaction for long-running conversations.

safeclaw memory --session default
safeclaw memory-search "whatsapp" --session default
safeclaw memory-edit 2 "Use readonly by default"
safeclaw memory-forget 2
safeclaw export --session default --output safeclaw-session.json

WhatsApp

WhatsApp support is designed for remote access with deliberate boundaries. Configure Twilio credentials, allowed senders, and the public webhook URL ending in /whatsapp. Use service mode when you want SafeClaw to stay reachable while you walk away from the computer.

TWILIO_ACCOUNT_SID=...
TWILIO_AUTH_TOKEN=...
TWILIO_WHATSAPP_FROM=whatsapp:+14155238886
SAFECLAW_ALLOWED_SENDERS=whatsapp:+15551234567

safeclaw whatsapp --port 8080

Project structure

PathResponsibility
safeclaw/cli.pyTyper command definitions and terminal UX.
safeclaw/agent.pyAgent loop, tool-call execution, and session integration.
safeclaw/tools.pyWorkspace tools, permission gates, approvals, backups, shell, network, and messaging tools.
safeclaw/sessions.pyLocal session history, memory handler, compaction, export, and import.
safeclaw/whatsapp.pyTwilio webhook, allowlist checks, WhatsApp commands, and remote task handling.
safeclaw/doctor.pySetup diagnostics and actionable fixes.
install.shFast installer with opt-in global launcher.
guided-install.shStep-by-step terminal installer for non-devs.
mac-setup/Double-click macOS installer and WhatsApp walkthrough.
tests/Mocked tests, installer checks, memory tests, and opt-in live tests.

Support

SafeClaw is early and community-driven. Support helps cover hosting, testing, domain costs, and development time for the installer, WhatsApp flow, local model support, and safety model.

Buy the team a coffee