Introduction
OpenCrabs is a self-hosted, provider-agnostic AI orchestration agent that runs as a single Rust binary. It automates your terminal, browser, channels (Telegram/Discord/Slack/WhatsApp/Trello), and codebase, all while respecting your privacy and keeping you in control.
13,214 tests across providers, tools, channels, TUI, self-healing, and browser automation.
What Makes OpenCrabs Different
Zero Telemetry, Not Even Opt-In
- OpenCrabs does not phone home. Ever. No analytics, no tracking, no usage statistics, no remote logging, no crash reports
- Your conversations, tools, memory, configuration, and API keys never leave your machine
- The only outbound traffic is what you explicitly initiate: LLM API calls, web searches, GitHub commands, browser automation
- Not a privacy-policy checkbox: there is no telemetry code to disable, no opt-out flag, no analytics service to block. There is simply nothing to send
Provider-Agnostic by Design
- 18 built-in providers + Custom OpenAI Compatible: OpenCrabs (built in, free), Anthropic Claude, OpenAI, Gemini, Xiaomi MiMo, OpenRouter, Qwen (DashScope), MiniMax, Ollama, z.ai GLM, GitHub Copilot, Codex, Codex CLI, OpenCode, OpenCode CLI, Moonshot AI (Kimi), Command Code CLI, Claude CLI
- Native CLI integration: use Claude Code CLI, OpenCode CLI, Codex CLI, and Command Code CLI as providers without API keys
- Sticky fallback chain: auto-failover on rate limits or errors, health-aware persistence survives restarts
- Prompt caching across Anthropic, OpenRouter, Gemini, Qwen DashScope reduces costs up to 95%
- Context window override: cap or expand context for any model via config (the built-in OpenCrabs provider is the exception: its window is fixed at 200k)
- Xiaomi MiMo: 30+ models including the MiMo reasoning series, keyed provider
- Moonshot AI (Kimi): API plan (api.moonshot.ai) and Coding plan (api.kimi.com) endpoints, reasoning-effort config, plan-tier context window
Multi-Agent Orchestration
- Sessions are fully isolated agents: each with its own brain, provider, model, working directory, and history
- Typed sub-agents:
general,explore,plan,code,researchwith tailored tool access - Team orchestration:
team_create,team_broadcast,team_deletefor coordinated workflows - Per-call provider/model overrides: mix models across teams (plan with GLM, code with Deepseek, review with Kimi)
- A2A protocol: JSON-RPC 2.0 gateway for agent-to-agent communication
Channel-Native Communication
- Telegram, Discord, Slack, WhatsApp, Trello, full bot integration with DMs, groups, and threads
- Telegram rich messages: native tables, headings, lists, math via
rich_messagesconfig - Draft message streaming: live “typing…” updates as tokens generate in DMs
- Collapsible blocks:
<details>/<summary>sections for long outputs - Forum topic session isolation: each topic in Telegram supergroups gets its own session
- Telegram reactions: the bot reads inbound emoji reactions and can reply with a reaction instead of a message when that fits
- Frame reactions (v0.3.61): inbound reactions read by sentiment, agent addresses user by first name
- Mid-turn reactions (v0.3.61): a reaction during a running turn injects into the current loop instead of firing a second turn
- Follow-up suggestions (v0.3.69): tap-to-send optional follow-ups on Telegram, Discord, Slack, WhatsApp; fill-not-submit in TUI
- Telegram plan card re-stick (v0.3.71): re-stick plan card and fold prose into it when buried
- Full group history capture (v0.3.73): persist every group message to history, even from non-allowlisted senders and bots
- Correct group speaker (v0.3.73): stop addressing a group-history sender as the current speaker
- Session inheritance:
/newinherits the working directory from your most recent session /goalacross all channels: set autonomous goals from Telegram, Discord, Slack, WhatsApp- Voice support: local Whisper STT + Piper TTS, fully offline
- Cross-channel crash recovery: pending requests route back to originating channel on restart
/cowork: create shared workspaces from channels and TUI/rename,/profiles,/cd, manage sessions, profiles, and directories from any channel
Self-Healing & Self-Improvement
-
Recursive Self-Improvement (RSI): agent analyzes performance, identifies patterns, and rewrites brain files
-
Phantom tool call detection: catches when the model narrates changes without executing tools
-
Self-heal phantom detection (v0.3.72): catch zero-tool turns that claim high-stakes side-effects (ship/push/tag/release)
-
Config edits via config_manager only (v0.3.74): the agent never raw-edits config.toml/keys.toml; every write is validated before it lands
-
Brain dedup (v0.3.75):
/dedupcommand plus post-write and weekly cross-file scans keep brain files from drifting into duplication, with Telegram inline-keyboard approval -
Brain-file hints on tool misses (v0.3.75): relevant brain notes surface automatically when a tool call misses or errors
-
Proactive memory surfacing (v0.3.76): relevant memory surfaces without being asked when conversation context matches stored knowledge
-
Natural model naming (v0.3.76):
/models opusworks; colloquial names resolve to exact model IDs -
Plan/execute provider routing (v0.3.76): route planning and execution onto separate providers/models
-
Thinking-loop timeout (v0.3.78): catches infinite reasoning loops, fires phantom enforcement with sticky fallback
-
Epistemic engine (v0.3.78): belief tracking with confidence levels, OODA/BDI cognitive mesh, Orient gate before plan execution
-
Ralph verification gate (v0.3.78): criteria-aware task verification with iteration cap; tasks must meet stated acceptance criteria
-
TOML safety gates (v0.3.78): runtime-configurable bash blocklist with hot-reload, quoted-secret redaction, brain file verification
-
Mission Control analytics (v0.3.78): D/W/M filter, 3-across card grid, phantom/model/streaming tabs, dedicated events DB
-
OpenAI TTS onboarding (v0.3.78): voice selector and API key field in the onboarding wizard
-
Homebrew install (v0.3.79):
brew install opencrabsfrom homebrew-core: prebuilt binary, both architectures, no Rust toolchain -
/restartand/exit(v0.3.79): restart or shut down from any channel or the TUI; owner-only on channels, announce before acting -
Quota circuit breaker (v0.3.79): quota-exhausted providers get a TTL breaker and are skipped in fallback walks; chain exhaustion reported explicitly
-
Plan state across sessions (v0.3.79): plans survive session boundaries; isolated plan-task execution defaults on, Ralph verifies in the session’s own directory
-
Theme system (v0.5.0): verified presets, an interactive picker, and your own themes from
~/.opencrabs/themes/*.toml; truecolor is detected with an ANSI-256 fallback tier, and a preset whose contrast would make text unreadable is refused -
Structural code memory (v0.5.0): tree-sitter builds a symbol and call-graph index beside the text index, so “who calls X” walks real call edges while conceptual questions keep the text lane (#1324)
-
Drop transfer over SSH (v0.5.0): a file dropped into a TUI running on a remote host is pulled back through the connection already open, with an
opencrabs drop-agenton the client side (#1289) -
Notify delivery verdicts (v0.5.0):
session_notifyreturns a machine-readable send result, depth-3 injection receipts makenotify_idcheckable, and delivery redirects to the session that owns the channel now -
Background compaction (v0.5.0): the summariser runs off the turn instead of holding the session while it works
-
Token redaction at the writer (v0.5.0): a provider error carrying a URL can no longer leak the bot token into a log, wherever it is logged from (#1322)
-
Receive-only Telegram userbot (v0.5.0, experimental): feature-gated MTProto capture with local QR/code/2FA login; it stores allowlisted text for retrieval and never acts as the user
-
Temporal grounding (v0.5.1): the agent always knows what time it is: every turn carries a time-stamped marker in the user’s timezone, and the system prompt stays byte-stable for provider caching (#1516)
-
Per-job cron sessions (v0.5.1): every scheduled job gets its own session, so two jobs running at the same time can never bleed into each other’s context or providers (#1511)
-
Skill-glob gating (v0.5.1): a skill’s
globs:list can refuse tool calls that touch matching files until the agent has actually read the skill body (#1515) -
Config writes validated against the struct (v0.5.1), the write guard and section suggestions in config_manager now derive from the
Configtype itself, so they never drift from shipped code (#1508) -
Plan designs refused at write time (v0.5.1): a malformed plan design bounces immediately with the missing sections named, and a refused write restores the scaffold instead of wiping the draft (#1507)
-
Provider budget backpressure (v0.5.1): a provider that reports an output-token budget triggers one bounded compaction and retry instead of a cascade of 400s (#1518)
-
A2A tokens bound and config owner-only (v0.5.1): A2A tokens bind to the gateway that minted them, and config.toml/keys.toml move to owner-exclusive mode with secrets scrubbed from the logs
-
ACP server mode (v0.5.2):
opencrabs acpspeaks the Agent Client Protocol over stdio JSON-RPC, so Zed, MonoCode and any ACP client drive the same brain your channels use, with progress streaming and approvals round-tripping to the editor (#1540) -
Shadow-DOM aware browsing (v0.5.2): selector resolution pierces shadow roots, so automation reaches web components that used to be invisible to the tools
-
WhatsApp full surface (v0.5.2): native voice notes, inbound video/sticker/location/contact, poll votes, presence and media recovery, reaction acks, edit-in-place streaming, disappearing messages, contact blocking, pin/forward/profile, status updates, newsletter discovery, native-flow buttons, per-chat history
-
Discord live tracing and native tables (v0.5.2): long turns stream as a traced live reply, answers auto-thread, markdown tables render natively, and tool turns no longer double-post the final response (#1603, #1608)
-
Telegram forum topics and /clear (v0.5.2): forum topic create/rename with session binding, and /clear starts a fresh session without the summariser call (#1585)
-
Command menu payload budget (v0.5.2): Telegram’s setMyCommands silently rejects request bodies over ~7.8KB while reporting BOT_COMMANDS_TOO_MUCH; descriptions now shorten in tiers so the whole menu fits (#1613)
-
Trigger-gated cron (v0.5.3): a job runs a pre-flight check and only executes when your condition is met (non-empty output, exit code, regex), skipped runs cost 0 tokens, and a fired trigger can dispatch a goal into a session (#233)
-
First-class Windows (v0.5.3): platform shell handling, BOM/UTF-16 file reads, tilde and cwd fallbacks, with CI building Windows and gating PRs (#627)
-
Epistemic memory (v0.5.3): MEMORY.md facts carry confidence and decay (#1643), cold sections archive themselves, and
opencrabs memory prunepreviews what went cold before touching it (#1657) -
Finished theme engine (v0.5.3): every TUI widget resolves through the theme with a suite guard against new raw ANSI, and themes can declare a canvas background (#1634)
-
WhatsApp suggestion polls (v0.5.3): follow-up option sets past the native button cap render as a poll, and a vote selects the option (#1616)
-
ACP session family (v0.5.4): sessions are first-class on the ACP surface: the context meter is restored on load and rides usage updates,
session/loadreplays the transcript and restores the per-session model,set_modelpersists across processes, nativesession/set_modeapplies the approval policy server-side,session/compactpushes, andsession/newoffers a live model catalog -
Interactive terminal handoff (v0.5.4):
!vi/!nanotake over the terminal interactively and hand it back with the session intact; Unix terminals only, Windows keeps pipe capture (#1744, #1759) -
Universal paste & drop (v0.5.4): one shared attachment router accepts every file type on paste or drop and classifies code, docs, archives and data so each lands in the right pipeline (#1740, #1743)
-
Serper search engine (v0.5.4):
serper_searchadds Google SERP results, and the web_search fan-out dedupes by URL across engines (#1731) -
Decision cache (v0.5.4):
decide_cachedanswers repeat decisions from an L1 reuse ring with shadow/live tiers and[decisions]config (#1648) -
Provider-reported costs and one timeout chain (v0.5.4), the usage ledger prefers the cost the provider actually reported over table estimates (#1707), and timeout flags resolve
[providers.<name>]->[agent]-> default across every provider (#1688) -
Compiled /architecture and /attach, opt-in audit trail (v0.5.4), both commands ship as compiled arms, and an opt-in audit trail records what ran with a
/auditviewer (#933, #1705) -
Discord native surface (v0.5.5): polls via
send_poll, TTS answers delivered as voice messages, andcommands.tomlprojected onto native slash commands so your own commands show up in Discord’s picker (#1848, #1849, #1850) -
Flow groups and write governors (v0.5.5): Discord and Slack open the flow group at turn start with a live clock covering thinking and activity text leading the line, and one outbound governor budgets every edit and parks on 429s (#1841, #1843, #1844, #1845, #1807, #1808, #1809, #1910, #1912, #2012)
-
/respond_to and /cowork (v0.5.5): per-channel respond_to and open modes in config, plus the two commands to set them from inside the channel itself (#2014, #2015)
-
Telegram rate discipline (v0.5.5): instrumented getUpdates polls and handler handoffs for stall triage, a cross-surface sub-second spacing floor with admission telemetry, a per-chat 429 pause behind one Cooldown accessor, and markdown links to local files delivered as documents (#1927, #1916, #1968)
-
ACP v1 session lifecycle (v0.5.5): the five v1 session lifecycle methods are implemented and the plan is published as a native v1 plan update (#1815)
-
TUI dialog footer, clickable URLs, onboarding timeline (v0.5.5): every dialog shares one command footer with direct a/r approval verbs, URLs and file paths are clickable, and onboarding is rebuilt as a left-side step timeline with direct setup commands (#1775, #1772, #1979, #1980, #1981, #1982)
-
Cron one-shot retirement (v0.5.5): one-shot jobs retire on delivery instead of re-firing a year later, every delivered run carries its run id, and Discord cron reports arrive as one forum post (#544, #1703, #1851)
-
Zero-setup first run (v0.5.11): a fresh install lands in the chat with the built-in provider already provisioned,
config.tomlandkeys.tomlseeded, and the agent greeting you. The wizard is opt-in through/onboardor--onboard(#2079) -
A first turn that cannot abort the process (v0.5.11): agent worker threads run on a 16 MiB stack, so the first turn no longer overflows the default one (#2080)
-
Release tags gated on green CI (v0.5.11): the release workflow reads the conclusion of the commit’s own CI run before publishing. A red run fails the release, a run still in flight is waited for, and a commit with no run fails too (#2078)
-
Evolve restarts the right units (v0.5.11): the scheduled restart targets resolved unit names instead of the
opencrabs*.servicediscovery glob, which also matched the transient unit running the restart and made systemd stop its own executor (#2081) -
Telegram guests get the full surface (v0.5.12): a tag in a chat the bot was never invited to runs the same tool surface, live status block and rich rendering as a normal turn, with one cancellable turn per guest session and rate limiting (#2087, #2109, #2133, #2135, #2138, #2143)
-
A plan is required past a tool-call threshold (v0.5.12): once a turn crosses a threshold of tool calls the agent must stop and write a plan before it continues (#2128)
-
The transcript survives a session switch (v0.5.12): the fold map is keyed by a stable role and timestamp anchor instead of a UUID minted per render, so switching sessions and coming back no longer folds every turn you had opened (#2155)
-
Headless installs provision the built-in provider (v0.5.12):
opencrabs run,daemon,agent,acpandcronmint the built-in token on a fresh home the way the TUI already did, whilestatusanddoctorstay read-only (#2151) -
Arabic and Chinese language packs (v0.5.14): two more packs join the phantom detector, each with its own script detection, and Han characters route to the Chinese pack while kana or hangul keep Japanese and Korean text off that branch (#2222, #2223)
-
Comparable coverage across the packs (v0.5.14): the non-English packs now carry intent phrases at the same order of magnitude as English instead of roughly a third of it, and a test pins one caught announcement and one clean sentence per language (#2225)
-
European Portuguese continuous narration (v0.5.14):
estou a carregarstyle constructions are caught next to the Brazilian gerund, which a lookahead that silently failed to compile had taken down with it (#2224) -
Byte-safe edit operations (v0.5.14): the line operations in
edit_fileno longer drop a file’s final newline or rewrite a CRLF file as LF, andhashline_editplus the fuzzy fallback keep the file’s own line ending (#2227, #2212) -
A lint that stops byte-slice panics (v0.5.14): CI fails on a new slice that could split a UTF-8 character, added after a multi-byte whitespace bug in the phantom URL check (#2220, #2221)
-
Ctrl+O keeps your place (v0.5.15): expanding a turn whose header is off screen no longer throws the viewport to the top of the turn, and the toggle stops silently disarming auto-scroll (#2241)
-
The queue row sits under the thinking line again (v0.5.15): the queued-message feedback is a soft gray hierarchy instead of amber and near-white, and a rendered test reads the actual cell colours so a brightness regression fails CI (#2244)
-
The terminal survives a caught panic (v0.5.15): the panic hook restores raw mode, so keystrokes keep working after a render panic is caught (#2238)
-
The built-in endpoint is harder to starve (v0.5.15):
inference.opencrabs.comgets a 120s handshake budget and the retry ladder stops after 2 silent timeouts, worst case on a dead endpoint dropping from 315s to about 241s (#2232) -
Endpoint detection parses the host (v0.5.15): the built-in endpoint is matched by parsed hostname, not substring, so a URL that merely contains the hostname cannot impersonate it (#2234)
-
Enter says what it does (v0.5.15): the input box, the queue row and the history marker now describe the queue-while-running flow, and ↑ pulls a queued message back into the box (#2236, #2237, #2242)
-
Halting mid-turn keeps the narration (v0.5.15): a turn halted by an interactive prompt renders the intermediate narration as its answer instead of dropping it (#2240)
-
Dispatcher and evolve recovery (v0.5.15): the Telegram dispatcher recovers from a failed startup instead of panicking, and
/evolveretries dropped release-asset fetches, telling a bad checksum from a dead connection (#2228, #2229) -
The desktop app ships in every archive (v0.6.0): all five targets carry
opencrabs-guibesideopencrabs, macOS gets a second bundle that opens the window on double click, and Linux gets its own launcher entry. Whichever app starts owns the profile: it claims the instance lock, serves your channels, runs cron and keeps background work alive (#2905) -
Seeker finds anything from one card (v0.6.0):
alt+spaceopens it in the terminal and in the window, withcmd+kas the window’s alias. It searches conversations, slash commands, the screens the app can open, the saved skills and the documentation pages, and runs the row on Enter (#2458, #2460) -
The window has four themes, a font row and transparency (v0.6.0):
autofollows the system appearance,orgnis the window’s own dark palette,lightis a native soft light palette andcustomtakes an accent from a hue wheel plus the background it sits on. A Font row lists the families the machine actually has, and the whole window fades up to 40 percent (#2619, #2786, #2922) -
A settings card configures the agent without leaving the window (v0.6.0):
ctrl+commaopens one card over the conversation for approval policy, notifications, redaction, lazy tools, the thinking-loop interval, debug logging, memory knobs and credentials (#2878, #2890) -
A projects screen with batch assignment and in-place repair (v0.6.0):
alt+popens project and session cards backed by the same service the terminal uses, and assigning, moving or clearing runs as one guarded operation over the selection (#2669, #2886) -
Edit, react, reply, forward and copy any message (v0.6.0): a stored row offers Edit on hover, React from the crab pack, Reply that quotes the picked rows, Forward that stages into the destination composer for review, and Copy as Markdown from its own corner. A turn in flight carries the same actions on the exact live entry (#2826, #2825, #2827, #2924, #2750, #2925)
-
A Windows exe that starts on a clean install (v0.6.0): the zip carries the four MSVC runtime DLLs beside both exes, so the archive starts with no Visual Studio and no vc_redist, and CI reads the PE import table so a regression cannot ship (#2257)
-
An idle split window stops burning frames (v0.6.0): the rail’s animation probe now resolves on the repaint cadence and its answer is reused in between, and the status row is resolved once per frame for every leaf instead of twice each (#2909)
-
Your session titles stay the ones you gave them (v0.6.0): drift retitling applies to channel sessions only, because a short hand-picked title is nearly always word-disjoint from the last few turns and applying drift there renamed local sessions against the owner’s will (#2882)
-
Voice messages in the window (v0.6.1): record from the composer microphone, hear it back with a seekable waveform, read the folded transcript, and the agent answers aloud only for the turn you spoke to (#3044, #3092, #3054, #3111, #3096)
-
The Seeker is liquid glass and a calculator (v0.6.1): the recording orb is a procedural glass renderer animated by the voice wave, and a typed sum is evaluated with the answer printed above every row (#3044, #3050, #3066)
-
The instance rail connects crabs to crabs (v0.6.1): pair one window to another from the rail’s mark, hand a crab across, and read the remote transcript in place. A2A gains
session/list,session/transcriptandtasks/list, and a pairing code can mint a session shorter than 30 days (#2873, #2874, #2875) -
A hint row under the composer (v0.6.1): the card rides on the composer and names the task, the follow-up offer becomes a card the arrows can walk, and a dismissed hint stays hidden for seven days (#2279, #3102, #3101, #3120)
-
Background tasks are visible and stoppable (v0.6.1):
/taskslists them with their output on both frontends, and the strip opens into a list, a detail view and a cancel (#2940) -
cmd/ctrl+1..9jumps to the nth topic (v0.6.1): topics win over sessions, digit 0 opens the tenth (#3166) -
The window hot-reloads config.toml (v0.6.1): one reload pass serves both front ends, no restart (#3040)
-
doctor –fix repair mode (v0.3.83): stuck cron rows, stale markers and broken permissions are repaired on the spot instead of only reported
-
Per-path write locks (v0.3.83): concurrent writes to the same file serialize; the last writer no longer silently wins
-
Sub-agent worktree isolation (v0.3.83): each child agent gets its own worktree and branch, so a fan-out cannot clobber the shared tree
-
Type-aware acceptance criteria (v0.3.83): plan criteria are enforced against the toolchain the project actually uses (#1133)
-
Project-aware plan verification (v0.3.83): plans verify with the project’s own commands, not always cargo, and find the project from the session’s folder
-
/stop cancels immediately (v0.3.83): interrupts during provider handshake and retry backoffs (#1148)
-
A2A session resume (v0.3.83): sessions resume by context id, the gateway is profile-addressed (#1159, #1161)
-
DeepSeek thinking knobs (v0.3.83): DeepSeek gets the thinking parameters it actually reads, plus tool-call-only turn handling
-
session_id log correlation (v0.3.82): every turn opens a tracing span carrying its session id, and cron jobs and the RSI engine get their own, so one grep reconstructs a whole turn out of a shared daily log
-
Logger reliability (v0.3.82): the logger stops dropping events and stops writing to the TUI’s terminal; a stalled write can no longer silence every other thread’s logging
-
User-owned brain files protected (v0.3.82): SOUL.md, USER.md and MEMORY.md are never merged into from upstream, and directives route to AGENTS.md, which is always loaded
-
Config section unification (v0.3.82): the legacy
[gateway]spelling is migrated on disk to[a2a], so one name survives a reload round trip -
Chunk-hash caching (v0.3.82): memory skips re-embedding chunks whose content has not changed
-
Pre-release binaries (v0.3.82): five platform targets plus SHA256SUMS, published as a rolling pre-release so contributors can test unreleased code without waiting for a tag. Run on demand, not on every push
-
Rate-limit bail (v0.3.82): a long Telegram rate-limit window returns immediately instead of parking the send inline
-
In-tree memory store (v0.3.81): the qmd dependency is dropped; SQLite FTS5 + vector search owned in-tree
-
External index paths (v0.3.81): memory search reads indexes outside the profile directory, default-deny in shared sessions
-
Mermaid as images on Telegram (v0.3.81): diagrams render as images while tables stay native formatting
-
Qwen reasoning across turns (v0.3.81): preserve_thinking, family-gated thinking knobs, recommended effort tier by default, hosted Qwen reachable everywhere
-
keys.toml key-loss fix (v0.3.81), provider API keys no longer dropped at runtime; poisoned keys self-heal
-
Early loop detection (v0.3.81): repeating tool rounds caught before the provider rejects the turn
-
RSI engine gate (v0.3.81): autonomous RSI off by default for headless daemons, opt in with
rsi_enabled -
memory_search scope (v0.3.80): search daily logs (
memory), brain files (brain), or both (all); brain files are indexed on write -
Chunked memory retrieval (v0.3.80): documents chunked before embedding so later chunks are searchable; recall ranked with BM25
-
Slack-native rendering (v0.3.80): tables and headings arrive in Slack’s own shape instead of raw markdown
-
Owner-gated channel commands (v0.3.80): custom commands and skills are owner-only on the channel catch-all arm in groups
-
RSI convergence gates (v0.3.80): self-improvement pauses on convergence, backs off on zero-improvement streaks, hashes findings by stable identity
-
Loop guards (v0.3.80): announcement and near-match repetition guards on all tools; loop-detector kills reach the fallback chain
-
Browser inventory mode (v0.3.80): bare
browser_findenumerates every clickable element on the page -
Brain-file template updates (v0.3.80): AGENTS.md, BOOT.md, and SOUL.md templates changed; seeding never overwrites existing files, so diff against
src/docs/reference/templates/and merge by hand if you want the new defaults -
System brain rebuild: brain files rebuilt from disk when changed, no restart needed
-
Proactive tool discovery: searches for available tools before claiming inability
-
Multilanguage prompt analyzer (v0.3.67): shared PromptAnalyzer with soft-nudge on TUI and Telegram, 6 language packs (EN/ES/FR/ID/PT/RU)
-
Plan mode (v0.3.67-v0.3.68): design/checklist tracks, persistent plan card,
/plan <query>command, agent self-approval when user grants autonomy -
Click-to-expand (v0.3.69): left-click a tool-call or reasoning block to expand just that block, complementing Ctrl+O
-
Skills review_gate (v0.3.70): frontmatter declaration for high-stakes skills that require user approval before side effects
-
JIT tool activation: extended tools activated on-demand, no pre-registration needed
-
Config auto-repair: auto-repair broken config.toml, never poison last-good config
-
Context budget management: 65% soft / 90% hard compaction thresholds with LLM fallback
-
Stuck stream detection: 2048-byte rolling window catches repeating patterns
-
Gaslighting defense: strips tool-refusal preambles mid-turn
-
Deliver build outcomes (v0.3.61): rebuild/evolve results reach whoever asked, across channels and TUI
Terminal UI
- Native markdown rendering: emphasis, lists, links, and task items render directly in the terminal
- Real-time tok/s throughput meter: live tokens-per-second during streaming
- Version display (v0.3.73): show the running version on the TUI header and in channel /help + /usage
- 3-state reasoning expand (v0.3.74): click or Ctrl+O cycles a reasoning block collapsed → capped → full, so it never floods the view
- Per-turn headers (v0.3.75): every turn gets a one-line summary header, its working-out folds into it, and turns fold by default so the view stays clean
- Group tool calls (v0.3.61): consecutive tool calls collapse into one expandable block, keeping the TUI clean during multi-step operations
- Fold intermediate text (v0.3.61): intermediate processing text folds into the same in-place log as tool calls, so only the final answer stays visible
- Session search: search filter + viewport scroll across all sessions
- Split panes: tmux-style parallel sessions with layout persistence
- Clipboard image paste: paste images from browser or any app directly into TUI
- Plan pinning: active plan pinned at end of prompt each turn
- Agent-driven onboarding: personalized first-time setup with guided flow
/goalautonomous loop: set a goal and the agent loops until an LLM judge says it’s done, with pause/resume/status controls- Self-goaling (v0.3.61): agent can set and drive its own multi-turn goals via
goal_managetool without user invoking/goal
Developer Experience
- 50+ built-in tools: file ops, bash, web search, code execution, browser automation, image gen, voice, PDF rendering
- Unified parallel web search (v0.3.73): web_search, exa_search, and brave_search fan out in parallel under a single web_search tool
- web_scrape: native URL-to-markdown scraping with SSRF protection, sitemap crawling, JS-shell detection, and profile-aware export
- DDG captcha detection (v0.3.73): detect DuckDuckGo captcha via HTTP 202 + structural form check
- Built-in /github skill: full gh CLI control for issues, PRs, code reviews, repo management
- Proactive tool discovery: agent finds tools before saying “I can’t”
- Skills system: workflow templates with fuzzy-finding, auto-registered as slash commands
- Dynamic tools: runtime-defined via TOML (HTTP + shell executors)
- Projects system: dedicated sessions with per-project brain overlays, file archiving, and color badges
- Hashline editing: hash-anchored file editing with batch support and collision detection
- Mission Control: full-screen dashboard with RSI inbox, activity log, and cron schedule
- RTK auto-download: bundled 4MB proxy for 53.5% token savings on 100+ commands
- Confidential file protection: SSH keys, .env, credentials protected by default
- AGENTS always-loaded: hard rules and governance enforced every turn
- Config-driven debug_logs (v0.3.71): toggle debug logs with hot-reload, no restart needed
- Secret redaction scope (v0.3.71): scope redaction to global/group/DM with
/redactcommand - Secret redaction scope (v0.3.71): scope redaction to global/group/DM with
/redactcommand - Config-driven debug_logs (v0.3.71): toggle debug logs with hot-reload, no restart needed
- Tmux watchdog (v0.3.71): pane-only kill, 30s warning, auto-reattach
- Plan-gate three-state (v0.3.71): GateDecision with bash going to approval in post-init Editing
- MCP-style ToolHints (v0.3.71): risk model for tool classification, drives plan gate
Browser Automation
- Full CDP support: navigate, click, type, screenshot, JS eval, find elements
- Headless or headed mode with element-specific screenshots
- Cookie/session persistence across browser sessions
- Per-session tab isolation: no cross-session DOM stomping
Project Directive Discovery (v0.3.59)
OpenCrabs auto-discovers rule files that other AI coding tools drop in a repo. Point the agent at any repository (via /cd, a channel workspace, or launching inside one) and it scans for conventions shipped by Claude Code, Cursor, Windsurf, Cline, Gemini CLI, GitHub Copilot, OpenCode, and the cross-tool AGENTS.md standard. No config, no import step.
| Source | Files |
|---|---|
| Cross-tool standard | AGENTS.md |
| Claude Code | CLAUDE.md, CLAUDE.local.md, .claude/CLAUDE.md, .claude/rules/**/*.md |
| Cursor | .cursorrules, .cursor/rules/**/*.mdc |
| Windsurf | .windsurfrules |
| Cline | .clinerules (file or .clinerules/**/*.{md,txt}) |
| Gemini CLI | GEMINI.md |
| GitHub Copilot | .github/copilot-instructions.md |
| OpenCode | .opencode/AGENTS.md |
The index rebuilds when you /cd into a new directory, so directive files are always current.
Quick Start
# Install (Linux and macOS)
curl -fsSL https://opencrabs.com/install.sh | bash
# Or via Cargo (requires Rust 1.94+)
cargo install opencrabs --locked
The installer resolves the latest release, checks the download against the published SHA256SUMS, and leaves a callable opencrabs command. On macOS that command is a symlink into ~/Applications/OpenCrabs.app, so do not go looking for a loose binary next to the extracted archive. Every flag and the manual per-platform routes are on Installation.
Auto-update enabled by default. Disable with [agent] auto_update = false in ~/.opencrabs/config.toml.
Architecture
┌─────────────────────────────────────────┐
│ OpenCrabs Binary │
│ (Single 34-36 MB Rust executable) │
├─────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────────┐ │
│ │ TUI │ │ CLI Daemon │ │
│ │ (crossterm)│ │ (systemd/launchd)││
│ └─────────────┘ └─────────────────┘ │
│ │
│ ┌─────────────────────────────────┐ │
│ │ Provider Registry │ │
│ │ 15 built-in + Custom OpenAI │ │
│ │ Sticky fallback chain │ │
│ └─────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────┐ │
│ │ Tool Layer │ │
│ │ 50+ built-in tools │ │
│ │ Dynamic tools via TOML │ │
│ │ JIT activation │ │
│ └─────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────┐ │
│ │ Channel Adapters │ │
│ │ Telegram / Discord / Slack / │ │
│ │ WhatsApp / Trello / Voice │ │
│ └────────────────���────────────────┘ │
│ │
│ ┌─────────────────────────────────┐ │
│ │ Self-Healing Layer │ │
│ │ Context budget / Stuck stream │ │
│ │ Phantom detection / RSI │ │
│ └─────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────┐ │
│ │ Persistence │ │
│ │ SQLite + Brain files │ │
│ │ FTS5 + vector search │ │
│ └─────────────────────────────────┘ │
└─────────────────────────────────────────┘
Next Steps
- Installation: Install and configure
- Configuration: All config options
- Providers: Connect your LLM backends
- Channels: Connect Telegram, Discord, etc.
- Tools: Explore 50+ built-in capabilities
- Self-Healing: Resilience features
- Multi-Agent: Orchestrate sub-agents and teams
Community & Support
- Telegram community: join the OpenCrabs group for questions, tips, and release chatter
- Sponsor on GitHub: back the project and keep the crabs fed
- Buy Me a Coffee: one-time support if OpenCrabs saved you an afternoon
Found a bug or want a feature? Open an issue on GitHub.
Installation
Five ways to get OpenCrabs running. Every install gives you two apps over the same agent: opencrabs, the terminal app, and opencrabs-gui, the desktop app, a native window with the same brain, sessions and config. See Desktop App for what the window does.
Desktop app requirements
The terminal app has no display needs. The desktop app draws a real window, so on Linux it needs a few extra system libraries the terminal never touches:
| Package | Why |
|---|---|
libxkbcommon0 + libxkbcommon-x11-0 | Keyboard input over X11 |
libxcb1 | X11 connection |
libvulkan1 + mesa-vulkan-drivers | Rendering. Without a GPU driver the Mesa software renderer (lavapipe) covers it |
libwayland-client0 | Wayland sessions |
On Ubuntu/Debian:
sudo apt install -y libxkbcommon0 libxkbcommon-x11-0 libxcb1 libvulkan1 mesa-vulkan-drivers libwayland-client0
macOS (11+) and Windows need nothing beyond what the terminal app already needs: the desktop app links the platform frameworks and ships the MSVC runtime DLLs beside it.
Quick install (Linux and macOS)
The fastest path. One command resolves the latest release, checks your platform, verifies the download against the published SHA256SUMS, installs opencrabs and the rtk helper, and installs the system libraries the Linux build needs.
curl -fsSL https://opencrabs.com/install.sh | bash
Only want the desktop app? Same command with the --client desktop flag:
curl -fsSL https://opencrabs.com/install.sh | bash -s -- --client desktop
On Windows, use PowerShell:
iwr -useb https://opencrabs.com/install.ps1 | iex
On macOS the CLI is a symlink into ~/Applications/OpenCrabs.app, because the icon needs a bundle to live in. On Linux it installs to /usr/local/bin when that directory is writable, otherwise to ~/.local/bin, and it asks for sudo when the target needs it. When the install directory is not on your PATH, the script writes the entry into your shell startup file so the next terminal can run opencrabs; pass --no-path to leave your shell files alone. It refuses to install when glibc is older than 2.38 (Ubuntu 24.04+, Debian 13+, Fedora 39+) or when the system uses musl, and it names the package to install instead of failing silently.
Flags go after bash -s -- when you pipe the script:
| Flag | Effect |
|---|---|
--dry-run | Print the plan, download nothing |
--version <tag> | Install a specific release instead of the latest |
--dir <path> | Install into a different directory |
--no-deps | Leave the system package manager alone |
--no-path | Do not write a PATH entry into your shell startup file |
--client <which> | Install desktop, terminal or both (the default). Every archive carries both apps, so this picks what lands on disk |
--no-launch | Do not start OpenCrabs when the install finishes |
Both scripts are plain shell and PowerShell, readable before you run them: install.sh and install.ps1.
Two apps in every archive (v0.6.0)
Every release archive carries both clients: opencrabs is the terminal app and opencrabs-gui is the window. The installer lands both, because a download that quietly drops one leaves you with a client you cannot start. Pass --client desktop when you only want the window, --client terminal when you only want the terminal, and --client both (the default) for the pair.
On macOS the archive holds two bundles. OpenCrabs.app is the terminal app and OpenCrabs Desktop.app is the window, so a double click opens the one you picked instead of always landing in the terminal. On Linux the archive carries opencrabs.desktop and opencrabs-gui.desktop with opencrabs.png, so both clients get a menu entry and a real icon rather than the generic exec glyph.
Either one can start the session. Whichever you launch claims the profile: it takes the profile from a running background daemon, serves your channels, runs cron and keeps background work alive, so the app you opened is the app doing the work.
The installer starts OpenCrabs for you when it finishes, so a one-liner ends in the chat rather than in an instruction to type a second command. It only does that when a terminal is actually attached: a piped run, a redirected console, or CI keeps the old Run: opencrabs advice, because a TUI cannot draw into a log file. Pass --no-launch or -NoLaunch to install without starting it.
Option 1: Homebrew (recommended on macOS and Linux)
brew install opencrabs
OpenCrabs is in homebrew-core. Homebrew ships prebuilt bottles for Apple Silicon Macs (macOS 15 and newer) and for Linux amd64 and arm64, so no Rust toolchain is needed there. On an Intel Mac, Homebrew builds it from source instead; use the macos-amd64 release binary if you’d rather skip the build.
Run opencrabs after install. It goes straight to the chat with its built-in provider already live, so the crab greets you and you can start talking. Run opencrabs --onboard when you want the setup wizard.
Option 2: Download Binary (all platforms)
Grab a pre-built binary from GitHub Releases.
Linux (amd64)
One line on purpose: a pasted block whose TAG= assignment runs alone, or whose trailing newline fires the binary before the download finishes, is the most common way this install fails. Every step here is chained with &&, and it ends by proving the command resolves. It installs both clients (opencrabs and opencrabs-gui) plus the .desktop entries; add the desktop app libraries before launching the window:
sudo apt update && sudo apt install -y curl jq libgomp1 && TAG=$(curl -sL https://api.github.com/repos/opencrabs/opencrabs/releases/latest | jq -r .tag_name) && D=$(mktemp -d) && curl -fsSL "https://github.com/opencrabs/opencrabs/releases/download/${TAG}/opencrabs-${TAG}-linux-amd64.tar.gz" | tar xz -C "$D" && sudo install -m 755 "$D/opencrabs" "$D/opencrabs-gui" "$D/rtk" /usr/local/bin/ && command -v opencrabs && opencrabs --version
Linux (arm64)
sudo apt update && sudo apt install -y curl jq libgomp1 && TAG=$(curl -sL https://api.github.com/repos/opencrabs/opencrabs/releases/latest | jq -r .tag_name) && D=$(mktemp -d) && curl -fsSL "https://github.com/opencrabs/opencrabs/releases/download/${TAG}/opencrabs-${TAG}-linux-arm64.tar.gz" | tar xz -C "$D" && sudo install -m 755 "$D/opencrabs" "$D/opencrabs-gui" "$D/rtk" /usr/local/bin/ && command -v opencrabs && opencrabs --version
macOS (arm64 / Apple Silicon)
The macOS archive contains OpenCrabs.app and OpenCrabs Desktop.app, not a loose binary, because macOS only reads an app icon out of a bundle. So the manual route copies both bundles into ~/Applications and links the CLI into /usr/local/bin:
D=$(mktemp -d) && TAG=$(curl -sL https://api.github.com/repos/opencrabs/opencrabs/releases/latest | jq -r .tag_name) && curl -fsSL "https://github.com/opencrabs/opencrabs/releases/download/${TAG}/opencrabs-${TAG}-macos-arm64.tar.gz" | tar xz -C "$D" && mkdir -p ~/Applications && cp -R "$D/OpenCrabs.app" "$D/OpenCrabs Desktop.app" ~/Applications/ && sudo mkdir -p /usr/local/bin && sudo ln -sf ~/Applications/OpenCrabs.app/Contents/MacOS/opencrabs /usr/local/bin/opencrabs && command -v opencrabs && opencrabs --version
Do not run ./opencrabs after extracting the macOS archive. That file does not exist there, and looking for it is how the old instructions wasted an afternoon. The one-line installer above does all of this for you.
Windows
The one-liner installs every file the release archive ships, which is opencrabs.exe, opencrabs-gui.exe, rtk.exe and the four MSVC runtime DLLs beside them, into %LOCALAPPDATA%\OpenCrabs\bin, and adds that folder to your user PATH, so opencrabs resolves from any new terminal. The DLLs are what let the exe start on a machine that never installed Visual Studio or the vc_redistributable:
iwr -useb https://opencrabs.com/install.ps1 | iex
To pass flags, build a script block, because piping straight into iex swallows them:
& ([scriptblock]::Create((iwr -useb https://opencrabs.com/install.ps1))) -Dir "$env:USERPROFILE\bin"
| Flag | Effect |
|---|---|
-DryRun | Print the plan, download nothing |
-Version <tag> | Install a specific release instead of the latest |
-Dir <path> | Install into a different directory (default %LOCALAPPDATA%\OpenCrabs\bin) |
-NoPathUpdate | Install the binaries but leave your user PATH alone |
-Client <which> | Install desktop, terminal or both (the default) |
-NoLaunch | Install the binaries but do not start OpenCrabs at the end |
-Help | Show the script’s own help |
The Windows zip carries opencrabs.exe, opencrabs-gui.exe, rtk.exe and the four MSVC runtime DLLs beside them, and Expand-Archive keeps them together in the destination, so the manual route only has to pick a directory and add it to PATH itself. This is that whole route on one line:
$tag = (Invoke-RestMethod https://api.github.com/repos/opencrabs/opencrabs/releases/latest).tag_name; $ProgressPreference = 'SilentlyContinue'; $dest = "$env:LOCALAPPDATA\OpenCrabs\bin"; Invoke-WebRequest "https://github.com/opencrabs/opencrabs/releases/download/$tag/opencrabs-$tag-windows-amd64.zip" -OutFile "$env:TEMP\opencrabs.zip" -UseBasicParsing; Expand-Archive "$env:TEMP\opencrabs.zip" -DestinationPath $dest -Force; [Environment]::SetEnvironmentVariable('Path', "$dest;" + [Environment]::GetEnvironmentVariable('Path','User'), 'User'); $env:Path = "$dest;$env:Path"; Get-Command opencrabs; opencrabs --version
Expand-Archive -DestinationPath . is what the old instructions said, and it is why people ended up with an opencrabs.exe in whichever folder they happened to be in, invisible to every other terminal.
It goes straight to the chat with its built-in provider already live. Run opencrabs --onboard when you want the setup wizard.
Windows is a first-class platform (v0.5.3): platform-aware shell handling, BOM/UTF-16 file reads, and tilde/cwd fallbacks are built in, and CI builds Windows on every PR (#627).
Verify your download (optional): every release publishes a
SHA256SUMSfile alongside the tarballs.
Terminal permissions required. OpenCrabs reads/writes brain files, config, and project files. Your terminal app needs filesystem access or the OS will block operations.
OS What to do macOS System Settings → Privacy & Security → Full Disk Access → toggle your terminal app ON (Alacritty, iTerm2, Terminal, etc.). If not listed, click “+” and add it from /Applications/. Without this, macOS repeatedly prompts “would like to access data from other apps”.Windows Run your terminal (Windows Terminal, PowerShell, cmd) as Administrator on first run, or grant the terminal write access to %USERPROFILE%\.opencrabs\and your project directories. Windows Defender may also prompt, click “Allow”.Linux Ensure your user owns ~/.opencrabs/and project directories. On SELinux/AppArmor systems, the terminal process needs read/write access to those paths. Flatpak/Snap terminals may need--filesystem=homeor equivalent permission.
/rebuildworks even with pre-built binaries: it auto-clones the source to~/.opencrabs/source/on first use, then builds and hot-restarts.
Option 3: Build from Source
Required for /rebuild, adding custom tools, or modifying the agent.
Quick setup (recommended)
The setup script auto-detects your platform (macOS, Debian/Ubuntu, Fedora/RHEL, Arch) and installs all build dependencies + Rust:
# Install all dependencies
curl -fsSL https://raw.githubusercontent.com/opencrabs/opencrabs/main/src/scripts/setup.sh | bash
# Clone and build
git clone https://github.com/opencrabs/opencrabs.git
cd opencrabs
cargo build --release
./target/release/opencrabs
Manual setup
If you prefer to install dependencies yourself:
- Rust stable: Install Rust. Stable toolchain works since v0.2.85
- An API key from at least one supported provider
- SQLite (bundled via rusqlite)
- macOS:
brew install cmake pkg-config - Debian/Ubuntu:
sudo apt install build-essential pkg-config libssl-dev cmake - Fedora/RHEL:
sudo dnf install gcc gcc-c++ make pkg-config openssl-devel cmake - Arch:
sudo pacman -S base-devel pkg-config openssl cmake
git clone https://github.com/opencrabs/opencrabs.git
cd opencrabs
cargo build --release
./target/release/opencrabs
OpenCrabs uses
keys.tomlinstead of.envfor API keys. The onboarding wizard will help you set it up, or edit~/.opencrabs/keys.tomldirectly.
Option 4: Docker
Run OpenCrabs in an isolated container. Build takes ~15min (Rust release + LTO).
git clone https://github.com/opencrabs/opencrabs.git
cd opencrabs
docker compose -f src/docker/compose.yml up --build
Config, workspace, and memory DB persist in a Docker volume across restarts. API keys in keys.toml are mounted into the container at runtime, never baked into the image.
Autostart on Boot
Keep OpenCrabs running as a background daemon that starts with your system.
Linux (systemd)
The binary writes the unit itself, so the file cannot drift from the version you are running:
opencrabs service install
That writes ~/.config/systemd/user/opencrabs.service with Type=simple and OOMPolicy=continue, then reloads systemd. Start it with opencrabs service start: a user unit does not come back after a reboot unless lingering is enabled (see below), while a system-wide unit is enabled so it does. OOMPolicy=continue matters because the daemon is the parent of every tool call and cron child: without it, one child killed by the OOM killer stops the whole unit and takes every agent lane with it. The unit name carries the profile when you are not on default, as opencrabs-<profile>.service.
On a headless SSH session the per-user systemd bus is often missing, and the command fails with Failed to connect to bus. Enable lingering so the user service runs without a login, or install a system-wide unit instead:
sudo loginctl enable-linger $(whoami)
# or
sudo opencrabs service install
Manage the daemon with opencrabs service start|stop|restart|status, or with systemctl directly.
Check status: systemctl --user status opencrabs | Logs: journalctl --user -u opencrabs -f
macOS (launchd)
cat > ~/Library/LaunchAgents/com.opencrabs.agent.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.opencrabs.agent</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/opencrabs</string>
<string>daemon</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardOutPath</key>
<string>/tmp/opencrabs.log</string>
<key>StandardErrorPath</key>
<string>/tmp/opencrabs.err</string>
</dict>
</plist>
EOF
launchctl load ~/Library/LaunchAgents/com.opencrabs.agent.plist
Update the path in ProgramArguments to match your install location.
Windows (Task Scheduler)
Register the task against whatever Get-Command opencrabs resolves to, not a guessed path. The installer writes to %LOCALAPPDATA%\OpenCrabs\bin, so a hardcoded %USERPROFILE%\.cargo\bin registers a task pointing at a file that does not exist: the task gets created, never starts, and the symptom looks like “OpenCrabs does not autostart” rather than a wrong path.
Win + R→taskschd.msc- Create Basic Task → Name:
OpenCrabs - Trigger: When I log on
- Action: Start a program → the path printed by
(Get-Command opencrabs).Source, Arguments:daemon - In Properties > Settings, check If the task fails, restart every 1 minute
Or via PowerShell, which resolves the path for you:
$exe = (Get-Command opencrabs).Source
$action = New-ScheduledTaskAction -Execute $exe -Argument "daemon"
$trigger = New-ScheduledTaskTrigger -AtLogOn
$settings = New-ScheduledTaskSettingsSet -RestartCount 3 -RestartInterval (New-TimeSpan -Minutes 1)
Register-ScheduledTask -TaskName "OpenCrabs" -Action $action -Trigger $trigger -Settings $settings
opencrabs service install is Linux only. On Windows it reports “not supported on this platform”, which is why the task is registered by hand here.
Updating
- Homebrew users:
brew upgrade opencrabs(if you type/evolveon a Homebrew install, it delegates to Homebrew, the binary stays managed by brew, and the old tap is retired in favour of homebrew-core autobumps) - Binary users: Type
/evolvein the TUI to download the latest release - Source users:
git pull && cargo build --release, or type/rebuildin the TUI - Docker users:
docker compose pull && docker compose up -d
Onboarding
A first run does not open the wizard. OpenCrabs goes straight to the chat, with its built-in provider already provisioned and the agent greeting you. The onboarding wizard is opt-in: run opencrabs --onboard, or /onboard from inside a session.
Video walkthroughs are on the Onboarding Videos page.
First Run: You Land In The Chat
There is no wizard on a fresh install. OpenCrabs opens the chat, brings the built-in provider online and says hello:
config.tomlandkeys.tomlare written from the shipped example if they are not there yet.[providers.opencrabs]is turned on. The example ships it disabled, so this is what makes it the active provider.- The install asks
inference.opencrabs.comfor its own token and saves it inkeys.toml. The token is reused on every later launch, so this happens once. - The agent reads its brain files and greets you with the model it is running on.
If the token request fails (offline, proxy unreachable), you still land in a working chat with a line saying what happened. Type /onboard to pick another provider, or fix the connection and restart. Onboarding is only marked complete once the built-in provider actually came up, so the next launch retries instead of leaving you on a chat with no provider.
What You Get Without Any Setup
| Capability | Model | Notes |
|---|---|---|
| Chat | deepseek-v4.1-flash | 200k context, fixed |
| Vision | deepseek-v4.1-flash | Attach an image and it works |
| Image generation | gemini-2.5-flash-image | Served on the image route only, never as a chat model |
| Voice in | qwen3.8-omni-flash | A voice note is transcribed and answered in text |
| Voice out | not served | Needs another TTS engine, see Voice |
Free, no account, no key to paste, no usage caps during the experimental phase. The proxy rate limits abuse (request floods, bulk install minting) and normal use does not hit it. Requests go to inference.opencrabs.com, which forwards them to the upstream model host. Full detail, including where the token lives and how to leave: OpenCrabs (built in).
To move to another provider later, type /models and pick one, or run /onboard and choose Advanced.
Quick Start (the wizard, 1 minute)
The wizard is opt-in: opencrabs --onboard before the first launch, or /onboard inside a session. Pick QuickStart to keep the defaults and skip channel and voice setup.
| Step | Action |
|---|---|
| 1. Mode | Arrow to QuickStart, hit Enter |
| 2. Workspace | Hit Enter to accept the default path |
| 3. Provider | Arrow to the provider you want, hit Enter. OpenCrabs (built in) needs no key; anything else asks for one |
| 4. API Key | Only for a provider that needs one. Paste it (Cmd+V / Ctrl+V), hit Enter. The model list loads live |
| 5. Model | Arrow to your model, hit Enter |
| 6. Daemon | Arrow to select whether to run as a background daemon, hit Enter |
| 7. Vibe Check | All checks should show ✅. Hit Enter |
| 8. About You | Write something about yourself. The more the agent knows, the better. Hit Enter |
| 9. About Agent | Write something about the agent’s personality. Hit Enter |
| 10. Chat | You’re in. The agent greets you and asks only what is still missing |
Advanced Setup (7 minutes)
Full setup with Telegram, local voice, vision, and image generation.
| Step | Action |
|---|---|
| 1. Mode | Arrow to Advanced, hit Enter |
| 2. Workspace | Hit Enter to accept the default path |
| 3. Provider | Arrow to your provider (e.g. z.ai), hit Enter. Arrow down to select a plan, hit Enter |
| 4. API Key | Paste your key, hit Enter. Model list loads live |
| 5. Model | Arrow to your model, hit Enter |
| 6. Channels | Arrow to Other, hit Space to select Telegram, hit Enter. Paste your bot token, follow the instructions to get your chat ID, hit Enter. Select mention mode, hit Enter. Once it says Connected, hit Enter again. Arrow down to Continue, hit Enter |
| 7. STT | Select Local, hit Enter. Pick model size (e.g. tiny for speed), hit Enter |
| 8. TTS | Select Local again, hit Enter. Pick a voice from the picker (Piper voices first, then the Kokoro section: e.g. Ryan, or a Kokoro voice like Af Heart), hit Enter. Wait for the model download, arrow down to Continue, hit Enter. Picking a Kokoro voice sets local_tts_engine = "kokoro" and downloads its own model (~142 MB); picking a Piper voice keeps the default Piper setup |
| 9. Image | Hit Space to select Vision and Image Generation, hit Enter. Paste your Gemini API key, hit Enter |
| 10. Daemon | Arrow to select whether to run as background daemon, hit Enter |
| 11. Vibe Check | All checks should show ✅. Hit Enter |
| 12. About You | Write something about yourself, the more the agent knows, the better. Hit Enter |
| 13. About Agent | Write something about the agent’s personality. Hit Enter |
| 14. Chat | You’re in. Start talking to your agent |
Onboarding Flow
The wizard is a keyboard-driven TUI with 8 steps. Navigate with arrow keys, Tab to advance, Esc to go back.
| Step | Screen | What you do |
|---|---|---|
| 1 | Mode Select | Choose QuickStart (skip channels) or Advanced |
| 2 | Workspace | Pick a working directory for file operations |
| 3 | Provider & Auth | Select provider → paste API key → pick model (fetched live) |
| 4 | Channels | Space to toggle channels on/off → Enter on each to configure |
| 5 | Voice | STT provider (Groq, local Whisper, or off) + TTS voice |
| 6 | Image | Vision toggle + generation model + API key |
| 7 | Daemon | Install background daemon (optional) |
| 8 | Brain Setup | Auto-generate SOUL.md from your profile |
Channel Setup (Step 4)
The channels screen lists 5 integrations: Telegram, Discord, WhatsApp, Slack, Trello.
Spacetoggles a channel on/offEnteron an enabled channel opens its setup screen (token, IDs, allowlists)Enteron Continue orTabskips to the next step- Each channel setup screen has a Test Connection button
See Channels Overview for the full navigation guide.
Re-running Setup
You can jump to any step without re-running the full wizard:
| Command | Step |
|---|---|
/onboard | Full wizard |
/onboard:provider | Provider & model selection |
/onboard:channels | Channel picker |
/onboard:voice | Voice setup |
/onboard:image | Image setup |
/onboard:brain | Brain file generation |
After onboarding, your agent boots up and introduces itself. It reads its brain files (SOUL.md, AGENTS.md, TOOLS.md) and starts a conversation.
Bootstrap
On the very first run, the agent goes through a bootstrap phase:
- Gets to know you (name, preferences, work style)
- Establishes its identity (name, personality, emoji)
- Opens
SOUL.mdtogether to discuss values - Sets up
USER.mdwith your profile
The bootstrap file (BOOTSTRAP.md) deletes itself when complete.
Migrating From Another Tool
Already using ClaudeCode, OpenClaw, Hermes, or any other AI agent harness? Your agent can migrate your existing data (memory, skills, custom commands, preferences) into its own brain files using natural language. No manual file shuffling needed.
This works with any agent or coding harness that stores config locally. The migration searches your filesystem for the other tool’s config directories, reads their contents, and maps them into OpenCrabs’ own brain file format (SOUL.md, USER.md, TOOLS.md, MEMORY.md, AGENTS.md, CODE.md).
Hand-Held Migration
If you want to review what gets migrated before it happens:
Search for my ClaudeCode/OpenClaw/Hermes data locally (or any other agent harness I was using) and audit a migration to our own brain files, report back once its done, execute when I confirm and approve.
The agent will:
- Search your filesystem for the other tool’s config directories
- Read and parse all relevant files (memory, commands, skills, preferences)
- Produce an audit showing exactly what maps where
- Wait for your confirmation
- Execute the migration and report a full breakdown
Autonomous Migration
If you just want it done:
Search for my existing agent/harness data locally and migrate anything to our own brain files, no need my approval, just go, plan and execute, report back once its done with a full breakdown.
The agent skips the audit step, plans the migration internally, executes it, and gives you a summary of everything that moved.
What Gets Mapped
| Source | Destination | Example |
|---|---|---|
| Memory / CLAUDE.md / context files | MEMORY.md | Project decisions, past context |
| Custom commands | commands.toml | Slash commands and their definitions |
| Skills / agent instructions | AGENTS.md, TOOLS.md | Workflow rules, tool configs |
| User preferences / profile | USER.md | Name, timezone, coding style |
| Coding standards / linting rules | CODE.md | Style guides, conventions |
Tip: Run migration right after onboarding while the context is fresh. The agent already has your
USER.mdandSOUL.mdfrom the wizard, so it can merge intelligently instead of overwriting.
Key Commands
| Command | Description |
|---|---|
/help | Show all available commands |
/models | Switch provider or model |
/new | Create a new session |
/sessions | Switch between sessions |
/cd | Change working directory |
/compact | Manually compact context |
/evolve | Download latest version |
/rebuild | Build from source |
/approve | Set approval policy |
Approval Modes
Control how much autonomy the agent has:
| Mode | Behavior |
|---|---|
/approve | Ask before every tool use (default) |
/approve auto | Auto-approve for this session |
/approve yolo | Auto-approve always (persists) |
Working Directory
The agent operates within a working directory for file operations. Change it with:
/cdcommand in chat- Directory picker in the TUI (Tab to select)
config_manager set_working_directorytool
The working directory is persisted per-session. Switching sessions restores the directory automatically.
Model Filter Hint (v0.3.78)
The onboarding model picker now always renders a filter hint above the model list (“Type to filter…”). Previously, the hint only appeared after you started typing, so users did not know filtering was available. Additionally, an exactly-typed model ID now beats a substring match: if you type claude-opus-4-8 exactly, it selects that model even if other models contain the same substring.
Onboarding Videos
Video walkthroughs of OpenCrabs setup and onboarding are on the OpenCrabs YouTube channel. Each OS has a quick start and an advanced setup video. Click a thumbnail to play it here.
macOS
Install in under 2 minutes (Homebrew)
Advanced setup on macOS (Telegram, voice, images)
Ubuntu/Linux
Install in 3 minutes (one paste)
Advanced setup on Linux (Telegram, voice, images)
Windows
Install in 2 minutes (PowerShell)
Advanced setup on Windows (Telegram, voice, images)
All videos: youtube.com/@OpenCrabs
The Onboarding page has the step-by-step Quick and Advanced paths in text.
Configuration
OpenCrabs uses two config files stored at ~/.opencrabs/:
| File | Purpose |
|---|---|
config.toml | Provider settings, features, channel connections |
keys.toml | API keys and secrets (never committed to git) |
Workspace Layout
~/.opencrabs/
├── config.toml # Main configuration
├── keys.toml # API keys (gitignored)
├── commands.toml # Custom slash commands
├── opencrabs.db # SQLite database
├── SOUL.md # Agent personality
├── USER.md # Your profile
├── MEMORY.md # Long-term memory
├── AGENTS.md # Agent behavior docs
├── TOOLS.md # Tool reference
├── SECURITY.md # Security policies
├── HEARTBEAT.md # Periodic check tasks
├── memory/ # Daily memory notes
│ └── YYYY-MM-DD.md
├── images/ # Generated images
├── logs/ # Application logs
└── skills/ # Custom skills/plugins
Provider Configuration
See Provider Setup for detailed provider configuration.
Quick example: add Anthropic:
# config.toml
[providers.anthropic]
enabled = true
default_model = "claude-sonnet-4-20250514"
# keys.toml
[providers.anthropic]
api_key = "sk-ant-..."
Provider Priority
When multiple providers are enabled, the first one found in this order is used for new sessions:
MiniMax > OpenRouter > Anthropic > OpenAI > Gemini > Custom
Each session remembers which provider and model it was using. Switch providers per-session via /models.
Config Safety (v0.3.74)
A malformed line in config.toml or keys.toml corrupts the whole file and takes the agent down (no provider keys, no bot token, no way back in). v0.3.74 makes that class of failure nearly impossible:
- Config edits via config_manager only: the agent edits
config.toml/keys.tomlonly through theconfig_managertool, never with raw file edits. The write path validates the result and refuses anything that would break parsing (#715). - Guard config-breaking writes:
edit_file/write_filewrites that would breakconfig.toml/keys.tomlare denied outright (#713). - Re-validate before write: config is re-validated immediately before
fs::writein theconfig_managerwrite paths (#714). - Validate keys before snapshot:
keys.tomlis validated before it is saved as the last-good snapshot, so a bad snapshot can’t poison recovery (#712).
v0.3.79 hardened this further:
- Every config write is atomic (#911): a crash or a concurrent reader mid-write can never observe a half-written
config.tomlorkeys.toml. - Config loads no longer race on shared state, concurrent reloads can’t interleave and leave a torn config in memory.
- Reload failures are specific: a failed reload says what failed, and a write race is named as the transient condition it is instead of a scary generic error.
- Never select a provider you didn’t configure, fallback and model routing can no longer land on a provider section that doesn’t exist in your config.
Agent Behavior
[agent]
working_directory = "/path/to/default/dir"
thinking = "on" # "on", "off", or "budget_XXk"
approval_policy = "auto-always" # "ask", "auto-session", "auto-always"
max_concurrent = 4 # max parallel tool calls
context_limit = 200000 # context window cap (tokens)
max_tokens = 65536 # max output tokens per API call
auto_update = true # auto-install releases on startup
silent_compaction = false # suppress post-compaction personality narration
compaction_notice = false # show the compaction notice pair; off by default (v0.5.4)
lazy_tools = true # JIT tool-schema loading (ships core + tool_search only)
redact_sensitive_data = true # redact API keys, tokens, passwords, IPs from output
debug_logs = false # enable debug file logging (hot-reloads, no restart)
default_provider = "minimax" # fallback provider when no provider is active (v0.3.62)
default_model = "MiniMax-M2.7" # fallback model when no model is active (v0.3.62)
| Field | Default | Description |
|---|---|---|
working_directory | home dir | Default working directory for the agent |
thinking | "on" | Extended thinking mode: "on", "off", or "budget_XXk" |
approval_policy | "auto-always" | "ask" = confirm every tool call, "auto-session" = auto-approve for session, "auto-always" = never ask |
max_concurrent | 4 | Max tool calls running in parallel |
context_limit | 200000 | Context window limit in tokens. When exceeded, oldest messages are dropped |
max_tokens | 65536 | Max output tokens per single API call |
auto_update | true | Automatically install new releases on startup (binary mode only) |
silent_compaction | false | When true, suppresses the agent’s playful post-compaction narration. Useful for corporate/formal deployments |
compaction_notice | false | Show the compaction notice pair in the TUI. Off by default since v0.5.4 (#1686) |
lazy_tools | true | Ships only core tool schemas (~4k tokens) plus tool_search per request. The agent discovers and activates extended tools on demand via tool_search. Set false to load all ~95 schemas every request |
redact_sensitive_data | true | Redacts API keys, tokens, passwords, and IPs from tool outputs and display. Set false during sysadmin/devops work where seeing IPs/tokens/passwords is necessary |
debug_logs | false | Enable debug file logging to ~/.opencrabs/logs/. Hot-reloads on change (no restart). The --debug CLI flag always wins when set (OR logic) |
default_provider | None (uses active provider) | Fallback provider when no provider is active in the current session. Also used for cron jobs without an explicit provider (v0.3.62) |
default_model | None (uses active model) | Fallback model when no model is active in the current session. Also used for cron jobs without an explicit model (v0.3.62) |
Timeout flags resolve per provider first: [providers.<name>] wins over [agent], which wins over the built-in default, and every provider family honours the chain, anthropic and gemini included (v0.5.4, #1688).
Sub-agent and RSI Overrides
Route spawned sub-agents and RSI (self-improvement) cycles to separate providers so they never compete with your main chat for quota:
[agent]
subagent_provider = "minimax" # provider for spawned sub-agents
subagent_model = "MiniMax-M2.7" # model for spawned sub-agents
self_improvement_provider = "minimax" # provider for RSI self-improvement cycles
self_improvement_model = "MiniMax-M2.7" # model for RSI cycles
| Field | Default | Description |
|---|---|---|
subagent_provider | None (uses session provider) | Provider for spawned sub-agents. Keeps sub-agents off your main provider |
subagent_model | None (uses session model) | Model for spawned sub-agents |
self_improvement_provider | None (uses session provider) | Provider for RSI self-improvement cycles. RSI runs on its own provider chain |
self_improvement_model | None (uses session model) | Model for RSI cycles. Prefer cheap, fast models since results are deterministic |
Channel Configuration
Telegram
[channels.telegram]
enabled = true
token = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
allowed_users = ["123456789"] # numeric Telegram user IDs
allowed_channels = ["-100123456"] # restrict to specific group/channel IDs (empty = all)
respond_to = "mention" # "all", "dm_only", "mention" (default)
session_idle_hours = 24.0 # idle timeout for non-owner sessions
rich_messages = true # native Telegram rich messages (Bot API 10.1, default since v0.3.64)
silence_group_start = true # silently ignore /start from non-allowed users in groups
bot_owner = ["123456789"] # owner IDs (gated commands, /cd hidden dirs, /profiles)
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the Telegram bot channel |
token | None | Telegram Bot API token from @BotFather |
allowed_users | [] (accept all) | Numeric Telegram user IDs. Accepts int or string arrays. Empty = open mode |
allowed_channels | [] (all channels) | Restrict bot to specific channel/group IDs. DMs always pass |
respond_to | "mention" | When to respond in groups: "all" = every message, "dm_only" = ignore groups, "mention" = only when @mentioned or replied-to |
session_idle_hours | None (no timeout) | Idle timeout in hours for non-owner sessions. Owner sessions never expire |
rich_messages | false | Send structured replies as native Telegram rich messages (tables, headings, lists, math). Only works on current mobile/desktop Telegram clients. Telegram Web and older clients show a “not supported” placeholder. Enable only when your audience is on modern clients |
silence_group_start | true | Silently ignore /start from non-allowed users in group chats. Users who need their ID can DM the bot |
bot_owner | [] (first allowed_user) | Bot owner user IDs. Owners can access gated commands (/profiles, hidden files in /cd), manage profiles. When unset, defaults to first entry in allowed_users |
Discord
[channels.discord]
enabled = true
token = "your-discord-bot-token"
allowed_users = ["123456789012345678"]
allowed_channels = ["123456789012345678"]
respond_to = "mention"
session_idle_hours = 24.0
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the Discord bot channel |
token | None | Discord bot token from the Developer Portal |
allowed_users | [] (accept all) | Discord user IDs. Accepts int or string arrays |
allowed_channels | [] (all channels) | Restrict bot to specific channel IDs |
respond_to | "mention" | When to respond: "all", "dm_only", "mention" |
session_idle_hours | None | Idle timeout for non-owner sessions |
Slack
[channels.slack]
enabled = true
token = "xoxb-your-bot-token"
app_token = "xapp-your-app-token" # Socket Mode token
allowed_users = ["U12345678"]
allowed_channels = ["C12345678"]
respond_to = "mention"
session_idle_hours = 24.0
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the Slack bot channel |
token | None | Bot token (xoxb-...) |
app_token | None | App-level token for Socket Mode (xapp-...) |
allowed_users | [] (accept all) | Slack user IDs (U12345678) |
allowed_channels | [] (all channels) | Restrict bot to specific channel IDs |
respond_to | "mention" | When to respond: "all", "dm_only", "mention" |
session_idle_hours | None | Idle timeout for non-owner sessions |
[channels.whatsapp]
enabled = true
allowed_phones = ["+15551234567"] # E.164 format
session_idle_hours = 24.0
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the WhatsApp channel |
allowed_phones | [] (accept all) | E.164 phone numbers. Empty = accept everyone (not recommended for business numbers) |
session_idle_hours | None | Idle timeout for non-owner sessions |
Trello
[channels.trello]
enabled = true
token = "your-trello-api-token"
app_token = "your-trello-api-key"
allowed_users = ["memberId1"]
board_ids = ["boardId1", "boardId2"]
poll_interval_secs = 60
session_idle_hours = 24.0
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the Trello channel |
token | None | Trello API token |
app_token | None | Trello API key (stored as app_token for keys.toml symmetry) |
allowed_users | [] (accept all) | Trello member IDs |
board_ids | [] (all boards) | Board IDs to monitor for @mentions. Also accepts allowed_channels as an alias |
poll_interval_secs | None (tool-only) | Polling interval in seconds. Absent or 0 = no polling (tool-only mode) |
session_idle_hours | None | Idle timeout for non-owner sessions |
Other Channels (Preview)
Signal, Google Chat, and iMessage are available as preview placeholders:
[channels.signal]
enabled = true
allowed_phones = ["+15551234567"]
[channels.google_chat]
enabled = true
token = "your-google-chat-token"
allowed_users = ["user@example.com"]
[channels.imessage]
enabled = true
allowed_phones = ["+15551234567"]
Cron Defaults
Route cron jobs to cheaper providers so they never compete with your interactive session:
[cron]
default_provider = "minimax"
default_model = "MiniMax-M2.7"
| Field | Default | Description |
|---|---|---|
default_provider | None (uses active provider) | Default provider for cron jobs without an explicit provider |
default_model | None (uses active model) | Default model for cron jobs without an explicit model |
Memory and Embeddings
[memory]
vector_enabled = true
[memory.embedding]
url = "https://api.openai.com/v1"
model = "text-embedding-3-small"
# api_key loaded from keys.toml: [providers.memory_embedding] api_key = "sk-..."
# dimensions = 1536 # auto-detected from first API response if unset
| Field | Default | Description |
|---|---|---|
vector_enabled | true (desktop), false (VPS) | Enable vector embeddings for semantic memory search. When disabled, only FTS5 keyword search is used. Auto-disabled on systems with < 2GB RAM or detected cloud instances |
embedding.url | None | OpenAI-compatible API base URL. The /embeddings path is appended automatically |
embedding.model | None | Embedding model name (e.g. text-embedding-3-small, nomic-embed-text) |
embedding.api_key | None | API key for the embedding endpoint. Also loaded from keys.toml under [providers.memory_embedding] |
embedding.dimensions | None (auto-detected) | Embedding vector dimensions. Auto-detected from the first API response if unset. Local GGUF model always produces 768-dim vectors |
extra_paths | [] | External paths indexed into the external collection. Bare path strings or { path, pattern } tables; relative paths resolve against the OpenCrabs home |
exclude | VCS/build/secret globs | Glob excludes for external indexing, global across all entries |
external_allowed_in_shared | false | Allow scope="external" results in shared/group sessions. Default-deny: external content stays owner-session-only unless opted in |
sweep_interval_secs | 300 | Seconds between external-path freshness sweeps; modified files are also caught lazily at search time |
When [memory.embedding] is not set, embeddings are generated locally via the embeddinggemma-300M GGUF model (~300MB download, ~2.9GB RAM). Setting [memory.embedding] with an API endpoint eliminates the local model overhead.
To index your own docs (or an entire scraped docs site) into memory search, see Memory System → External Index Paths for the full knowledge-base workflow.
Brain Files
[brain]
strip_empty_sections = true
default_cap = 500
[brain.caps]
SOUL.md = 300
AGENTS.md = 800
| Field | Default | Description |
|---|---|---|
strip_empty_sections | true | Strip empty header stubs (## Header with no body) from brain-file reads. Writes are never affected, only the loaded view is filtered |
default_cap | 500 | Per-file line cap for sync_templates. When a merged file exceeds its cap, the sync bails instead of writing |
caps | {} (empty) | Per-file line caps overrides. Keys are filenames (case-sensitive: TOOLS.md and tools.md are distinct) |
Browser
[browser]
cdp_endpoint = "http://localhost:9222"
| Field | Default | Description |
|---|---|---|
cdp_endpoint | None (spawn new browser) | CDP endpoint for an existing Chromium instance. When set, connects via Chrome DevTools Protocol instead of spawning a new browser. Useful for sharing a single browser across multiple profiles to save memory (~250-300MB per instance) |
To start a standalone Chromium with CDP enabled:
chromium --remote-debugging-port=9222 --headless --no-sandbox
A2A (Agent-to-Agent) Gateway
[a2a]
enabled = false
bind = "127.0.0.1"
port = 18790
allowed_origins = ["https://your-app.com"]
# api_key = "your-secret-key" # Bearer token for incoming requests
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the A2A JSON-RPC 2.0 gateway |
bind | "127.0.0.1" | Bind address |
port | 18790 | Gateway port |
allowed_origins | [] | CORS origins. Must be set explicitly, no cross-origin requests allowed by default |
api_key | None | Bearer token for authenticating incoming A2A requests. If unset, no authentication required |
Daemon Mode
[daemon]
health_port = 8080
| Field | Default | Description |
|---|---|---|
health_port | None (no health server) | HTTP port for GET /health endpoint. Useful for systemd watchdog, uptime monitors, and external health probes |
OpenCrabs runs in two modes: TUI (interactive terminal UI with chat) and Daemon (headless background service for channels + cron). For any one profile, run only one at a time. The TUI always wins: opening it while a daemon runs shuts the daemon down and takes over the channels.
For full service lifecycle management (TUI vs Daemon comparison, opencrabs service install/start/stop, profile-aware services, OPENCRABS_PROFILE env var, troubleshooting), see the CLI Commands reference.
Image Generation and Vision
[image.generation]
enabled = true
model = "gemini-3.1-flash-image-preview"
[image.vision]
enabled = true
model = "gemini-3.1-flash-image-preview"
provider = "openrouter" # bypasses enabled gate for vision-only providers (v0.3.63)
| Section | Field | Default | Description |
|---|---|---|---|
image.generation | enabled | false | Enable image generation via the generate_image tool |
image.generation | model | "gemini-3.1-flash-image-preview" | Model for image generation |
image.vision | enabled | false | Enable vision analysis via the analyze_image tool. Since v0.3.64: setting vision_model alone is sufficient to enable vision. enabled is no longer required when vision_model is set |
image.vision | model | "gemini-3.1-flash-image-preview" | Model for image/vision analysis |
image.vision | provider | None (auto-detect) | Dedicated provider for vision. Bypasses the enabled gate so you can use a vision-only provider without enabling it for general chat (v0.3.63) |
Vision analysis automatically scans all enabled providers (Google, OpenRouter, OpenAI-compatible, Anthropic) before returning an error. No configuration needed.
Desktop Notifications
OpenCrabs can raise a real OS notification when work finishes, so an agent that kept going while you were away leaves something you actually see. Four independent events, all off by default, all armed by the master switch:
# [agent]
completion_notification_enabled = true # master switch; it also plays the plan chime
notify_on_plan_completed = true # a whole plan finished
notify_on_task_completed = true # one plan task settled
notify_on_turn_completed = true # a turn finished, agent is waiting
notify_on_turn_failed = true # a turn stopped on an error
To mute banners for one process without editing the file:
export OPENCRABS_NO_DESKTOP_NOTIFY=1 # also accepts true, yes, on
| Event | Dedupe | Notes |
|---|---|---|
| Plan completed | once per plan title | Raised from the settle hook, so a headless or channel run announces too |
| Task completed | once per task title | A skipped task is reported as stopped, never as a success |
| Turn completed | never repeats suppressed | Asking the same thing twice earns two banners on purpose |
| Turn failed | never repeats suppressed | A cancelled turn is not a failure and stays silent |
Banners stay quiet while the surface holds focus: the terminal reports focus from its own events, the GUI from its window state. A surface that never reports focus counts as unknown, and unknown raises. That is deliberate: staying silent on a guess is the one failure this feature exists to prevent.
Every surface is best effort. A missing transport, a laptop with no logged-in desktop session, or a container with no notification daemon all end in one debug log line, never in a blocked turn.
Per-OS prerequisites
| OS | Requirement | What you get without it |
|---|---|---|
| macOS | ~/Applications/OpenCrabs Notifier.app (bundle id com.opencrabs.notifier) plus a one-time allow in System Settings, Notifications | Falls back to osascript -e 'display notification': the banner still appears but is attributed to the terminal app and loses the crab icon. macOS records a denial once granted, so the toggle has to be flipped by hand in System Settings |
| Windows | The process sets its AppUserModelID (com.opencrabs.app) before the toast, and PowerShell must be able to load WinRT | Builds earlier than the AUMID change can drop the toast with no error; a machine with a locked-down PowerShell shows nothing |
| Linux | A notification daemon on the session bus (org.freedesktop.Notifications) and notify-send from libnotify | A server over SSH, a container, or a bare terminal session has no daemon, so nothing is shown and nothing errors |
The helper bundle lives outside the repository today, so a fresh machine has to build it once; the fallback path covers everything else.
Voice Provider Fallback
STT and TTS providers support automatic failover via fallback_chain. When the primary returns a 5xx, fails a liveness probe (Voicebox), or is otherwise unreachable, the dispatcher walks the chain in order and tries each entry that has the credentials/config it needs.
[providers.stt]
fallback_chain = ["groq", "openai_compatible", "local"]
[providers.tts]
fallback_chain = ["openai_compatible", "openai", "local"]
| Chain | Valid labels |
|---|---|
| STT | voicebox, openai_compatible, groq, local (aliases: whisper, local_whisper) |
| TTS | voicebox, openai_compatible, openai, local (aliases: piper, local_piper). groq is STT-only, the TTS chain rejects it. Within local, the local_tts_engine field picks Piper (default) or Kokoro-82M; see Voice |
Empty or omitted chain means “use the default priority order with the primary removed.”
TOML Bash Blocklist (v0.3.78)
A new TOML-driven bash blocklist provides runtime-configurable safety gates for shell commands. The blocklist lives in a TOML file and defines patterns that the agent’s bash tool will refuse to execute:
# safety.toml (example)
[bash_blocklist]
patterns = ["rm -rf /", "dd if=", "mkfs", ":(){ :|:& };:"]
- Patterns are matched against the command string before execution
- The blocklist reloads on file change (no restart needed)
- Configurable per-profile, so different environments can have different safety gates
- Blocked commands return a clear error explaining which pattern matched
This replaces hardcoded safety checks with a user-extensible system. You can add project-specific dangerous commands without code changes.
Safety TOML Reload (v0.3.78)
All safety-related TOML files (bash blocklist, brain verification rules) now hot-reload on change. Edit the file and the new rules take effect immediately on the next tool call. No restart, no /reload, no config manager dance.
CLI Commands
OpenCrabs has a full CLI with 20+ subcommands for managing every aspect of the agent.
Usage
opencrabs [COMMAND] [OPTIONS]
Commands
| Command | Description |
|---|---|
chat (default) | Launch the TUI chat interface |
daemon | Run in background (channels only, no TUI) |
agent | Interactive multi-turn chat or single-message mode |
run | Execute a single prompt non-interactively; --quiet suppresses UI chrome for machine-pure stdout, --format picks text/json/markdown (v0.5.4) |
cron | Manage scheduled tasks (add/list/remove/enable/disable/test) |
channel | Channel management (list, doctor) |
memory | Memory management (list, get, stats, prune) |
session | Session management (list, get) |
db | Database management (init, stats, clear) |
logs | Log management (status, view, clean, open) |
service | System service management (install/start/stop/restart/status/uninstall) |
status | Show agent status |
doctor | Run connection health check; --fix repairs stuck cron rows, stale markers and permissions (v0.3.83) |
onboard | Run the setup wizard |
completions | Generate shell completions (bash/zsh/fish/powershell) |
version | Show version info |
!command | Bang operator: Run any shell command instantly without an LLM round-trip. Output shown as system message. e.g. !git status, !ls -la |
/evolve | Auto-update: Downloads latest release and hot-restarts. Runs automatically on startup when [agent] auto_update = true |
/restart | Restart (v0.3.79): Relaunches the same binary with the same arguments, so nothing about how it was started has to be known or repeated. Unfinished turns resume automatically on startup. In the TUI it resumes the current session. Owner-only on channels; announces before acting. |
/exit | Shutdown (v0.3.79): Shuts OpenCrabs down. Starting it again needs access to the machine it runs on, so this is the one command with no way back from chat. Owner-only on channels; announces before acting. |
/clear | Fresh session (v0.5.2): Closes the current session and starts a blank one in place, without the summariser call, so it is instant. Owner-only on channels. |
/btw | Parallel agent: Spawns an isolated sub-agent for a side task while the main conversation continues. e.g. /btw research the latest Rust async patterns |
/mission-control | Mission Control: Full-screen dashboard showing RSI inbox (pending proposals), activity log (improvements applied), and cron schedule. Navigate with vim keys, apply/reject proposals with a/r. |
/skills | Skills picker: Browse and launch workflow templates with fuzzy-finding. Every loaded skill auto-registers as a slash command. |
/security-audit | Security audit: Comprehensive language-agnostic security & CVE audit. Detects project type, runs the right scanner, reviews recent diff for injection/auth/crypto patterns, scores 0-100. |
/cost-estimate | Cost estimate: Codebase cost-to-build estimate, AI-assisted ROI breakdown, and fair-market valuation. Asks for business context before producing the valuation range. |
/repo-audit | Repo audit: Language-agnostic repository health checks. 5-phase pipeline: language detection → native tool execution → git metrics → AST analysis → scoring + recommendations. Covers Rust, JS/TS, Python, Go. |
/goal | Autonomous goal loop: Set a goal with /goal <text> and the agent loops autonomously: executing, self-evaluating with an LLM judge, and continuing until the goal is satisfied or the turn budget (default 20) runs out. Supports /goal pause, /goal resume, /goal status, /goal clear. |
/models <provider/model> | Direct model switch (v0.3.66): Switch directly to a specific model on every channel. Use /models anthropic/claude-sonnet-4-20250514 to switch immediately. The apply-to-scope selector lets you choose session-only or global scope. |
opencrabs session set-model | Headless model switch (v0.3.66): Switch models from the CLI without the TUI. Useful for scripts and automation. |
Configuration Flags
| Flag | Default | Description |
|---|---|---|
[agent] auto_update | true | Auto-install new releases on startup and hot-restart. Set to false to keep the manual prompt dialog. |
[agent] force_default | false | (v0.3.66) When true, pushes the default provider/model pair to all sessions on config reload. Useful for enforcing a global model switch. |
[agent] config_drift_warnings | true | (v0.3.66) Show startup warnings when a config value silently drifts from the expected default. Helps catch unintended config changes. |
Keyboard Shortcuts (TUI)
| Shortcut | Action |
|---|---|
F12 | Toggle mouse capture on/off for native terminal text selection |
Startup Update Prompt
When a new version is available, a centered dialog appears on the splash screen asking you to accept (Enter) or skip (Esc). Accepting triggers /evolve automatically. After update, the binary restarts and the splash shows the new version.
Channel Commands
/doctor, /help, /usage, /evolve, /restart, /exit, and system commands work directly on Telegram, Discord, Slack, and WhatsApp without going through the LLM. They execute instantly and return results in the channel.
/restart and /exit announce themselves before acting, because once the process is gone nothing is left to report a failure. Both are owner-only, like every other command that changes the running process. /exit is the one command with no way back from chat: recovering needs access to the machine OpenCrabs runs on.
Since v0.3.80, a spoken stop is honoured too, telling the bot to stop in natural language works on channels and in the TUI, not just the bare word “stop”.
All channel command logic is centralized in src/channels/commands.rs (847 lines) – a shared handler that eliminates duplicated command logic across 5 channel implementations. Each channel delegates to try_execute_text_command() for consistent behavior.
/evolve on channels now runs directly (downloads + installs the binary) without requiring an LLM round-trip. Previously it was routed through the agent.
Chat Mode
# Default: launch TUI
opencrabs
# Same as above
opencrabs chat
Agent Mode
Non-interactive mode for scripting and automation:
# Interactive multi-turn chat
opencrabs agent
# Single-message mode
opencrabs agent -m "What files changed today?"
Daemon Mode vs TUI
OpenCrabs runs in one of two modes. Pick the one that fits the machine. For any one profile, run only one at a time.
| Mode | How you start it | What it is | Use it on |
|---|---|---|---|
| TUI (interactive) | opencrabs | The full terminal UI: chat panes, sessions, settings. Your channels run too and share your session. | A machine you sit at (laptop/desktop) |
| Daemon (headless) | opencrabs daemon, or install as a service: opencrabs service install && opencrabs service start | No UI. Channels only (Telegram, Discord, Slack, WhatsApp) + cron. Survives reboots, SSH disconnects, and crashes. | An always-on box or VPS |
Why not both at once?
A bot credential (e.g. a Telegram token) can only hold one live getUpdates poll. If a daemon and a TUI both own the same profile’s token they fight (HTTP 409) and the channel drops.
The TUI always wins
When you open the TUI while a daemon for the same profile is running, the TUI shuts that daemon down first, takes over the channels, and shows a banner saying so. Your channels were already set up, so they just resume, no reconnecting. The daemon stays down until you start it again (opencrabs service start, or relaunch opencrabs daemon).
On a box where the daemon usually runs, the everyday flow is: open opencrabs when you want to sit down with it; close the TUI and opencrabs service start when you want it headless again.
Auto-start on boot
- Daemon: use the service installer (
opencrabs service install); it wires up systemd (Linux) / launchd (macOS) to start on boot and restart on crash. This is the recommended always-on setup. - TUI: to have the terminal UI open automatically on login, use a terminal/desktop autostart, not the service installer:
- Linux desktop: drop a
.desktopfile in~/.config/autostart/withExec=x-terminal-emulator -e opencrabs. - macOS: System Settings > General > Login Items > add a
.commandscript that runsopencrabs. - VPS over SSH: run inside
tmux/screenand reattach. On a headless VPS you usually want the daemon, not the TUI.
- Linux desktop: drop a
Strongly recommended for everyday users. If you plan to use OpenCrabs daily, ask it to set itself up as a system service. Just say something like “set yourself up to start with my computer” or “remove the auto-start service”. The agent handles the launchd (macOS) or systemd (Linux) setup and removal for you automatically.
Keep the TUI running on a VPS (tmux)
If you want the full interactive TUI always available on a remote server (not the headless daemon), tmux is the way. Your session survives SSH disconnects, laptop sleep, and flaky connections.
1. Install tmux
# Debian / Ubuntu
sudo apt install tmux
# RHEL / CentOS / Fedora
sudo yum install tmux
2. Find where opencrabs is installed
which opencrabs
# If that returns nothing, search the whole filesystem
find / -name "opencrabs" -type f 2>/dev/null
3. Start a named tmux session
tmux new -s opencrabs
4. Launch opencrabs inside it
opencrabs
5. Detach (leaves opencrabs running)
Press Ctrl+B, then D. You can now close SSH and opencrabs keeps running.
6. Reattach later
tmux attach -t opencrabs
That’s it. Come back from any machine, reattach, and pick up where you left off. If you only need channels (Telegram, Discord, Slack, WhatsApp) running headless without the TUI, the daemon is a better fit: opencrabs service install && opencrabs service start.
Health Endpoint
Add to config.toml to expose a health check:
[daemon]
health_port = 8080
Then GET http://localhost:8080/health returns 200 OK with JSON status. Useful for systemd watchdog, uptime monitors, or load balancers.
Service Management
Install OpenCrabs as a system service (launchd on macOS, systemd on Linux):
opencrabs service install
opencrabs service start
opencrabs service stop
opencrabs service restart
opencrabs service status
opencrabs service uninstall
Profile-aware services
Each profile gets its own independent service:
# Install a specific profile as a service
opencrabs -p hermes service install
opencrabs -p hermes service start
# Each profile gets its own service name
# macOS: com.opencrabs.daemon.hermes
# Linux: opencrabs-hermes.service
# Manage independently
opencrabs -p hermes service status
opencrabs -p hermes service stop
opencrabs -p hermes service uninstall
Multiple profiles can run as simultaneous daemon services with full isolation.
OPENCRABS_PROFILE environment variable
Set OPENCRABS_PROFILE=hermes to select a profile without the -p flag. Useful for systemd services, cron jobs, and daemon mode.
Troubleshooting: daemon stays down
If opencrabs service status says stopped:
- Did you open the TUI? Opening
opencrabsdeliberately shuts the daemon down so the interactive session can own the channels. The daemon stays down until youopencrabs service startagain. - Old builds may still have
Restart=on-failureinstead ofRestart=always. Re-generate the unit withopencrabs service install(thenservice start) to pick up the always-restart policy. - Config, keys, commands, and tools hot-reload at runtime. Editing
config.tomlorkeys.tomlnever needs a daemon restart. If a change isn’t taking effect, check the logs for aConfigWatcher: reloadedline rather than restarting.
Cron Management
# List all cron jobs
opencrabs cron list
# Add a new cron job
opencrabs cron add \
--name "Daily Report" \
--cron "0 9 * * *" \
--tz "America/New_York" \
--prompt "Check emails and summarize" \
--provider anthropic \
--model claude-sonnet-4-20250514 \
--thinking off \
--deliver-to telegram:123456
# Remove a cron job (accepts name or ID)
opencrabs cron remove "Daily Report"
# Enable/disable (accepts name or ID)
opencrabs cron enable "Daily Report"
opencrabs cron disable "Daily Report"
TUI Keyboard Shortcuts
| Key | Action |
|---|---|
Enter | Send message |
Esc | Cancel / dismiss |
Ctrl+N | New session |
Ctrl+L | Sessions screen |
Ctrl+K | Clear current session |
Ctrl+O | Toggle tool group collapse |
| | Split pane horizontally |
_ | Split pane vertically |
Ctrl+X | Close focused pane |
Tab | Cycle pane focus / Accept autocomplete |
Up/Down | Navigate suggestions / sessions |
/ | Start slash command (e.g. /help, /models) |
: | Start emoji picker |
Troubleshooting
Common issues and how to fix them.
Windows Defender Blocking OpenCrabs
Windows Defender may flag opencrabs.exe as suspicious because it’s an unsigned binary that executes shell commands and makes network requests. This is a false positive.
Add an exclusion:
- Open Windows Security → Virus & threat protection
- Virus & threat protection settings → Manage settings
- Exclusions → Add or remove exclusions
- Add an exclusion → File → select
opencrabs.exe
Or via PowerShell (admin):
Add-MpPreference -ExclusionPath "C:\path\to\opencrabs.exe"
If SmartScreen blocks the first run, click More info → Run anyway.
Binary Won’t Start or Crashes
Startup Errors
Run with debug logging to see what’s failing:
opencrabs -d chat
Logs are written to ~/.opencrabs/logs/.
Download a Previous Version
If the latest release crashes on your machine, download a previous working version from GitHub Releases:
# List all releases
gh release list -R opencrabs/opencrabs
# Download a specific version
gh release download v0.2.66 -R opencrabs/opencrabs -p "opencrabs-*$(uname -m)*$(uname -s | tr A-Z a-z)*"
/evolve: Update & Rollback
/evolve downloads the latest release from GitHub and hot-swaps the binary. It has built-in safety checks:
- Download: Fetches the platform-specific binary from GitHub Releases
- Pre-swap health check: Runs
opencrabs health-checkon the new binary (10s timeout). If it fails, the new binary is deleted and your current version stays untouched. - Backup: Creates a backup at
<binary-path>.evolve_backup - Atomic swap: Replaces the current binary
- Post-swap health check: Verifies the swapped binary works. If it fails, auto-rolls back to the backup.
- Restart: exec()-restarts into the new version
- Brain update prompt: After restart, your crab announces the new version, diffs brain templates against your local files, and offers to update them
If /evolve Fails
The most common reason is the health check caught an issue, your current version stays safe. If something went wrong after the swap:
# Restore the backup manually
cp /path/to/opencrabs.evolve_backup /path/to/opencrabs
chmod +x /path/to/opencrabs
Cargo Install Fallback
When /evolve uses cargo install (building from source), it tries the stable toolchain first. If that fails, it automatically falls back to cargo +nightly. The progress message shows which toolchain succeeded.
Check-Only Mode
The agent can check for updates without installing:
/evolve check_only=true
Bash Tool Safety
The bash tool includes a hard command blocklist that prevents catastrophic commands even if accidentally approved:
rm -rf /,sudo rm -rf .mkfs,ddto/dev/- Fork bombs
/etcoverwrites,/procwrites- Sensitive file exfiltration
- Crypto mining commands
These are blocked at the tool level: no configuration needed.
Older CPUs (Pre-2011 / No AVX)
Some features require AVX/AVX2 instructions. Since v0.2.67, OpenCrabs detects CPU capabilities at runtime and automatically hides unavailable options in the onboarding wizard.
What’s Affected
| Feature | CPU Requirement | Fallback |
|---|---|---|
| Local embeddings (memory search) | AVX (Sandy Bridge 2011+) | FTS-only keyword search (still works) |
| Local STT (rwhisper/candle) | AVX2 (Haswell 2013+) | API mode (Groq Whisper) or disabled |
| Local TTS (Piper) | None: tested on 2007 iMac | Works on any x86/ARM CPU |
| Local TTS (Kokoro) | ONNX Runtime (CPU) | Python 3.10 to 3.13 with venv |
Symptoms
- Local STT option doesn’t appear in
/onboard:voice: your CPU lacks AVX2 - Local TTS (Piper) should always be available: no CPU restrictions, works on machines as old as 2007
- Memory search falls back to text-only FTS silently
- Crash with “illegal instruction” on very old CPUs
Fix: Build from Source with CPU Targeting
# For your specific CPU (best performance)
RUSTFLAGS="-C target-cpu=native" cargo build --release
# For Sandy Bridge (AVX but no AVX2)
RUSTFLAGS="-C target-cpu=sandybridge" cargo build --release
macOS with Apple Silicon
Local STT uses Metal GPU acceleration on macOS, no CPU flags needed. Works out of the box on M1/M2/M3/M4.
Config Issues
Config Won’t Load
If config.toml has a syntax error, OpenCrabs will fail to start. Restore from backup:
# Check if a backup exists
ls ~/.opencrabs/config.toml.backup
# Restore it
cp ~/.opencrabs/config.toml.backup ~/.opencrabs/config.toml
Or reinitialize with defaults:
opencrabs init --force
Warning:
--forceoverwrites your config. Back upkeys.tomlfirst, it contains your API keys.
Manual Backup
Always keep a backup of your critical files:
cp ~/.opencrabs/config.toml ~/.opencrabs/config.toml.backup
cp ~/.opencrabs/keys.toml ~/.opencrabs/keys.toml.backup
cp ~/.opencrabs/commands.toml ~/.opencrabs/commands.toml.backup
RSI Has Never Run
Mission Control shows ⚠ RSI has never run: N tool event(s) recorded and unprocessed even though rsi_enabled = true is set.
Most common cause: self_improvement_provider is misspelled. Its value is the bare provider section name, no custom: prefix, no model appended:
[providers.custom.glm-53-max] # the name is "glm-53-max"
[agent]
self_improvement_provider = "glm-53-max" # ✅ not "custom:glm-53-max"
self_improvement_model = "..." # the model goes in its own key
Checklist:
- The provider value matches the config section name exactly (
[providers.custom.moonshotai]→"moonshotai"). - No
custom:/custom./custom/prefix anywhere in a provider reference. - The model is in its own key (
self_improvement_model), never appended to the provider. - Restart after fixing: Mission Control confirms cycles on the next run.
Fixed at source in opencrabs#1314: current main normalises misspelled values with a warning. Released versions fail silently, which is exactly why the spelling matters.
Channel Issues
Telegram
Bot not responding:
- Verify token from @BotFather is in
keys.toml - Check your numeric user ID is in
allowed_users - If
respond_to = "mention", you must @mention the bot in groups
Regenerate bot token:
- Open @BotFather on Telegram
/mybots→ select bot → API Token → Revoke- Copy new token to
keys.tomlunder[channels.telegram] - Restart OpenCrabs
Re-setup from scratch: Run /onboard:channels in the TUI.
Telegram Won’t Connect / Reconnect
If the Telegram bot stops responding or you need to re-link it, re-run the channels setup and re-confirm the token + your numeric user ID.
Fix:
- Run
/onboard:channels(TUI: opens the wizard; on a channel: the agent walks you through it). - Paste your bot token again if it’s missing (get it from @BotFather).
- Paste your numeric user ID and hit Enter to confirm.
- If the bot sends you a message on Telegram, it worked.
On a channel you can do it in one line: /onboard:channels telegram <BOT_TOKEN> <YOUR_NUMERIC_ID>.
Why you have to provide your numeric ID: Telegram’s Bot API exposes only the bot’s identity from a token (via getMe), it has no way to reveal who created the bot in BotFather. A bot only learns a human’s ID when that human messages it. The onboarding wizard auto-detects your ID via getUpdates when you leave the field blank, but that only works if (a) you’ve already messaged the bot and (b) the bot isn’t already running and consuming those updates, which is exactly the case during a reconnect. So on reconnect, message the bot first, or just paste the ID (get it from @userinfobot).
QR code / session expired:
WhatsApp sessions are stored at ~/.opencrabs/whatsapp/session.db. To reconnect:
# Delete the session file
rm ~/.opencrabs/whatsapp/session.db
# Re-pair via onboarding
opencrabs chat --onboard
Or press R on the WhatsApp onboarding screen to reset and get a fresh QR code.
Messages not received:
- Verify phone number is in
allowed_phonesusing E.164 format:"+15551234567" - Empty
allowed_phones = []means accept from everyone
WhatsApp Won’t Connect / Wrong Number Replying
Each OpenCrabs instance supports one WhatsApp account (one companion device). If you connected multiple numbers or the wrong number is replying, you need a full reset. The bot always uses the last number you connected.
Critical: Always reset the connection before connecting a new number. OpenCrabs only keeps the last paired number.
Full reset steps:
- Remove ALL linked devices from WhatsApp. Open WhatsApp on your phone, go to Settings > Linked Devices, and remove every device in the list. Don’t bother hunting for the
opencrabsone. A stale device left over from an earlier pairing is the usual reason the old number keeps replying, so the reliable fix is to clear them all and start fresh. - Reset the connection in OpenCrabs: in the TUI or from a channel, go to
/onboard:channelsand press R to reset the WhatsApp connection. Wait for confirmation that the reset is complete. - Re-pair from scratch: after the reset is confirmed, go to WhatsApp > Settings > Linked Devices > Link a Device and scan the new QR code shown by OpenCrabs.
If the bot still shows the old number after resetting, make sure you completed step 1 (removing the device from WhatsApp) before step 2.
Common issues:
| Symptom | Cause | Fix |
|---|---|---|
| Old number still replying | A stale linked device is still paired | Remove ALL linked devices from WhatsApp > Settings > Linked Devices, then press R in /onboard:channels and re-pair |
| QR code doesn’t appear | Agent is still connected (no restart triggered) | Press R in /onboard:channels to force a restart, then wait for the new QR |
| Bot doesn’t reply to anyone | response_policy is too restrictive | Set response_policy = "allowlist" and add phone numbers to allowed_phones in config.toml |
| Bot replies to everyone | response_policy is open | Set response_policy = "allowlist" or "owner_only" in config.toml |
| Bot doesn’t reply to self-chat | allowed_phones doesn’t include the paired number | The paired number’s self-chat is always allowed, regardless of allowed_phones. Check that response_policy isn’t too restrictive |
Discord
Bot not receiving messages:
- Ensure Message Content Intent is enabled in Discord Developer Portal → Bot settings
- Required intents:
gateway,guild_messages,direct_messages,message_content - Use the bot token (starts with
MTk...), not the application ID
Regenerate token: Discord Developer Portal → Bot → Regenerate Token
Slack
Both tokens required:
- Bot token (
xoxb-...): For sending messages - App token (
xapp-...): For Socket Mode (receiving events)
Without the app token, the bot can send but not receive messages.
Socket Mode: Must be enabled in app settings → Features → Socket Mode → ON
Trello
Setup:
- Get API key: trello.com/app-key
- Generate token from the same page
- Add
board_idsto config: the bot only monitors listed boards - Set
poll_interval_secs > 0to enable polling (default 0 = disabled)
General: Re-run Channel Setup
For any channel issues, re-run the onboarding wizard:
opencrabs chat --onboard
Or type /onboard:channels in the TUI.
Agent Hallucinating Tool Calls
If the agent starts sending tool call approvals that don’t render in the UI (meaning it believes it executed actions that never actually ran) the session context has become corrupted.
Fix: Start a new session.
- Press
/and typesessions(or navigate to the Sessions panel) - Press N to create a new session
- Continue your work in the fresh session
This reliably resolves the issue. A fix is coming in a future release.
Claude Code CLI Refuses to Run as Root (VPS, Docker)
Symptom: the claude_cli provider is enabled and claude is authenticated, but every request fails as soon as it spawns. In the log the CLI exits immediately with a message about --dangerously-skip-permissions not being allowed for root, or the first spawn hangs waiting on a prompt nobody can answer.
Cause: OpenCrabs runs the CLI headless with --dangerously-skip-permissions (it owns tool execution itself, so the CLI never asks). Claude Code refuses that flag when the process runs as root unless it believes it is inside a sandbox, and on a fresh install it also wants a one-time interactive acknowledgement of that mode. A VPS or container where OpenCrabs runs as root hits both.
Fix: put the acknowledgement and the sandbox marker in the CLI’s own settings file, ~/.claude/settings.json for the user OpenCrabs runs as (/root/.claude/settings.json on a root box):
{
"permissions": { "defaultMode": "bypassPermissions" },
"skipDangerousModePermissionPrompt": true,
"env": { "IS_SANDBOX": "1" }
}
Merge these keys into the file if it already exists (keep model, theme, and the rest). The CLI reads settings.json on every invocation, so no OpenCrabs restart is needed; the next spawn goes through. Verify as the same user:
echo "say OK" | claude -p --dangerously-skip-permissions
IS_SANDBOX=1 only tells Claude Code that the root check may be skipped. It does not sandbox anything, so keep the box firewalled the way you would for any root agent. On a desktop where OpenCrabs runs as your own user none of this is required.
Daemon Stays Down
If opencrabs service status says stopped:
- Did you open the TUI? Opening
opencrabsdeliberately shuts the daemon down so the interactive session can own the channels. The daemon stays down until youopencrabs service startagain. - Old builds may still have
Restart=on-failureinstead ofRestart=always. Re-generate the unit withopencrabs service install(thenservice start) to pick up the always-restart policy. - Config, keys, commands, and tools hot-reload at runtime. Editing
config.tomlorkeys.tomlnever needs a daemon restart. If a change isn’t taking effect, check the logs for aConfigWatcher: reloadedline rather than restarting.
For full daemon/service documentation, see CLI Commands: Daemon Mode vs TUI.
Local STT (Speech-to-Text)
Since v0.2.67, local STT uses rwhisper (candle, pure Rust) instead of whisper-rs/ggml. On macOS, it uses Metal GPU acceleration automatically.
Models
| Model | Size | Quality |
|---|---|---|
quantized-tiny | ~42 MB | Good for short messages |
base-en | ~142 MB | Better accuracy (English) |
small-en | ~466 MB | High accuracy |
medium-en | ~1.5 GB | Best accuracy |
Models download automatically from HuggingFace on first use.
Common Issues
Local STT option not showing in wizard: Your CPU lacks AVX2. Use API mode (Groq Whisper) instead, or build from source with RUSTFLAGS="-C target-cpu=native".
“No audio samples decoded”: Audio file is corrupt or unsupported format. Supported: OGG/Opus, WAV.
Transcription hangs: Times out after 300 seconds. Try a smaller model (quantized-tiny).
Model download fails: Check network connection. Models are fetched from HuggingFace.
Audio too short: Messages under 1 second are automatically padded to prevent tensor errors.
Disabling
[voice]
stt_enabled = false
Local TTS (Text-to-Speech)
Requirements
- Python 3 must be installed and in PATH
- Piper installs automatically in a venv at
~/.opencrabs/models/piper/venv/ - Kokoro installs its own separate venv via
kokoro-onnx+soundfile(Python 3.10 to 3.13). No systemespeak-ngis needed: theespeakng-loaderwheel carries the data inside the venv. The model (~142 MB total:kokoro-v1.0.int8.onnx114 MB +voices-v1.0.bin28 MB) downloads to~/.opencrabs/models/kokoro/
Voices
| Voice | Description | Size |
|---|---|---|
ryan | US Male (default) | ~200-400 MB |
amy | US Female | ~200-400 MB |
lessac | US Female | ~200-400 MB |
kristin | US Female | ~200-400 MB |
joe | US Male | ~200-400 MB |
cori | UK Female | ~200-400 MB |
Common Issues
“python3 -m venv failed”: Install Python 3. On Ubuntu: sudo apt install python3 python3-venv. On macOS: brew install python3.
“pip install piper-tts failed”: Network issue or pip corrupted. Fix pip first:
python3 -m pip install --upgrade pip
Telegram voice messages show no waveform: This was fixed in v0.2.64, audio is now properly encoded as OGG/Opus (RFC 7845). Update to latest version.
Voice preview not playing: Preview uses afplay (macOS), aplay (Linux), or powershell (Windows). Ensure audio output is available.
Re-setup
Run /onboard:voice in the TUI to reconfigure STT/TTS mode and re-download models.
Disabling
[voice]
tts_mode = "off"
Local Embeddings (Memory Search)
The memory search engine uses a ~300 MB embedding model (llama.cpp) for semantic search. It requires AVX on x86 CPUs.
Fallback
If embeddings can’t initialize (no AVX, download failed, disk full), memory search falls back to FTS-only (keyword matching). It still works, just less semantic.
Fix for Older CPUs
Build from source with CPU targeting (see Older CPUs above).
Model Location
Models are stored in ~/.local/share/opencrabs/models/ (platform-specific data directory).
Database Issues
Location
- Main database:
~/.opencrabs/opencrabs.db(SQLite + WAL) - WhatsApp session:
~/.opencrabs/whatsapp/session.db
Database Corruption
SQLite with WAL mode is very resilient, but if corruption occurs:
# Back up the corrupted file first
cp ~/.opencrabs/opencrabs.db ~/.opencrabs/opencrabs.db.corrupt
# Reinitialize (WARNING: loses all history)
opencrabs db init
Migration Errors
The database automatically migrates on startup (11 migrations). If migrating from an older version with sqlx, the transition is handled automatically, no manual steps needed.
Building from Source
Quick Setup
curl -fsSL https://raw.githubusercontent.com/opencrabs/opencrabs/main/scripts/setup.sh | bash
git clone https://github.com/opencrabs/opencrabs.git && cd opencrabs
cargo build --release
Build Without Voice (Smaller Binary)
cargo build --release --no-default-features --features telegram,whatsapp,discord,slack,trello
Feature Flags
| Flag | Default | Description |
|---|---|---|
local-stt | On | whisper.cpp for local speech-to-text |
local-tts | On | Piper (default) and Kokoro-82M for local text-to-speech |
telegram | On | Telegram channel |
whatsapp | On | WhatsApp channel |
discord | On | Discord channel |
slack | On | Slack channel |
trello | On | Trello channel |
Debug Mode
Run with -d for verbose logging:
opencrabs -d chat
Logs go to ~/.opencrabs/logs/ with 7-day retention.
Supported AI Providers
OpenCrabs supports 18 built-in providers + Custom OpenAI Compatible. Switch between them at any time via /models in the TUI or any channel.
| Provider | Auth | Models | Streaming | Tools | Notes |
|---|---|---|---|---|---|
| OpenCrabs (built in) | None: automatic install token | deepseek-v4.1-flash (200k ctx, multimodal) | Yes | Yes | Free, no account, no key. Set up on first run. Also serves vision, image generation and voice input |
| Anthropic Claude | API key | Claude Opus 4.6, Sonnet 4.5, Haiku 4.5 | Yes | Yes | Extended thinking, 200K context |
| OpenAI | API key | GPT-5 Turbo, GPT-5, o3/o4-mini | Yes | Yes | Models fetched live |
| GitHub Copilot | OAuth | GPT-4o, Claude Sonnet 4+ | Yes | Yes | Uses your Copilot subscription: no API charges |
| OpenRouter | API key | 400+ models | Yes | Yes | Free models available. Reasoning output support (Qwen 3.6 Plus, etc.) |
| Google Gemini | API key | Gemini 2.5 Flash, 2.0, 1.5 Pro | Yes | Yes | 1M+ context, vision, image generation |
| MiniMax | API key | M2.7, M2.5, M2.1, Text-01 | Yes | Yes | Competitive pricing, auto-configured vision |
| Moonshot Kimi | API key | k3, kimi-for-coding, kimi-for-coding-highspeed | Yes | Yes | API plan + Coding plan (Kimi token subscription), reasoning content on both |
| Xiaomi MiMo | API key (auto) | MiMo V2.5 Pro, MiMo V2 Pro, MiMo V2.5, MiMo V2 Omni, MiMo V2 Flash | Yes | Yes | Default provider for new users. Keyless mode with automatic token provisioning during collab windows. 30 models across 5 tiers. |
| z.ai GLM | API key | GLM-4.5 through GLM-5 Turbo | Yes | Yes | General API + Coding API endpoints |
| Claude CLI | CLI auth | Via claude binary | Yes | Yes | Uses your Claude Code subscription |
| Codex | OAuth (PKCE) | GPT-5.5, GPT-5.4, GPT-5.3-Codex | Yes | Yes | Native Codex subscription auth via device-code PKCE, no CLI, no API key |
| Codex CLI | CLI auth | Via @openai/codex binary | Yes | Yes | Uses your Codex subscription: free tier available |
| Command Code CLI | CLI auth | Via command-code binary | No | Yes | Uses your Command Code account, no API key stored |
| Qwen/DashScope | API key | qwen3.6-plus (default) | Yes | Yes | DashScope API-key provider (replaced OAuth rotation). Local model tool-call extraction from text (bare JSON, Claude-style XML, Qwen formats). Prompt caching via cache_control, rate limit retry with exponential backoff |
| Ollama | Optional | Any Ollama model | Yes | Yes | Native local provider: run any model via Ollama API |
| OpenCode | None | Any OpenAI-compatible model | Yes | Yes | Non-CLI OpenAI-compatible provider |
| OpenCode CLI | None | Free models (Mimo, etc.) | Yes | Yes | Free: no API key or subscription needed |
| Custom | Optional | Any | Yes | Yes | LM Studio, Groq, NVIDIA, any OpenAI-compatible API |
How It Works
- One provider active at a time per session: switch with
/models - Per-session isolation: each session remembers its own provider and model. Changing provider in the TUI does not affect other active sessions (Telegram, Discord, Slack)
- Fallback chain: configure automatic failover when the primary provider goes down
- Models fetched live: no binary update needed when providers add new models
- Function calling detection: OpenCrabs detects when a model doesn’t support tool use and warns you with a model switch suggestion, rather than silently failing
tool_choice: "auto": sent automatically for OpenAI-compatible providers when tools are active, enabling function calling on models that require explicit opt-invision_modelworks on ANY provider: addvision_model = "..."to any built-in or custom provider block and the agent routes incoming images through that model on the same endpoint. No second API key, no Gemini dependency. See Image Generation & Vision for the full two-path setup
Custom Provider Onboarding (v0.3.24)
Adding a custom OpenAI-compatible provider is now smoother:
- Paste-by-default:
Ctrl+V/Cmd+Von the API key field pastes immediately, no need to tab into the field first - Enter-to-load: type a model name not in the fetched list and press Enter, it’s added to the list and selected
- Field refresh: saved values (base URL, API key, model list) appear instantly without restarting the dialog
Provider Registry (v0.3.34)
All provider resolution now routes through a single registry source of truth: no more hardcoded if-else ladders scattered across the codebase. The registry correctly enforces api_key requirements for API providers (Anthropic, OpenAI, GitHub Copilot, Gemini, OpenRouter, MiniMax), so resolution skips them cleanly when keys are missing instead of silently falling back. Adding a new provider is now a one-file change.
Retry & Fallback Overhaul (v0.3.36)
The provider retry and fallback system was rebuilt for reliability:
- Patient backoff: defaults changed from 100ms hammering to 1s / 2s / 4s / 8s, giving rate-limited endpoints time to recover
- In-place rate limit retry: hits 3 retries on the same provider before falling through the fallback chain, preventing unnecessary provider switches
- Full fallback chain on any HTTP error: previously only 5xx/429 triggered fallback; now any HTTP error walks the chain
- Fail fast on hard-down endpoints: DNS failures and connection refused bail immediately instead of wasting retries
- Retry events surfaced to user: each retry shows as
RetryAttempt 1/3 - rate_limit_exceededso you always know what’s happening - Transient 4xx HTML pages retried: Cloudflare/nginx error pages that look like 4xx but are actually transient infra issues are now retried
Qwen Cache Auto-Enable (v0.3.30)
Custom providers targeting Qwen-shaped endpoints (base URLs containing dashscope, aliyun, aliyuncs, dialagram, or models prefixed with qwen-*) automatically get ephemeral cache_control markers on the system prompt, last streaming message, and last tool call. Zero-config cost savings for Qwen custom providers, no API key or flag needed.
Qwen Tool-Call Leak Strip (v0.3.35)
Qwen models sometimes emit bare JSON tool-call objects like {"name":"bash","arguments":{"command":"ls"}} directly in the content text instead of through the proper tool-call API. A new bare_tool_call_extractor detects and strips these leaks so they don’t appear as raw JSON in the chat output.
/models Picker (v0.3.30)
The /models command now surfaces every known provider including unconfigured ones, marked with a 🔒 lock icon and setup help text. This helps users discover available providers without needing to know which ones need API keys. Custom providers with no configured models show a helpful empty-state message instead of an inert button.
OpenRouter Reasoning
For models that support extended reasoning (e.g. Qwen 3.6 Plus), OpenCrabs sends include_reasoning: true automatically when using OpenRouter. Thinking/reasoning output is displayed in collapsible sections:
▶ Thinking... (click to expand)
The user wants to refactor...
Reasoning text wraps to screen width instead of truncating.
See Provider Setup for configuration details and API key setup.
AI Provider Setup
OpenCrabs supports 19 providers (18 built-in + Custom OpenAI-Compatible). Configure them through the onboarding wizard or manually via config.toml and keys.toml at ~/.opencrabs/.
Setup via Onboarding Wizard
The fastest way to configure a provider is the interactive wizard. Run /onboard:provider (or /onboard and navigate to step 3).
Keyboard Navigation
| Key | Action |
|---|---|
↑ / ↓ or j / k | Move between providers / models |
Enter or Tab | Advance to next field |
BackTab or Shift+Tab | Go back to previous field |
Esc | Go back to previous wizard step |
| Type any character | Filter model list (when on model picker) |
Live-Fetch Providers (recommended)
For providers with a /v1/models API endpoint, the wizard fetches the model list live after you enter your API key.
Supported: Anthropic, OpenAI, OpenRouter, Gemini, MiniMax, Qwen (DashScope), Ollama, z.ai GLM
Flow:
- Use
↑/↓to select your provider (e.g. OpenRouter) - Press
Enter: advances to the API key field - Paste your API key (e.g.
sk-or-...) - Press
Enter: triggers a live fetch from the provider’s/v1/modelsendpoint - Use
↑/↓to browse models, or type to filter (case-insensitive substring match) - Press
Enteron your chosen model: saves config and advances
Tip: If you’ve already configured a key, the wizard detects it (shown as
••••••••) and skips straight to the model picker. PressEnterto re-fetch models with the existing key.
OAuth Providers (GitHub Copilot, Codex)
No API key needed: authenticate through your browser.
Flow:
- Select GitHub Copilot or Codex
- Press
Enter: starts the device-code PKCE flow - A user code and URL appear (e.g.
github.com/login/device) - Open the URL in your browser, enter the code, and authorize
- Tokens are saved automatically to
~/.opencrabs/auth/ - Models are fetched live: pick one and press
Enter
CLI Providers (Claude CLI, OpenCode CLI, Codex CLI)
Use your existing CLI subscription: no separate API key.
Flow:
- Select the CLI provider (e.g. Claude CLI)
- Press
Enter: skips the API key field (none needed) - Models are fetched from the local binary (
claude models,opencode models, etc.) - Pick a model and press
Enter
Requirements: The CLI binary must be installed and authenticated in your PATH.
z.ai GLM (Zhipu AI)
z.ai has two endpoint types. The wizard asks which one before the API key.
Flow:
- Select z.ai GLM
- Press
Enter: advances to Endpoint Type selector - Use
↑/↓to chooseAPI(general) orCoding(CodeGeeX) - Press
Enter: advances to API key field - Paste your key, press
Enter, fetches models - Pick a model and press
Enter
Custom OpenAI-Compatible
For Ollama, LM Studio, LocalAI, Groq, NVIDIA, vLLM, or any OpenAI-compatible endpoint.
Flow:
- Select Custom OpenAI-Compatible (last in the list)
- Press
Enter: advances to Name field - Name: type a provider identifier (e.g.
ollama,lm-studio,nvidia). PressEnter, normalized to a TOML-safe key - Base URL: paste your endpoint (e.g.
http://localhost:1234/v1). PressEnter - API Key: paste if required, or leave empty for local endpoints. Press
Enter - Model: you have two options:
- Type or paste a model name: use this for newly-launched models not yet available on the live API (e.g.
qwen3.6-35b-a3b-gguf) - Press Enter on empty field: triggers a live fetch from
{base_url}/models, then pick from the list
- Type or paste a model name: use this for newly-launched models not yet available on the live API (e.g.
- Context Window: enter the token limit (e.g.
128000). PressEnter, saves and advances
Context Window Recommendation: Set to 200000 (200k tokens) for best results. OpenCrabs handles large contexts gracefully with smart auto-compaction that keeps you always up to date without manual intervention.
Local LLMs: No API key needed, just set base URL and model name. If the model is already running, paste the name directly. If you want to browse available models, leave the Model field empty and press Enter to fetch the list from your local server.
Re-running Provider Setup
| Command | What it does |
|---|---|
/onboard:provider | Jump to provider setup, return to chat when done |
/models | Switch provider/model for the current session |
/onboard | Full wizard (all steps) |
Manual Configuration (advanced)
If you prefer editing files directly, configure providers in config.toml and keys.toml.
Key Handling (v0.3.81)
keys.toml no longer drops provider API keys at runtime (#1066): four providers could silently lose their keys during config reloads. The stored-key marker has one owner, and keys already poisoned by the old marker are self-healed on load. If a provider worked yesterday and 401s today, re-check keys.toml: the fix also repairs the file in place.
OpenCrabs (built in)
This is the default a fresh install lands on: no account, no key to paste, no billing. It is the only provider that is both free and set up out of the box.
What it serves on day 0
| Capability | Model | Notes |
|---|---|---|
| Chat | deepseek-v4.1-flash | 200k context window, fixed |
| Vision | deepseek-v4.1-flash | vision_model points at the same model, so attached images work immediately |
| Image generation | gemini-2.5-flash-image | Image-only: never offered as a chat model |
| Voice in | qwen3.8-omni-flash | The endpoint answers no /v1/audio/* route, so audio rides an input_audio part on the chat request |
| Voice out | not served | A spoken reply needs another TTS engine (see Voice) |
The context window is fixed at 200k. The endpoint is free and serves one model, so context_window on this section is ignored rather than clamped.
How the key works. There is no key to find. On first use the install generates its own ID and asks inference.opencrabs.com for a caller token, then stores it in keys.toml under [providers.opencrabs]. A stored install is reused as-is, so the second launch never calls the proxy. The binary holds no shared upstream key, and the server keeps only a hash of each token. Lose keys.toml and the install requests a new token on the next launch.
Cost and limits. Free, with no usage caps during the experimental phase. To keep it that way the proxy rate limits or blocks requests that flood the service or mint installs in bulk. Normal use does not hit those protections. If limits change, the README says so before they apply.
Where your data goes. Chat and image requests are sent to inference.opencrabs.com, which forwards them to the upstream model host. If that is not acceptable for a conversation, switch providers.
Switching. Type /models and pick another provider, or run /onboard and choose Advanced. Other providers’ keys are untouched.
# config.toml
[providers.opencrabs]
enabled = false # onboarding turns this on; do not flip it by hand
default_model = "deepseek-v4.1-flash"
models = ["deepseek-v4.1-flash"]
vision_model = "deepseek-v4.1-flash" # vision on day 0
generation_model = "gemini-2.5-flash-image" # image generation on day 0, served only on the image route
stt_model = "qwen3.8-omni-flash" # transcription on day 0
enabled = false is the shipped default, and it means “not the default”, not “dead”: by-name lookups, /models, the fallback chain, and image/vision overrides can all still reach the section. What it cannot do is work without the install token, so turning it on by hand on a home that never onboarded leaves a provider with no credential. Choose it through onboarding instead.
gemini-2.5-flash-image is deliberately absent from models. It is served only on /v1/images/generations, never as a chat model, so listing it there would buy a failed chat request.
Anthropic Claude
Models: claude-opus-4-6, claude-sonnet-4-5, claude-haiku-4-5, and legacy models, fetched live from the API.
# keys.toml
[providers.anthropic]
api_key = "sk-ant-..."
# config.toml
[providers.anthropic]
enabled = true
default_model = "claude-sonnet-4-20250514"
Features: Streaming, tool use, extended thinking, vision, 200K context window.
OpenAI
Models: GPT-5 Turbo, GPT-5, and others, fetched live.
# keys.toml
[providers.openai]
api_key = "sk-YOUR_KEY"
OpenRouter: 400+ Models
Access 400+ models from every major provider through a single API key. Includes free models (DeepSeek-R1, Llama 3.3, Gemma 2, Mistral 7B).
# keys.toml
[providers.openrouter]
api_key = "sk-or-YOUR_KEY"
Get a key at openrouter.ai/keys. Model list is fetched live, no binary update needed when new models are added.
Google Gemini
Models: gemini-2.5-flash, gemini-2.0-flash, gemini-1.5-pro, fetched live.
# keys.toml
[providers.gemini]
api_key = "AIza..."
# config.toml
[providers.gemini]
enabled = true
default_model = "gemini-2.5-flash"
Features: Streaming, tool use, vision, 1M+ token context window.
Gemini also powers the separate image generation and vision tools. See Image Generation & Vision.
GitHub Copilot
Use your existing GitHub Copilot subscription: no separate API charges. Authenticates via OAuth device flow.
# config.toml
[providers.github_copilot]
enabled = true
Setup: Run /onboard:providers → select GitHub Copilot → follow the device code flow at github.com/login/device. Models are fetched live from the Copilot API.
Requirements: An active GitHub Copilot subscription (Individual, Business, or Enterprise).
z.ai (Zhipu AI)
Models: GLM-4-Plus, GLM-4-Flash, GLM-4-0520, CodeGeeX, fetched live. Two endpoint types: General API and Coding API.
# keys.toml
[providers.zai]
api_key = "your-api-key"
# config.toml
[providers.zai]
enabled = true
default_model = "glm-4-plus"
Get your API key at open.bigmodel.cn.
Qwen (DashScope)
Qwen models via DashScope. As of v0.3.81:
- Reasoning carries across turns (#1033):
preserve_thinkingis sent so multi-turn conversations keep their reasoning context - Thinking knobs are family-gated (#1034): each model family gets only the knob it actually reads (
enable_thinking, effort tiers), instead of a shared guess - Tiered families default to the recommended effort tier (#1034)
- Hosted Qwen reachable everywhere (#1040): works outside Alibaba networks and with vendor-prefixed model ids
Claude CLI
Use your existing Claude Code subscription through the local claude binary, no separate API key needed. Supports streaming and extended thinking.
# config.toml
[providers.claude_cli]
enabled = true
Requirements: The claude CLI must be installed and authenticated. Models are detected automatically.
Ollama
Run any Ollama model natively: no custom provider setup needed. Supports both local (localhost:11434) and cloud (api.ollama.com) instances.
# config.toml
[providers.ollama]
enabled = true
default_model = "llama3"
# keys.toml (optional, only for cloud Ollama)
[providers.ollama]
api_key = "your-api-key"
Features: Streaming, tool use, local model tool-call extraction from text. Models are fetched live from the Ollama API.
Requirements: Ollama must be running locally (ollama serve) or you must have a cloud Ollama API key.
OpenCode CLI
Use the local opencode binary for free LLM completions, no API key or subscription needed. Supports NDJSON streaming and extended thinking.
# config.toml
[providers.opencode_cli]
enabled = true
Requirements: The opencode binary must be installed and available in your PATH. Models are fetched live via opencode models.
Codex CLI
Use OpenAI’s @openai/codex CLI as a native provider. User authenticates once via codex CLI; OpenCrabs piggybacks on cached credentials, zero API key handling. Non-interactive mode via codex exec --json with JSONL streaming.
# config.toml
[providers.codex_cli]
enabled = true
Models: GPT-5.5, GPT-5.4, GPT-5.3-Codex
Requirements: The codex CLI must be installed (npm install -g @openai/codex) and authenticated. Models are detected automatically.
Command Code CLI
Spawns the command-code CLI (also installed as cmd) in non-interactive mode (command-code -p) and uses it as the LLM backend, so an existing Command Code account works with no separate API key. OpenCrabs keeps tools, memory, and context local.
# config.toml
[providers.command_code_cli]
enabled = true
default_model = "deepseek/deepseek-v4-flash"
Auth comes from ~/.commandcode/auth.json, written by the CLI itself. The model list mirrors command-code --list-models, and the CLI validates the name against what your account can reach.
Unlike the Claude and Codex CLIs, command-code -p answers in plain text rather than NDJSON, so the provider collects stdout and translates it into one streamed message. That means no token-by-token streaming: the reply arrives in a single chunk.
Features: tools handled locally, model list from the CLI, no API key to store
Codex OAuth
Native OpenAI Codex subscription auth via device-code PKCE flow. No CLI dependency, no API key. User authenticates through browser once; tokens stored in ~/.opencrabs/auth/codex.json with automatic refresh and background rotation.
# config.toml
[providers.codex]
enabled = true
Models: GPT-5.5, GPT-5.4, GPT-5.3-Codex (curated GPT-5 model list)
Setup: Run /onboard:provider → select Codex OAuth → follow the device code flow at auth.openai.com/codex/device. Two-step PKCE exchange: device auth poll → authorization code → token exchange.
Requirements: An active OpenAI Codex subscription. No CLI installation needed.
MiniMax
Models: MiniMax-M2.7, MiniMax-M2.5, MiniMax-M2.1, MiniMax-Text-01
# keys.toml
[providers.minimax]
api_key = "your-api-key"
Get your API key from platform.minimax.io. Model list comes from config.toml (no /models endpoint).
Moonshot Kimi
Models: k3, kimi-for-coding, kimi-for-coding-highspeed, fetched live from the API.
# keys.toml
[providers.moonshot]
api_key = "your-api-key"
# config.toml
[providers.moonshot]
enabled = true
default_model = "k3"
endpoint_type = "api" # "api" (API plan) or "coding" (Coding plan)
reasoning_effort = "max" # Sent only when the active model accepts it; a no-op otherwise
Two endpoint types, chosen in onboarding or with /models:
- API plan (
api): pay-as-you-go atapi.moonshot.ai/v1, key from platform.moonshot.ai - Coding plan (
coding): Kimi token subscription atapi.kimi.com/coding/v1, key from kimi.com
A base_url you set always wins over the plan default. Kimi’s reasoning_content works on both endpoints.
Features: streaming, tools, OpenAI-compatible API, live model list, reasoning content
Custom (OpenAI-Compatible)
Use for Ollama, LM Studio, LocalAI, Groq, or any OpenAI-compatible API.
# config.toml
[providers.custom.lm_studio]
enabled = true
base_url = "http://localhost:1234/v1"
default_model = "qwen2.5-coder-7b-instruct"
models = ["qwen2.5-coder-7b-instruct", "llama-3-8B"]
Local LLMs: No API key needed, just set
base_urlanddefault_model.Remote APIs (Groq, etc.): Add the key in
keys.toml:[providers.custom.groq] api_key = "your-api-key"
Multiple Custom Providers
Define as many as you need with different names:
[providers.custom.lm_studio]
enabled = true
base_url = "http://localhost:1234/v1"
default_model = "qwen2.5-coder-7b-instruct"
[providers.custom.ollama]
enabled = false
base_url = "http://localhost:11434/v1"
default_model = "mistral"
Naming Custom Providers
The provider’s name is the last segment of its config section, nothing else.
[providers.custom.moonshotai] # the name is "moonshotai"
When you reference the provider anywhere (self_improvement_provider, subagent_provider, plan_provider, execute_provider, or the /models command) use that bare name:
[agent]
self_improvement_provider = "moonshotai" # ✅ bare section name
self_improvement_model = "kimi-k2.5" # the model has its own key
Never carry the custom path into the reference, and never append the model:
self_improvement_provider = "custom:moonshotai" # ❌ RSI silently never runs
self_improvement_provider = "custom.moonshotai" # ❌ same
self_improvement_provider = "moonshotai/kimi-k2.5" # ❌ provider-only, model goes in self_improvement_model
Real case: a user with
[providers.custom.glm-53-max]setself_improvement_provider = "custom:glm-53-max"and RSI silently never ran, Mission Control showed thousands of tool events recorded and unprocessed. Dropping thecustom:prefix fixed it instantly (opencrabs#1314). Current main auto-corrects misspelled values with a warning; released versions fail silently, so spell it bare.
Free Prototyping with NVIDIA API
Kimi K2.5 is available for free on the NVIDIA API Catalog, no billing required.
# config.toml
[providers.custom.nvidia]
enabled = true
base_url = "https://integrate.api.nvidia.com/v1"
default_model = "moonshotai/kimi-k2.5"
# keys.toml
[providers.custom.nvidia]
api_key = "nvapi-..."
Fallback Provider Chain
Configure automatic failover when the primary provider fails (rate limits, outages, errors). Fallbacks are tried in order until one succeeds.
# config.toml
[providers.fallback]
enabled = true
providers = ["openrouter", "anthropic"] # Tried in order on failure
Each fallback provider must have its API key configured in keys.toml. Both complete() and stream() calls are retried transparently, no changes needed downstream.
Single fallback shorthand:
[providers.fallback]
enabled = true
provider = "openrouter"
Or just ask your Crab: “Set up fallback providers using openrouter and anthropic”, it will configure config.toml for you at runtime.
Quota Circuit Breaker (v0.3.79)
Fallback chains now know the difference between a provider that is momentarily busy and one that is genuinely out of quota.
- Hard quota exhaustion (your account has run out of credits/allowance for the period) trips a TTL circuit breaker on that provider. While the breaker is open the provider is skipped in fallback walks instead of being retried pointlessly, so failover lands on a provider that can actually serve the request.
- Transient throttles (short rate limits, 429s that clear in seconds) are classified separately and retried as before, they never trip the breaker.
- When every provider in the chain is exhausted, the failure is reported explicitly as chain exhaustion rather than surfacing as a confusing error from the last provider tried.
- Retry notices now name the provider and model being retried, and state whether the cause was a quota exhaustion or a transient throttle.
No configuration needed: it is always on whenever a fallback chain is configured.
Fallback Improvements (v0.3.80)
- Proactive setup suggestion (#1008): when no fallback chain is configured, OpenCrabs makes a one-shot suggestion to set one up, ask once, answered once, never nags again.
- HTTP 400 failover guidance (#1006, #1007): a 400-series failure now carries guidance on what to check, and a chain-exhaustion ledger records why each provider in the chain was ruled out.
- Fallback provenance in streaming logs (#969): each streamed call logs which provider actually served it, so retries and failovers are visible per call.
- Codex CLI failures route into retry and fallback (#1004, #1005) instead of surfacing as terminal errors.
Provider Configuration Fields
Every provider section ([providers.<name>]) supports these fields:
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Enable/disable the provider |
api_key | string | None | API key (loaded from keys.toml or env) |
base_url | string | None | API base URL override (for custom/local providers) |
default_model | string | None | Default model for this provider |
models | array | [] | Available models (updated at runtime via /models) |
force_default | bool | false | Push this provider’s default pair to all sessions on reload (see Force Default Provider) |
vision_model | string | None | Vision-capable model override (swaps in when images are present) |
generation_model | string | None | Image generation model override (wins over global image.generation.model) |
context_window | u32 | None | Context window size in tokens (for auto-compaction). Ignored on the built-in OpenCrabs provider, whose window is fixed at 200k |
endpoint_type | string | None | Endpoint type for providers with multiple API modes (e.g. z.ai: "api" or "coding") |
plan | string | None | Subscription tier (Kimi Code: "moderato", "allegretto", "allegro", "vivace") |
reasoning_effort | string | None | Reasoning control (e.g. "max" for Kimi K3, "on"/"off" for K2.x) |
voice | string | None | TTS voice name (e.g. "echo") |
model | string | None | TTS model override (e.g. "gpt-4o-mini-tts") |
enable_thinking | bool | None | Thinking mode for reasoning-capable models (Qwen, local providers) |
Example: full provider config:
# config.toml
[providers.minimax]
enabled = true
default_model = "MiniMax-M2.7"
vision_model = "MiniMax-Text-01"
generation_model = "MiniMax-Image-01"
context_window = 200000
force_default = true
Force Default Provider
When you set force_default = true on a provider section, a config reload pushes that provider’s default pair (provider + model) to every non-archived session, overriding their stored pairs. This enforces your chosen default across all active sessions instead of just new ones.
# config.toml
[providers.minimax]
enabled = true
default_model = "MiniMax-M2.7"
force_default = true # Pushes MiniMax M2.7 to all sessions on reload
How it works:
- Only fires when the flagged section is the active default provider (set via
/modelsordefault_providerin[agent]) - Archived sessions are never touched
- Sessions already on the target pair are skipped
- Without this flag: defaults apply to new sessions only, existing sessions keep their own provider/model
Use case: You want to roll out a new default model (e.g. MiniMax M2.7) across all active sessions immediately, not just new ones. Set force_default = true on the MiniMax section, reload config, and every session switches to M2.7.
Note: This only reinforces the default, it doesn’t override a different active provider. If a session is using Anthropic Claude and you set force_default = true on MiniMax, the Claude session stays on Claude (because MiniMax isn’t the active default).
Vision Model
When your default chat model doesn’t support vision, set vision_model to a vision-capable model on the same provider. This registers a vision tool that the agent can call, it sends the image to the vision model, gets a description back, and the chat model uses that context to reply.
# config.toml
[providers.minimax]
enabled = true
default_model = "MiniMax-M2.5"
vision_model = "MiniMax-Text-01" # Agent calls vision tool → this model describes image → M2.5 replies
[providers.openai]
enabled = true
default_model = "gpt-5-nano"
vision_model = "gpt-5-nano"
MiniMax auto-configures vision_model = "MiniMax-Text-01" on first run. You can also ask your Crab to set it up: “Configure vision model for MiniMax”, it will update config.toml at runtime.
This is separate from the Gemini image tools which provide dedicated generate_image and analyze_image tools.
Per-Session Providers
Each session remembers its provider and model. Switch to Claude in one session, Gemini in another, switching sessions restores the provider automatically.
Model Picker (v0.3.75)
The /models picker got a real overhaul:
- Opus 5 surfaced: Opus 5 now shows up via a third parallel list plus state discovery.
- Newest-first ordering: models are ordered newest-first instead of by merge order.
- claude-cli model discovery: the claude-cli model list is discovered live from the CLI instead of being hardcoded, with every claude-cli row formatted consistently.
- Reconciled against live inventory: the picker reconciles against the live model inventory so it never offers a model that isn’t actually available.
Natural Model Naming (v0.3.76)
The /models command now accepts colloquial model names. Instead of typing the exact model ID, you can say it the way people talk:
/models opus → claude-opus-4-8
/models sonnet → claude-sonnet-4-20250514
/models gpt5 → gpt-5
/models qwen max → qwen3.8-max-preview
The resolver normalizes spacing, case, and common abbreviations before matching against the provider’s model list. Exact matches still take priority.
Plan/Execute Provider Routing (v0.3.76)
The /plan and /execute commands can now route onto their own dedicated provider and model, separate from the main chat provider:
# config.toml
[agent]
plan_provider = "anthropic"
plan_model = "claude-opus-4-8"
execute_provider = "openrouter"
execute_model = "anthropic/claude-sonnet-4"
This lets you use a stronger model for planning (where reasoning quality matters most) and a faster/cheaper model for execution (where throughput matters). If unset, both fall back to the session’s active provider.
Image Generation & Vision
OpenCrabs supports image generation (text-to-image and img2img) and vision analysis (image-to-text). Vision works through two paths, pick whichever fits your provider setup.
Vision: Two Paths
Path A: vision_model on Your Active Provider (Preferred)
Set vision_model = "<model>" inside the provider block you’re already using. Works for every built-in and custom provider. No second API key needed, the agent calls analyze_image against the vision model on the same provider endpoint.
# keys.toml
[providers.openrouter]
api_key = "sk-or-..."
# config.toml
[providers.openrouter]
model = "anthropic/claude-sonnet-4"
vision_model = "google/gemini-2.5-flash" # ← any vision-capable model on the same endpoint
When a user sends an image and the chat model can’t handle it natively, the agent routes the image through vision_model, gets a text description back, and replies with that context.
Example: User sends an image while you’re on MiniMax M2.5 (no native vision). The agent calls the vision tool, which sends the image to MiniMax-Text-01 (or any model you set), gets the description, and M2.5 replies using that context.
Why this is preferred:
- Single API key, single billing account
- Works on any OpenAI-compatible endpoint (OpenRouter, Ollama, LM Studio, vLLM, Groq, custom)
- No extra onboarding step: just add one line to your existing provider block
Path B: Gemini Global Fallback
Use this only when your active provider has no vision-capable model. Gemini acts as a dedicated vision+image backend, independent of your chat provider.
# keys.toml
[image]
api_key = "AIza..." # ← MUST go here. See gotcha below.
# config.toml
[image.generation]
enabled = true
model = "gemini-3.1-flash-image-preview"
[image.vision]
enabled = true
model = "gemini-3.1-flash-image-preview"
Get a free API key from aistudio.google.com. Configure interactively with /onboard:image.
⚠️ Gotcha: #[serde(skip)] on [image.vision] api_key
The api_key field under [image.vision] in config.toml is silently ignored: it’s marked #[serde(skip)] in the source. Always put the Gemini key in keys.toml under [image], never in config.toml. If vision reports as unavailable despite a key being set, this is almost always the cause.
Diagnostic: Why Is Vision Unavailable?
is_vision_available logs the exact reason at INFO level with target=vision. Search your daily log:
grep 'target=vision' ~/.opencrabs/logs/opencrabs.$(date -u +%Y-%m-%d)
Common causes surfaced:
- Missing
vision_modelon active provider (the only field actually required since v0.3.64) - Missing
api_keyfor that provider - Missing Gemini
[image] api_keyinkeys.toml - Key placed in
config.tomlwhere#[serde(skip)]drops it
v0.3.64 change: setting
vision_modelon your active provider is now sufficient to enable vision. Theenabledflag under[image.vision]is no longer required. The vision roll-through tries each provider endpoint and falls back to Gemini last.
Image Generation: Two Routes
Generation is a different path from vision. Vision turns an image into text; generation turns a prompt into an image. The generate_image tool is registered by whichever route resolves first, and generation never needs a Gemini key when your own provider can serve it.
Route A: generation_model on a Provider (Preferred)
Set generation_model inside a provider block you already use. The model is that provider’s own image model, and the endpoint comes from the same base_url as the chat traffic:
# config.toml
[providers.openrouter]
model = "anthropic/"
vision_model = "google/gemini-2.5-flash"
generation_model = "black-forest-labs/flux-1.1-pro" # ← drives generate_image
Works for every built-in and custom provider. The backend wire is picked from the endpoint rather than guessed: a Gemini host uses the Gemini API, anything else uses /v1/images/generations with Bearer auth. So an OpenAI-compatible provider that serves images needs nothing but the field.
The Built-in OpenCrabs Provider Serves Images on Day 0
The built-in provider is not text only. Its shipped block already names an image model:
# config.toml
[providers.opencrabs]
enabled = false # onboarding turns this on when you pick OpenCrabs
default_model = "deepseek-v4.1-flash"
models = ["deepseek-v4.1-flash"]
vision_model = "deepseek-v4.1-flash"
generation_model = "gemini-2.5-flash-image" # served only on /v1/images/generations
stt_model = "qwen3.8-omni-flash"
Three things about that block are worth knowing, because each one looks like a bug if you do not:
gemini-2.5-flash-imageis not inmodels. It is served only on the image route, never as a chat model, so/modelswill never offer it and listing it there would buy you a failed chat request.context_windowis ignored on this provider. The endpoint is free and fixed at 200k, so a value set here changes nothing.enabled = falseis the shipped default. Onboarding turns it on and writes the install token intokeys.tomlunder[providers.opencrabs] api_key. Flippingenabledby hand without that token leaves you with a provider that has no credential.
Provider Chain for Generation
generate_image walks a chain, the same way vision does (#1672):
- The session’s current provider, if it has
generation_model. - The
[providers.fallback] generationlist, in order. - The global Gemini
[image.generation]section, last.
# config.toml
[providers.fallback]
generation = ["openrouter", "qwen-image"] # provider section names, tried in order
Each entry is a provider name (the key of a [providers.<name>] or [providers.custom.<name>] section). The model is that provider’s own generation_model; endpoints are derived from the provider block and never guessed.
The
enabledflag under[image.generation]gates ONLY the global Gemini fallback. A provider route registersgenerate_imageeven with it off. That is the whole point of #1672: an image model on a provider you already pay for works without a second Gemini key and without enabling the fallback.
Route B: Gemini as the Dedicated Image Backend
When no provider on your list serves images, use the global Gemini section described under Path B above. It handles vision input and image output in one request, and it is the only leg the [image.generation] enabled flag controls.
Which One Am I Using?
A successful generation does not name the route it took; the result is just the saved file path. The chain is visible when it fails, because every candidate is tried and the aggregate error lists them in order as backend(model):
All 2 image generation candidates failed - openai(flux-1.1-pro): 404 ... | gemini(gemini-2.5-flash-image): 400 ...
So the diagnostic is: generate once, and read the error if it comes back empty. A gemini(...) leg after an openai(...) leg means your provider route was tried first and did not work. If the tool answers with the setup hint instead, no route resolved at all:
Image generation is not configured. Options: `/image gemini <GOOGLE_AI_KEY>` for Gemini,
or set `generation_model = "<model>"` on a provider section ...
Agent Tools
When vision or image generation is enabled, these tools become available:
| Tool | Description |
|---|---|
generate_image | Generate an image from a text prompt: saves to ~/.opencrabs/images/; walks a provider chain with vision parity, so generation falls back the same way vision does (v0.5.4, #1672) |
analyze_image | Analyze an image file or URL via the active vision path (Path A provider or Gemini fallback) |
Example prompts:
- “Generate a pixel art crab logo”: agent calls
generate_image, returns file path - “What’s in this image: /tmp/screenshot.png”, agent calls
analyze_image
img2img: Edit Images with Context
generate_image accepts an optional image parameter (local file path or HTTPS URL). When provided, the model modifies, restyles, or composites onto that image instead of generating from scratch.
User: "Make this logo darker and add a border"
Agent: generate_image(prompt="dark background with thin white border", image="/tmp/logo.png")
- Gemini wire: the input rides along as an
inlineDatapart next to the prompt. - OpenAI-compatible wire: the request switches from
/images/generationsto/images/edits, with oneimage[]part per input. Any model on that endpoint that accepts edits can restyle or composite.
Use cases: replace elements, restyle photos, composite logos onto backgrounds, modify user-uploaded images in-place.
Incoming Images from Channels
When a user sends an image from any channel, it arrives as <<IMG:/tmp/path>> in the message. The file is already downloaded, the agent can:
- See it directly (if the chat model supports vision natively)
- Pass the path to
analyze_imagefor vision processing - Use the path in
bashcommands or any tool that accepts file paths - Reference it in replies with
<<IMG:path>>to forward to channels
analyze_video: Frame-Extraction Fallback (v0.3.36)
The analyze_video tool sends the full video to Gemini’s video API for multimodal analysis. When that fails (network error, upload timeout, unsupported format), the agent falls back to ffmpeg frame extraction:
- Extract frames at 1 fps via ffmpeg
- Cap at 30 frames (one frame per second for the first 30 seconds)
- Send each frame to Gemini vision via
analyze_image - Combine per-frame descriptions into a chronological summary
This means analyze_video works even when the video API is unreachable, as long as ffmpeg is installed and at least one vision path (Path A or Path B) is configured. The fallback activates automatically. No user configuration needed.
Model Choices
- Path A: any vision-capable model on your active provider. On OpenRouter:
google/gemini-2.5-flash,anthropic/claude-sonnet-4,openai/gpt-4o. On Ollama:llava,bakllava. On custom endpoints: whatever the server offers. - Path B:
gemini-3.1-flash-image-previewhandles both vision input and image output in a single request.
Channel Integrations
OpenCrabs connects to multiple messaging platforms simultaneously. All channels share the TUI session by default, with per-user sessions for non-owners.
Setting Up Channels
Channels are configured through the onboarding wizard, not by editing TOML files manually.
Running the Wizard
- First launch: the wizard runs automatically
- Re-run: type
/onboardin chat, or/onboard:channelsto jump straight to the channels step - Quick jump:
/onboard:channelsopens the channel picker and returns to chat when done
Navigation
The channel picker is a keyboard-driven TUI screen:
| Key | Action |
|---|---|
↑ / ↓ or j / k | Move focus between channels |
Space | Toggle the focused channel on/off |
Enter on an enabled channel | Open that channel’s setup screen |
Enter on Continue | Skip remaining setup and advance |
Tab | Same as Continue: advance to the next wizard step |
Esc | Go back to the previous step |
Channel Setup Screens
When you press Enter on an enabled channel, a dedicated setup screen opens with the fields needed for that platform (bot token, channel ID, allowed users, etc.). Each field:
- Auto-detects existing values from
config.toml/keys.toml(shown as masked••••••••for secrets, plain text for IDs) - Tab moves to the next field
- Enter on the last field (or the Test Connection button) saves and returns to the channel list
- BackTab moves to the previous field
The Five Channels
| # | Channel | Setup Fields | Test |
|---|---|---|---|
| 0 | Telegram | Bot Token, Owner User ID, Respond To | Send test message |
| 1 | Discord | Bot Token, Channel ID, Allowed Users, Respond To | Send test message |
| 2 | QR Code scan, Phone Allowlist | Connection status | |
| 3 | Slack | Bot Token, App Token, Channel ID, Allowed Users, Respond To | Send test message |
| 4 | Trello | API Key, API Token, Board ID, Allowed Users | Board access check |
After enabling and configuring your channels, the wizard saves everything to config.toml and keys.toml automatically. You can always re-run /onboard:channels to modify settings.
Supported Channels
| Channel | Protocol | Images In | Voice In | Image Gen Out | Setup |
|---|---|---|---|---|---|
| Telegram | Long polling | Vision pipeline | STT | Native photo | Bot token |
| Discord | WebSocket | Vision pipeline | STT | File attachment | Bot token |
| Slack | Socket Mode | Vision pipeline | STT | File upload | Bot + App token |
| QR pairing | Vision pipeline | STT | Native image | QR code | |
| Trello | REST API | Card attachments | - | Card attachment | API key + token |
Cross-Channel Session Resolution (v0.3.29)
All messaging channels now share a stable [chat:<id>] suffix pattern for reliable session lookup. Previously only Telegram had this; Discord, Slack, and WhatsApp used exact-title matching which broke when the agent auto-renamed sessions (creating duplicates on every message).
The shared channels::session_resolve module provides:
- Suffix-first lookup: fast path using
[chat:discord-dm-<user_id>],[chat:slack-<channel_id>],[chat:wa-<phone>]etc. - Legacy forward-migration: pre-suffix rows are migrated to the suffix format on first lookup
/sessionsbinding: explicit chat→session binding on switch so user choices win over suffix lookup
Follow-Up Cancel (v0.3.30)
Sending a message while the agent is mid-run now acts as ESC x2 (cancel current run) across all channels. The cancelled partial content is preserved, and the new message starts a fresh agent turn.
ZIP Attachments (v0.3.30)
ZIP file attachments from users are extracted and processed inline:
- Text files are inlined into the conversation
- Images get vision markers for multimodal processing
- PDFs get text extraction
- Capped at 50 files / 10 MB per ZIP entry
Group Onboarding & /cowork (v0.3.74)
Getting a bot into a group and making it useful is now a single flow:
- /cowork opens the group:
/coworksets the target groupopen = trueand persists it (#718). - /cowork admin deep link: the
/coworkdeep link requests admin rights, so the bot joins already promoted (#709). - Group onboarding greeting: the bot greets the group with an onboarding nudge when it joins (#707, #708).
- Per-group /start registration:
/startin a group registers the member per-group instead of the staleconfig.tomllecture (#708). - Register joining members: any member who joins a bot group is auto-registered (#710).
- Secure by default: member auto-registration is gated to
open = truegroups (#717).
Follow-Up Suggestions (v0.3.74)
- follow_up_question degrades gracefully: returns the question as plain text on non-interactive surfaces (#716).
- Telegram follow-up taps:
suggest_followupsrenders last, fixing taps doing nothing (#723, #724). - Accurate description: the
suggest_followupstool description is channel-accurate, so the model invokes it instead of writing plain-text suggestions (#706). - Outbound media dedup: an identical file+caption re-uploaded to the same chat within a short window is collapsed, so the agent can’t send it twice (#721).
Common Features
All messaging channels support:
- Shared session with TUI (owner) or per-user sessions (non-owners)
- Slash commands:
/help,/models,/new,/sessions, custom commands - Inline buttons: Provider picker, model picker, session switcher (Telegram, Discord, Slack)
- User allowlists: Restrict access by user ID, chat ID, role, or phone number. Since
v0.5.1 the allowlists are deny-by-default and are the access boundary: on Discord and
Slack an unconfigured channel (no
allowed_users, noallowed_roles, nobot_owner) refuses every message, matching Telegram; on WhatsApp an emptyallowed_phonesno longer grants anyone owner rights. Because the defaultapproval_policyisauto-always, the allowlist is what decides who can drive tools at all, set it deliberately respond_tofilter:all,dm_only, ormention(respond only when @mentioned)
File & Media Support
| Channel | Images (in) | Text files (in) | Documents (in) | Audio (in) | Image gen (out) |
|---|---|---|---|---|---|
| Telegram | Vision pipeline | Extracted inline | PDF note | STT | Native photo |
| Vision pipeline | Extracted inline | PDF note | STT | Native image | |
| Discord | Vision pipeline | Extracted inline | PDF note | STT | File attachment |
| Slack | Vision pipeline | Extracted inline | PDF note | STT | File upload |
| Trello | Card attachments → vision | Extracted inline | - | - | Card attachment |
| TUI | Paste path → vision | Paste path → inline | - | STT | [IMG: name] display |
Images are passed to the active model’s vision pipeline if it supports multimodal input, or routed to the analyze_image tool (Google Gemini vision) otherwise. Text files are extracted as UTF-8 and included inline up to 8,000 characters.
Proactive Channel Tools
The agent can send messages and take actions proactively:
| Tool | Actions |
|---|---|
discord_send | 17 actions: send, reply, react, edit, delete, pin, create_thread, send_embed, etc. |
slack_send | 17 actions: send, reply, react, edit, delete, pin, set_topic, send_blocks, send_file (TTS voice via OGG/Opus) |
trello_send | 22 actions: create_card, move_card, add_comment, add_checklist, search, etc. |
Channel Voice Parity
All four messaging channels (Telegram, Discord, WhatsApp, Slack) now share a single code path via crate::channels::voice::{transcribe, synthesize}. Bot replies are recorded in the channel_messages table for conversation context, previously only user messages were stored.
Typing Indicator Persistence (v0.3.76)
Typing indicators now survive background tasks. Previously, when the agent spawned a background task (long build, test suite), the typing indicator would drop because the foreground turn ended. Now the indicator stays alive until the final response is delivered, regardless of how many background tasks run in between.
Smart Chunk Boundaries (v0.3.78)
When a response exceeds platform message limits and must be split into chunks, the splitter now prefers boundaries that leave no markup open. Previously, a chunk could end mid-bold (**text) or mid-code-fence, causing rendering glitches on the receiving platform. The splitter now scans for the nearest safe break point where all markdown delimiters are balanced.
Owner-Gated Channel Commands (v0.3.80)
User-defined slash commands and skills are owner-gated on the channel catch-all arm (#975). In a group chat, only the bot owner can trigger custom commands and skills; other members’ messages fall through to normal conversation. This closes a gap where any group member could run owner-defined automation through the catch-all routing path.
Telegram
Connect OpenCrabs to Telegram for DMs and group chats.
Setup
Step 1: Create a Bot with BotFather
- Message @BotFather on Telegram
- Send
/newbotand follow the prompts - Copy the bot token (format:
123456:ABC-DEF...)
Step 2: Configure via the Onboarding Wizard
Run /onboard:channels (or /onboard and navigate to the Channels step):
- Use
↑/↓to focus Telegram - Press
Spaceto toggle it on - Press
Enterto open the Telegram setup screen - Fill in the fields:
- Bot Token: paste the token from BotFather
- Owner User ID: your numeric Telegram chat ID
- Respond To:
all,dm_only, ormention(when to respond in groups)
- Press
Enteron Test Connection to verify the bot works - Press
Enterto save and return to the channel list
Get your chat ID by messaging @userinfobot on Telegram.
Manual Configuration (advanced)
If you prefer editing files directly, the wizard writes to ~/.opencrabs/keys.toml and ~/.opencrabs/config.toml:
# keys.toml
[channels.telegram]
bot_token = "123456:ABC..."
# config.toml
[channels.telegram]
enabled = true
allowed_users = ["123456789"]
respond_to = "all"
Features
- DMs and groups: Works in private chats and group conversations
- Forum topic routing (v0.3.31): In supergroups with topics enabled, the bot tracks
thread_idthrough the full pipeline. Uselist_topicsaction to map topic names (e.g.#announcements) to numeric IDs, then passthread_idtosend/reply/send_phototo route into a specific topic - Context-aware pre-tool status (v0.3.31): While a tool runs, the bot shows a live status message naming the tool, elapsed time, and either a reasoning excerpt or an anchored phrase from the user’s request
- Inline ctx budget footer (v0.3.36): context budget footer (
ctx: XK/YK Z% | N tok/s) is now appended to the last response message instead of sent as a separate message. Keeps the chat clean.
v0.3.76–v0.3.78 Improvements
/new Gating (v0.3.76)
The /new command is now gated to the bot owner in group chats. Non-owners cannot create new sessions or reset context. The command menu is also scoped: owners see the full menu, non-owners see only the commands available to them.
HTML Conversion (v0.3.77)
All telegram_send actions now apply HTML-to-Telegram conversion consistently. Previously, only the main response path converted HTML entities; proactive sends, follow-ups, and media captions could arrive with raw <b> tags or unescaped ampersands.
Rich Delivery (v0.3.78)
Telegram delivery is unified on markdown formatting. The legacy “blocks path” (which sent structured JSON blocks) has been removed in favor of a single rich-markdown renderer. This eliminates formatting inconsistencies between streaming responses and proactive sends.
Callback Routing (v0.3.78)
Inline keyboard callbacks (plan approvals, follow-up taps, dedup approvals) now route to the originating session instead of the chat-bound session. Previously, tapping a button in a group chat could route the callback to the wrong session if multiple sessions shared the same chat.
Background Streaming (v0.3.78)
Background task results now stream through one turn per session instead of spawning a new message per tick. This eliminates the message flood when a background task (build, test suite) produces incremental output.
Follow-Up Attribution (v0.3.78)
When a user taps a follow-up suggestion button in a group chat, the agent now names the member who tapped it. Previously, follow-up taps were anonymous in group contexts.
Other Fixes
/startrecognizes existing members of closed groups (v0.3.76)- Plan-card serialisation prevents duplicate cards on concurrent refreshes (v0.3.76)
- Follow-up taps run a real tools turn instead of echoing text (v0.3.76)
- Flow block no longer posts a new message every tick (v0.3.77)
- Echoed plan titles dropped from responses (v0.3.77)
- Open-group registration gated on persisted open flag (v0.3.78)
- Cowork members recorded on first message (v0.3.78)
- Rolling status edit-in-place (v0.3.36): tool status messages (⚙️ running, ✅ done) are edited in-place instead of delete+recreate, preventing flicker and preserving scroll position.
- Bot command hot-reload (v0.3.36): bot commands refresh automatically when config or skills change, without restarting the bot.
- Guard tok/s against burst-delivery (v0.3.36): tok/s footer is guarded against burst-delivery artifacts so the number stays stable.
follow_up_questionpolish (v0.3.34): Telegram keyboard is now single-column with a 40-character label cap (longer options rejected with a clear error). The rolling “Running follow_up_question (16s)” status is suppressed while the keyboard is pending so buttons don’t get visually buried. The LLM is instructed to call the tool silently without echoing the question text in surrounding prose- Inline buttons: Provider picker, model picker, session switcher use Telegram inline keyboards
- Image support: Send images to the bot, receive generated images
- Voice messages: STT transcription + TTS response
- All slash commands:
/help,/models,/new,/sessions, custom commands - Owner vs non-owner: Owner uses the shared TUI session, non-owners get per-user sessions
- Onboarding overhaul (v0.3.30): Auto-detects owner user ID from
getUpdates, persists partial config on cancel, only Enter on the last step commits (Tab no longer silently rewrites ~30 config keys) - Teloxide upgrade + join detection (v0.3.35): Upgraded from teloxide 0.13 to 0.17. New members joining a group are now detected before the allowlist check, so the bot can greet or moderate join events. Marathon-bucket rolling status rotates through project-author quip pool for more varied status messages.
v0.3.81 Improvements
Mermaid Diagrams as Images (#1044)
Mermaid code fences in rich messages render as images via the markdown+media route, while tables stay native Telegram formatting instead of being rasterized into the image.
Delivery and Rate-Limit Hardening
- Rich blocks decode as a typed AST (#1058) instead of ad-hoc string surgery, so structured messages can’t arrive mangled
- Inline rate-limit waits capped at 30s (#1064): a Telegram 429 never parks a turn indefinitely
- Flow footer + section cap (#1052, #1053, #1054, #1056): flow logs get a footer and bounded sections instead of unbounded message growth
Group Safety
- Only the owner may add the bot to a group (#1042)
- Bot-add detection (#1041): being added by a member is told apart from another bot arriving
- Unauthorised chats are never recorded (#1043): chats that were never approved leave no session residue
v0.3.82 Improvements
Long Rate-Limit Windows Bail Immediately (#1110)
A Telegram 429 that asks for a long wait no longer sleeps inline. The send returns immediately and the work is rescheduled, instead of the turn parking on a multi-minute (or multi-hour) window. This closes the failure mode where one throttled send held a turn open long enough to look like a hang.
Delivery Correctness
- Rich sends stop building a double-slash URL (#1117): a trailing slash on the API base no longer produces
//bot<token> - Rich API calls honour
set_api_url(#1088): the rich path used a hardcodedapi.telegram.org, so it bypassed a redirected Bot. It now routes through the caller’s API URL like every other method, which also makes the path testable without a real network call - All six send arms route through thread resolution: forum-topic targeting is applied consistently instead of on some arms only
Observability
- Send-correlation telemetry (#1085): the three send chokepoints, every
telegram_sendarm, and the final streaming edit-in-place are all logged, so a message that never arrived can be traced to the arm that dropped it
Configuration
All Telegram options live under [channels.telegram] in ~/.opencrabs/config.toml:
[channels.telegram]
enabled = true
token = "123456:ABC-DEF..." # or store in keys.toml
allowed_users = ["123456789"] # numeric Telegram user IDs
allowed_channels = ["-100123456"] # restrict to specific group/channel IDs (empty = all)
respond_to = "mention" # "all", "dm_only", "mention" (default)
session_idle_hours = 24.0 # idle timeout for non-owner sessions
rich_messages = false # native Telegram rich messages (Bot API 10.1)
silence_group_start = true # silently ignore /start from non-allowed users in groups
bot_owner = ["123456789"] # owner IDs (gated commands, /cd hidden dirs, /profiles)
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the Telegram bot channel |
token | None | Telegram Bot API token from @BotFather |
allowed_users | [] (accept all) | Numeric Telegram user IDs. Accepts int or string arrays. Empty = open mode |
allowed_channels | [] (all channels) | Restrict bot to specific channel/group IDs. DMs always pass |
respond_to | "mention" | When to respond in groups: "all" = every message, "dm_only" = ignore groups, "mention" = only when @mentioned or replied-to |
session_idle_hours | None (no timeout) | Idle timeout in hours for non-owner sessions. Owner sessions never expire |
rich_messages | true (since v0.3.64) | Send structured replies as native Telegram rich messages (tables, headings, lists, math). Requires current mobile/desktop Telegram clients. Telegram Web and older clients show a “not supported” placeholder. Toggle via the onboarding checkbox or config |
silence_group_start | true | Silently ignore /start from non-allowed users in group chats. Users who need their ID can DM the bot |
bot_owner | [] (first allowed_user) | Bot owner user IDs. Owners can access gated commands (/profiles, hidden files in /cd), manage profiles. Defaults to first entry in allowed_users |
guest_queries | false | Answer Telegram Guest Mode tags: someone tags the bot in a chat it is not a member of and gets one reply there. Callers must be the owner, an admin, or listed for that chat. See Guest queries |
Per-group access control (per-chat ACL)
Telegram groups can have their own member list, so a user can be allowed in one group without gaining DM access:
allowed_users(channel level): admins: may DM the bot and act in any chat.bot_owner: the owner: always allowed everywhere.[channels.telegram.groups.<chat_id>].allowed_users: allowed in that group only. These users are refused in DMs unless they are also an admin or the owner, which closes the “DM the bot privately to escape group oversight” bypass.
DMs are gated to admins + owner. If neither allowed_users nor bot_owner is set, the bot is unconfigured and stays open (no hard lockout); set either one to lock it down.
Each group can also override respond_to just for itself.
[channels.telegram]
allowed_users = ["111"] # admins: DM + any chat
respond_to = "mention" # global default
[channels.telegram.groups.-1001234567890]
allowed_users = ["222", "333"] # allowed in this group only, never via DM
respond_to = "all" # per-group override of the global respond_to
respond_to accepts all, mention, dm_only, or auto (reply to all while there is at most one active sender, then switch to mention-only once a second unique sender appears).
Per-group open mode (v0.3.66)
Set open = true on a trusted group to serve all members without individual allowlisting:
[channels.telegram.groups.-1001234567890]
open = true # all members can talk, no per-user registration needed
Use this for public/community groups where you want the bot available to everyone. Members still can’t DM the bot unless they’re in the global allowed_users or bot_owner.
Guest queries
Telegram Guest Mode (Bot API 10.0) lets someone tag @yourbot in a chat the bot is not a member of. With guest_queries = true, OpenCrabs answers the tag right there using the API method answerGuestQuery.
[channels.telegram]
guest_queries = true # default false: guest tags are ignored
allowed_users = ["111"] # admins: answered anywhere
[channels.telegram.groups.-1001234567890]
allowed_users = ["222"] # this user is answered in this chat only
Default is off, and the gate is narrow once it is on. The caller must be the bot_owner, an admin (allowed_users), or listed for that chat. A group’s open = true grants nothing here: it opens that group to the bot, it does not authorize answering guest tags from its members. Refused queries are logged with the guest_query_id, the caller, and the chat.
Boundaries of a guest turn:
- The bot sees only the tagged message, no history from that chat, and nothing from the guest turn is stored in that chat’s history.
- A guest turn runs the same tool surface as a normal turn, with one exception: tools that need approval are denied, because approvals are buttons in a chat and the caller is not the machine’s owner. The tool set is capped at what a stranger should reach (#2134).
- The live status block and rich rendering match a normal turn: the guest sees the same progress chrome and the same markdown or rich reply, and an edit replaces the placeholder rather than appending a second message (#2109, #2133, #2135, #2138).
- One guest turn per session at a time, cancellable, behind a rate limit, so a tag storm cannot fan out into parallel turns (#2143).
- A reply with no tool calls is the answer alone, and the answer is never carried twice in one reply (#2113).
- Channel directives (
<<...>>) are stripped, so a local file path can never leak into someone else’s chat. - An overlong reply is cut and marked
[truncated]rather than dropped.
Because the pinned teloxide-core has no guest update variant, guest queries are read on the raw getUpdates layer, and guest_message is in the bot’s allowed_updates list. Nothing to configure for that; it is on whenever the channel runs.
Voice and file pickup in groups
In mention-only groups (respond_to = "mention"), users can share files and voice messages even when the bot isn’t directly tagged in the same message:
- Fire-and-forget file capture: The bot downloads ALL incoming voice, video, document, and audio files from group messages to
~/.opencrabs/tmp/, regardless of whether the bot was mentioned. This happens silently in the background. - Tag-then-ask: A user sends a voice message, then tags the bot in a follow-up message (e.g.
@bot what did I just say?). The bot scans the tmp directory for recent voice files from that chat (5-minute window), transcribes the most recent one, and prepends the transcript to the user’s message.
This solves the core UX problem in mention-only groups: previously, tagging the bot in the same message as a voice note didn’t work because Telegram sends voice and text as separate messages.
The agent can use telegram_send with 20+ actions. The thread_id field on send / reply / send_photo targets a specific forum topic in supergroups with topics enabled.
| Action | Description |
|---|---|
send | Send text message (with optional thread_id for forum topics) |
reply | Reply to a message |
send_photo | Send image file (supports caption and reply_parameters since v0.3.58) |
send_document | Send document (supports caption and reply_parameters since v0.3.58) |
send_voice | Send voice message |
list_topics | Returns (thread_id, topic_name) pairs the bot has observed: translate #announcements into a numeric thread_id |
pin / unpin | Pin or unpin a message |
set_reaction | Add an emoji reaction |
| And more… |
Reactions (v0.3.58)
The bot understands Telegram emoji reactions in both directions:
- Inbound: when a user reacts to one of the bot’s messages with an emoji, the bot picks up that reaction (it looks up the original bot message by its platform message ID) and can act on it as feedback.
- Frame reactions (v0.3.61): inbound reactions are read by sentiment and the bot addresses the user by first name in its response.
- Mid-turn reactions (v0.3.61): if a user reacts during a running turn, the reaction injects into the current loop instead of spawning a second turn.
- Reaction-only replies: when a short acknowledgement says it all (a thumbs-up, a 👀, a 😂), the bot can respond with just a reaction instead of a full text message, keeping the chat uncluttered.
- Emoji validation: only real emoji count as reaction directives; code spans and stray characters are ignored, and react directives are stripped from intermediate status messages so they never leak into the visible reply.
Use the set_reaction action on telegram_send to add a reaction to a specific message from the agent.
/cowork: Workspace Creation (v0.3.59)
/cowork creates a team workspace directly from Telegram. Run it in your DM with the bot:
- Send
/coworkin your DM with the bot - The bot replies with an invite link and QR code for a new group
- Scan the QR code or tap the link to create the group
- Add your friends or teammates to the group
- Members auto-register to the group’s allow list (
[channels.telegram.groups.<chat_id>].allowed_users), not the global one. Both new joiners (via invite link) and existing members (on their first message) get registered. Cowork members can talk in the group but cannot DM the bot privately unless also on the globalallowed_users. The owner gets a confirmation for each registration.
/cowork works from any surface. In Telegram DMs, the native flow activates directly. From the TUI, Discord, Slack, or WhatsApp, the agent calls the cowork_connect tool which mints a session, registers it with the bot, and returns the t.me deep link plus a scannable QR code PNG.
Flow Logs (v0.3.63)
Telegram’s rich API supports 32K-character processing-log blocks. When the agent runs multi-step operations (tool calls, research, code generation), it streams progress into a single flow-log message that grows as the turn progresses. For shorter messages, HTML formatting falls back to plain text.
Flow logs show:
- Tool calls with parameters and results
- Intermediate reasoning steps
- File edits and git operations
- Build/test progress
- Wall-clock duration (v0.3.66): finished/failed/timeout states carry the total turn time
- Bash comments as flow status (v0.3.66): line-start comments in a bash command surface as live flow status
- Full status preview (v0.3.66): the status preview uses the whole last human-readable line, no truncation
The flow-log message is edited in-place as each step completes, so the channel stays clean. Users see real-time progress without message spam.
Flow blocks re-stick to the chat bottom when buried (v0.3.65), so you always see the latest progress without scrolling.
Forum Topic Management and /clear (v0.5.2)
The agent can create and rename forum topics (not just route into existing ones), and a group’s session can bind to a topic so each topic keeps its own conversation context. /clear starts a fresh session in place (the current one closes and a blank one begins) without invoking the summariser, so it is instant and free (#1585).
Group Chat Behavior
In groups, the agent:
- Responds when mentioned by name or replied to
- Stays quiet when the conversation doesn’t involve it
- Tracks context from group messages passively
Discord
Connect OpenCrabs to Discord for server and DM interactions.
Setup
Step 1: Create a Discord Bot
- Go to discord.com/developers/applications
- Create a new application
- Go to Bot section, create a bot
- Enable MESSAGE CONTENT Intent (required: under Privileged Gateway Intents)
- Copy the bot token
- Under OAuth2 → URL Generator, select
botscope withSend MessagesandRead Message Historypermissions - Use the generated URL to invite the bot to your server
Step 2: Configure via the Onboarding Wizard
Run /onboard:channels (or /onboard and navigate to the Channels step):
- Use
↑/↓to focus Discord - Press
Spaceto toggle it on - Press
Enterto open the Discord setup screen - Fill in the fields:
- Bot Token: paste the token from the Developer Portal
- Channel ID: the Discord channel to send the welcome message to (right-click a channel with Developer Mode on → Copy Channel ID)
- Allowed Users: comma-separated Discord user IDs (since v0.5.1 an empty allowlist no longer allows everyone: until you set users, roles, or
bot_owner, the channel denies all messages) - Respond To:
all,dm_only, ormention
- Press
Enteron Test Connection to verify - Press
Enterto save and return to the channel list
Enable Developer Mode in Discord: Settings → Advanced → Developer Mode
Manual Configuration (advanced)
# keys.toml
[channels.discord]
token = "your-bot-token"
# config.toml
[channels.discord]
enabled = true
allowed_channels = ["123456789"]
allowed_users = []
respond_to = "all"
Configuration
All Discord options live under [channels.discord] in ~/.opencrabs/config.toml:
[channels.discord]
enabled = true
token = "your-discord-bot-token" # or store in keys.toml
allowed_users = ["123456789012345678"] # Discord user IDs
allowed_channels = ["123456789012345678"]
respond_to = "mention" # "all", "dm_only", "mention" (default)
session_idle_hours = 24.0 # idle timeout for non-owner sessions
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the Discord bot channel |
token | None | Discord bot token from the Developer Portal |
allowed_users | [] (denies unless roles/owner configured) | Discord user IDs. Accepts int or string arrays. Any one of allowed_users, allowed_roles, bot_owner configures the channel; a configured one admits allowlisted users, holders of an allowed role (never in DMs), or the owner |
allowed_channels | [] (all channels) | Restrict bot to specific channel IDs |
respond_to | "mention" | When to respond: "all", "dm_only", "mention" |
session_idle_hours | None (no timeout) | Idle timeout for non-owner sessions. Owner sessions never expire |
Features
- Server channels and DMs: Works in text channels and direct messages
- Interactive components: Select menus, modal forms, button interactions with component TTL and role access
- Media gallery: Batch generated files into one multi-attachment message
- Grouped tool calls: Consecutive tool calls collapse into one expandable block with Expand/Collapse toggle
- Reactions: Agent can add emoji reactions to messages. Emoji reactions from users trigger agent turns (parity with Slack/Telegram)
- Forum threads: Support for Discord forum channels
- Image support: Send and receive images
- Embed suppression: Agent wraps multiple links in
<>to suppress embeds - Slash commands: All built-in and custom commands work
Interactive Components (v0.3.63)
Discord buttons, select menus, and modal forms power the provider picker, model picker, and session switcher. Components support:
- Component TTL: Components expire after a configurable timeout
- Role access: Restrict component interactions to specific Discord roles
- Forum threads: Agent can create and manage forum threads
Media Gallery (v0.3.63)
When the agent generates multiple files (PDFs, spreadsheets, images), Discord batches them into one multi-attachment message instead of sending separate messages for each file.
Grouped Tool Calls (v0.3.63)
Consecutive tool calls collapse into a single expandable block in Discord. Users can toggle between expanded and collapsed views. This keeps the channel clean during multi-step operations.
Reactions (v0.3.63)
The agent can add emoji reactions to messages. When a user reacts with an emoji, it triggers an agent turn (parity with Slack and Telegram). This enables quick, lightweight interactions without typing full messages.
Formatting Notes
- Markdown tables in agent output convert to native Discord tables (v0.5.2); in your own messages, bullet lists are still the safest habit
- Wrap multiple links in
<url>to suppress embeds
Live Reply Tracing, Auto-Threading, Native Tables (v0.5.2)
Long turns stream as a live reply that is traced and edited in place instead of staying silent until the end. Answers that belong together are auto-threaded, and markdown tables in agent output render as native Discord tables rather than raw pipes (#1608). A dedup guard on tool turns stops the final response from double-posting content a tool summary already showed (#1603).
Native Polls, Voice Replies, Slash Projection, Flow Groups (v0.5.5)
send_poll posts a native Discord poll with each option as its own answer button, so follow-up option sets render as the platform’s own poll UI (#1848). TTS replies are delivered as Discord voice messages instead of attachment links (#1849), and your commands.toml is projected onto native slash commands, so your custom commands appear in Discord’s command picker (#1850).
Flow groups now open at turn start with a live clock that keeps running while the agent thinks, and the activity text leads the line instead of hiding behind the tool count (#1841, #1843, #1844, #1845). Every outbound write, including the persistent plan card, rides one shared write governor that parks cleanly on 429s (#1910, #1912).
Per-channel control arrived with respond_to and open modes in the channel config, enforced in the message filter, the ACL and the command gate (#2014). Two commands set them from inside the channel itself: /respond_to picks who the crab answers there, and /cowork opens the channel or thread to its members (#2014, #2015). Cron reports on Discord arrive as one edited forum post instead of a chain of messages (#1851).
Sustained Typing Indicator (v0.3.76)
Discord now shows a sustained typing indicator while the agent processes a request. Previously, Discord had no typing indicator at all (Telegram and Slack did). The indicator stays alive through background tasks and long tool executions, so users see “OpenCrabs is typing…” for the entire processing duration, not just the first few seconds.
Slack
Connect OpenCrabs to Slack workspaces.
Setup
Step 1: Create a Slack App
- Go to api.slack.com/apps
- Create a new app (From Scratch)
- Enable Socket Mode under Settings
- Generate an App-Level Token (Settings → Basic Information → App-Level Tokens) with
connections:writescope - Under OAuth & Permissions, add bot scopes:
chat:write,channels:history,groups:history,im:history,reactions:write - Install the app to your workspace (Install App → Install to Workspace)
- Copy both tokens: they live in different places in the Slack dashboard:
- Bot Token (
xoxb-...): under Install App, in the OAuth Tokens for Your Workspace section. It only appears after you install the app to the workspace. - App-Level Token (
xapp-...): under Basic Information → App-Level Tokens. If you already generated it in step 4, Slack only lists the token name here; click the name to expand it and reveal the actualxapp-...value to copy.
- Bot Token (
Step 2: Configure via the Onboarding Wizard
Run /onboard:channels (or /onboard and navigate to the Channels step):
- Use
↑/↓to focus Slack - Press
Spaceto toggle it on - Press
Enterto open the Slack setup screen - Fill in the fields:
- Bot Token: the
xoxb-...token - App Token: the
xapp-...token - Channel ID: right-click a channel → View channel details → copy the Channel ID at the bottom
- Allowed Users: comma-separated Slack user IDs (Profile → ⋯ → Copy member ID)
- Respond To:
all,dm_only, ormention
- Bot Token: the
- Press
Enteron Test Connection to verify - Press
Enterto save
Manual Configuration (advanced)
# keys.toml
[channels.slack]
bot_token = "xoxb-..."
app_token = "xapp-..."
# config.toml
[channels.slack]
enabled = true
allowed_channels = ["C12345678"]
allowed_users = []
respond_to = "all"
Configuration
All Slack options live under [channels.slack] in ~/.opencrabs/config.toml:
[channels.slack]
enabled = true
token = "xoxb-your-bot-token" # or store in keys.toml
app_token = "xapp-your-app-token" # Socket Mode token
allowed_users = ["U12345678"] # Slack user IDs
allowed_channels = ["C12345678"]
respond_to = "mention" # "all", "dm_only", "mention" (default)
session_idle_hours = 24.0 # idle timeout for non-owner sessions
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the Slack bot channel |
token | None | Bot token (xoxb-...) |
app_token | None | App-level token for Socket Mode (xapp-...) |
allowed_users | [] (unconfigured: denies everyone) | Slack user IDs (U12345678). Since v0.5.1 a workspace with no allowlist and no bot_owner denies all messages; once configured it admits allowlisted users or the owner |
allowed_channels | [] (all channels) | Restrict bot to specific channel IDs |
respond_to | "mention" | When to respond: "all", "dm_only", "mention" |
session_idle_hours | None (no timeout) | Idle timeout for non-owner sessions. Owner sessions never expire |
Features
- Channels and DMs: Works in public/private channels and direct messages
- Action buttons: Provider picker, model picker, session switcher use Slack action buttons
- Thread support: Responds in threads when appropriate
- Slash commands: All built-in and custom commands work
- Reactions: Agent can add emoji reactions. Emoji reactions from users trigger agent turns (react-back)
- Grouped tool calls: Consecutive tool calls collapse into one edited-in-place message with Expand/Collapse toggle
- TTS voice replies: Voice responses sent as OGG/Opus files via
files.uploadwith inline waveform UI
Grouped Tool Calls (v0.3.62)
Consecutive tool calls collapse into a single message in Slack. The message is edited in-place as each tool executes. Users can toggle between expanded and collapsed views with an Expand/Collapse button. This keeps channels clean during multi-step operations.
Reactions (v0.3.62)
The agent can add emoji reactions to messages. When a user reacts with an emoji, it triggers an agent turn (react-back). This enables quick, lightweight interactions without typing full messages. Parity with Telegram and Discord.
Reactions (v0.3.62)
Slack supports emoji reactions for lightweight acknowledgements:
- React-back: When you react to a bot message, the bot acknowledges it (e.g., adds a 👍 to show it saw your reaction)
- Reaction turns: Certain reactions can trigger agent actions (configurable)
- Grouped tool calls: Multiple tool calls in one turn collapse into a single collapsible message, keeping the channel clean
Native Rendering (v0.3.80)
Slack messages render in Slack’s own shape instead of raw markdown (#1016):
- Tables are converted to Slack-native layout instead of arriving as pipe characters
- Headings are rendered as Slack formatting rather than
#hashes
Step-group narration is folded on the character stream rather than on paragraphs, and the final message no longer repeats the step-group narration it already sent (#1010).
Socket Mode
Slack uses Socket Mode (WebSocket) instead of HTTP webhooks, no public URL or ngrok needed. The connection is outbound from your machine.
Connect OpenCrabs to WhatsApp via QR code pairing.
Setup
Configure via the Onboarding Wizard
Run /onboard:channels (or /onboard and navigate to the Channels step):
- Use
↑/↓to focus WhatsApp - Press
Spaceto toggle it on - Press
Enterto open the WhatsApp setup screen - The setup screen has two fields:
- Connection: shows the QR code or connection status
- Phone Allowlist: comma-separated phone numbers in E.164 format (e.g.
+15551234567). Leave empty to accept all messages.
- When not yet paired, a QR code appears in the terminal:
- Open WhatsApp on your phone → Settings → Linked Devices → Link a Device
- Scan the QR code
- The status updates to “Connected” automatically
- When already paired, press
Ron the Connection field to reset and re-pair - Press
Enterto save
The pairing session persists across restarts: no need to re-scan.
Manual Configuration (advanced)
# config.toml
[channels.whatsapp]
enabled = true
allowed_phones = ["+15551234567"]
Configuration
WhatsApp options live under [channels.whatsapp] in ~/.opencrabs/config.toml:
[channels.whatsapp]
enabled = true
allowed_phones = ["+15551234567"] # E.164 format
session_idle_hours = 24.0 # idle timeout for non-owner sessions
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the WhatsApp channel |
allowed_phones | [] (open replies under auto, but never owner rights) | E.164 phone numbers. Since v0.5.1 an empty list no longer makes every sender the bot owner, owner commands (/evolve, /rebuild, /exit, /cd) and approval answers need the self-chat, bot_owner, or the resolver over bot_owner + allowed_phones |
session_idle_hours | None (no timeout) | Idle timeout for non-owner sessions. Owner sessions never expire |
response_policy | "auto" | Who the bot responds to. auto: reply to all while there is at most one active sender, then switch to mention-only once a second unique sender appears. owner_only: only the bot owner. allowlist: only allowed phones. open: everyone |
bot_owner | None (auto-seeded from allowed_phones[0]) | Phone number of the bot owner in E.164 format. The owner gets access that other allowlisted users do not. Commands that expose personal data or the host system are owner-only |
How it works
One account per instance. Each OpenCrabs instance supports one WhatsApp account (one companion device). You run the bot AS whatever account you scan: your own number (talk via “Message Yourself”), or any other number you own, including a WhatsApp Business account.
The bot talks to itself. If you message the bot’s own paired number, the bot replies to you. This is by design. The paired account’s self-chat is always allowed, regardless of response_policy or allowed_phones.
Allowlist behavior. Anyone messaging the paired number who is on the allowed_phones
list gets a reply. The response_policy controls who else can interact beyond the allowlist.
Ownership (v0.5.1, deny-by-default). Before v0.5.1 an empty allowed_phones under
response_policy = "auto" answered every contact and elevated them all to owner: one
forgotten allowlist away from handing strangers /evolve and /cd. That elevation is gone:
being answered no longer means being in charge. Owner status comes from the paired
account’s self-chat, a configured bot_owner, or ownership resolution over
allowed_phones + bot_owner: never from an empty list. Tool-approval replies
(Yes/Always/No/YOLO) resolve only for the owner on all four channels.
- Personal and group chats: Works in DMs and group conversations
- Image support: Send and receive images
- Voice messages: STT transcription + TTS response
- Plain text UI: No buttons (WhatsApp limitation), uses text-based menus
- Slash commands: All built-in and custom commands work
Outbound rate limiting
WhatsApp is the channel with the heaviest ban consequences, so every outbound send goes through a budget (since v0.5.1):
[channels.whatsapp.rate_limit]
messages_per_minute = 30 # token bucket: sustained sends per minute
daily_cap = 800 # rolling 24h hard cap
| Mechanism | Behavior |
|---|---|
| Per-minute pacing | A token bucket sized to messages_per_minute (default 30) refills continuously. An over-budget send is paced, not dropped: the caller sleeps for the refill gap and then sends. Set 0 to disable pacing. |
| Rolling daily cap | The 24h window allows daily_cap sends (default 800). On saturation further sends park in a FIFO queue; a background drainer flushes them as the window slides. A queued quote-reply loses its quote context, the text still arrives. Set 0 to disable the cap. |
| Owner alert | The first send queued in a saturation episode alerts the bot owner exactly once (through the WhatsApp session), and the alert re-arms when traffic drops back under the cap. |
| Owner bypass | Messages addressed to the owner skip budget consumption entirely, so you always get fast replies; the saturation alert itself is also exempt. |
Streaming answers used to post every chunk as its own message, exactly the volume pattern Meta’s heuristics hunt. Outbound replies now edit one message in place (since v0.5.1), which keeps chunked turns well inside the budget; the limiter is the safety net underneath.
Formatting Notes
- No markdown tables: use bullet lists
- No headers: use bold or CAPS for emphasis
- Links render natively
Voice Message Handling
When receiving a voice message:
- Agent downloads and transcribes via STT
- Sends text response first (searchable)
- Optionally generates TTS audio response
Features
- Personal and group chats: Works in DMs and group conversations
- Image support: Send and receive images
- Voice messages: STT transcription + TTS response
- Plain text UI: No buttons (WhatsApp limitation), uses text-based menus
- Slash commands: All built-in and custom commands work
Surface (v0.5.2)
The WhatsApp channel grew to match the phone app’s surface:
- Outbound: native voice notes (opus), edit-in-place streaming for long replies, pin, forward, and profile actions
- Inbound: video, stickers, location, contacts, reactions, and poll votes are parsed into the turn; presence events and media recovery fill gaps after reconnects
- Sessions: disappearing messages honored per chat, contact blocking, per-chat history with reaction acknowledgements
- Surfaces: status updates and newsletter discovery, native-flow buttons for interactive prompts; follow-up suggestion sets that exceed the native button cap render as a poll, and a vote selects the option (#1616)
Troubleshooting
Wrong number replying
Each OpenCrabs instance supports one WhatsApp account (one companion device). If you connected multiple numbers or the wrong number is replying, you need a full reset. The bot always uses the last number you connected.
Critical: Always reset the connection before connecting a new number. OpenCrabs only keeps the last paired number.
Full reset steps:
- Remove ALL linked devices from WhatsApp. Open WhatsApp on your phone, go to Settings > Linked Devices, and remove every device in the list. Don’t bother hunting for the
opencrabsone. A stale device left over from an earlier pairing is the usual reason the old number keeps replying, so the reliable fix is to clear them all and start fresh. - Reset the connection in OpenCrabs: in the TUI or from a channel, go to
/onboard:channelsand press R to reset the WhatsApp connection. Wait for confirmation that the reset is complete. - Re-pair from scratch: after the reset is confirmed, go to WhatsApp > Settings > Linked Devices > Link a Device and scan the new QR code shown by OpenCrabs.
If the bot still shows the old number after resetting, make sure you completed step 1 (removing the device from WhatsApp) before step 2.
Common issues
| Symptom | Cause | Fix |
|---|---|---|
| Old number still replying | A stale linked device is still paired | Remove ALL linked devices from WhatsApp > Settings > Linked Devices, then press R in /onboard:channels and re-pair |
| QR code doesn’t appear | Agent is still connected (no restart triggered) | Press R in /onboard:channels to force a restart, then wait for the new QR |
| Bot doesn’t reply to anyone | response_policy is too restrictive | Set response_policy = "allowlist" and add phone numbers to allowed_phones in config.toml |
| Bot replies to everyone | response_policy is open | Set response_policy = "allowlist" or "owner_only" in config.toml |
| Bot doesn’t reply to self-chat | allowed_phones doesn’t include the paired number | The paired number’s self-chat is always allowed, regardless of allowed_phones. If it’s not working, check that response_policy isn’t too restrictive |
Trello
OpenCrabs integrates with Trello for board and card management via the trello_send tool.
Setup
Step 1: Get Trello Credentials
- Go to trello.com/power-ups/admin
- Create a new Power-Up to get your API Key
- Click the “Token” link next to your API key to generate an API Token
Step 2: Configure via the Onboarding Wizard
Run /onboard:channels (or /onboard and navigate to the Channels step):
- Use
↑/↓to focus Trello - Press
Spaceto toggle it on - Press
Enterto open the Trello setup screen - Fill in the fields:
- API Key: from the Trello Power-Up admin page
- API Token: generated alongside the API key
- Board ID: board name or 24-character hex ID (names are resolved automatically)
- Allowed Users: Trello member IDs allowed to interact with the bot (leave empty for all members)
- Press
Enteron Test Connection to verify board access - Press
Enterto save
Manual Configuration (advanced)
# keys.toml
[channels.trello]
api_key = "your-api-key"
token = "your-token"
# config.toml
[channels.trello]
enabled = true
boards = ["Board Name or ID"]
allowed_users = []
# poll_interval_secs = 30 # Poll for new card comments
Configuration
All Trello options live under [channels.trello] in ~/.opencrabs/config.toml:
[channels.trello]
enabled = true
token = "your-trello-api-token" # or store in keys.toml
app_token = "your-trello-api-key" # stored as app_token for keys.toml symmetry
allowed_users = ["memberId1"] # Trello member IDs
board_ids = ["boardId1", "boardId2"] # boards to monitor (also accepts allowed_channels)
poll_interval_secs = 60 # polling interval (absent or 0 = tool-only mode)
session_idle_hours = 24.0 # idle timeout for non-owner sessions
| Field | Default | Description |
|---|---|---|
enabled | false | Enable the Trello channel |
token | None | Trello API token |
app_token | None | Trello API key (stored as app_token for keys.toml symmetry) |
allowed_users | [] (accept all) | Trello member IDs |
board_ids | [] (all boards) | Board IDs to monitor for @mentions. Also accepts allowed_channels as alias |
poll_interval_secs | None (tool-only) | Polling interval in seconds. Absent or 0 = no polling (tool-only mode) |
session_idle_hours | None (no timeout) | Idle timeout for non-owner sessions. Owner sessions never expire |
Tool Actions
The trello_send tool supports 22 actions:
| Action | Description |
|---|---|
create_card | Create a new card |
get_card | Get card details |
update_card | Update card fields |
move_card | Move card to another list |
archive_card | Archive a card |
find_cards | Search for cards |
add_comment | Add a comment to a card |
get_card_comments | Read card comments |
add_checklist | Add a checklist to a card |
add_checklist_item | Add an item to a checklist |
complete_checklist_item | Mark checklist item done |
add_label_to_card | Add a label |
remove_label_from_card | Remove a label |
add_member_to_card | Assign a member |
remove_member_from_card | Unassign a member |
add_attachment | Attach a file or URL |
list_boards | List accessible boards |
list_lists | List columns in a board |
get_board_members | Get board members |
search | Search across boards |
get_notifications | Get notifications |
mark_notifications_read | Mark notifications read |
Behavior
- Tool-only by default: The agent acts on Trello only when explicitly asked
- Optional polling: Set
poll_interval_secsto enable monitoring for@bot_usernamementions - Image attachments: Generated images are sent as card attachments with embedded previews
- File attachments: Card attachments (images, documents) are fetched and processed through the vision pipeline
Built-in Tools
OpenCrabs ships with 50+ tools available to the agent out of the box, plus support for user-defined dynamic tools.
File Operations
| Tool | Parameters | Description |
|---|---|---|
ls | path | List directory contents |
glob | pattern, path | Find files by glob pattern |
grep | pattern, path, include | Search file contents with regex |
read_file | path, line_start, line_end | Read file contents |
edit_file | path, old_string, new_string | Edit files with search/replace |
write_file | path, content | Write new files |
Byte-safe line operations (v0.5.14)
The line operations in edit_file (replace_lines, insert_line, delete_lines) splice the file’s bytes directly instead of splitting on newlines and joining them back. A file keeps its final newline, and a CRLF file stays CRLF: untouched lines are copied verbatim, and inserted text adopts the line ending the file already uses. hashline_edit follows the same rule, and the fuzzy fallback stopped retargeting the whole file’s endings when it fixed one line.
Code Execution
| Tool | Parameters | Description |
|---|---|---|
bash | command, timeout | Execute shell commands |
execute_code | language, code | Run code in sandboxed environment |
Web & Network
| Tool | Parameters | Description |
|---|---|---|
web_search | query | Search the web (multi-engine fan-out; results deduped by URL across engines, v0.5.4) |
serper_search | query | Google SERP results via Serper; set the key in keys.toml (serper.dev) (v0.5.4) |
web_scrape | url | Native URL-to-markdown scraping with SSRF protection, sitemap crawling, JS-shell detection (v0.3.60) |
http_request | method, url, headers, body | Make HTTP requests |
Document Parsing
| Tool | Parameters | Description |
|---|---|---|
parse_document | path | Extract text from PDF, DOCX, XLSX, XLS, XLSM, XLSB, ODS, DOC, CSV, HTML, TXT, MD, JSON, XML (v0.3.61 added spreadsheet support; v0.3.80 added xlsm/xlsb/ods via calamine, legacy .doc via rwml, and VBA macro source extraction from macro-enabled workbooks) |
Document Generation
| Tool | Parameters | Description |
|---|---|---|
generate_document | format, content, style | Generate PDF, DOCX, XLSX, PPTX natively. Brand colors, logos, image blocks, live Excel formulas. Files delivered as channel attachments (v0.3.62) |
Session & Memory
| Tool | Parameters | Description |
|---|---|---|
session_search | query, limit | Semantic search across sessions |
session_context | action | Read/write session context |
task_manager | action, various | Manage plans and tasks |
decide_cached | decision input | L1 decision cache (#1648): exact-repeat decisions are served from a reuse ring keyed on canonicalized input, with a shadow tier that logs what it would answer before it goes live (v0.5.4) |
Image & Video
| Tool | Parameters | Description |
|---|---|---|
generate_image | prompt, filename | Generate images via Gemini |
analyze_image | image, question | Analyze images via Gemini vision |
analyze_video | video, question | Analyze videos via Gemini multimodal vision. Supports mp4/m4v/mov/webm/mkv/avi/3gp/flv. Inline bytes for ≤18 MB, resumable Files API upload for larger files (v0.3.17) |
Channel Integrations
| Tool | Parameters | Description |
|---|---|---|
telegram_send | action, various | Telegram operations (19 actions) |
discord_connect | action, various | Discord operations (17 actions) |
slack_send | action, various | Slack operations (17 actions) |
trello_connect | action, various | Trello operations (22 actions) |
Sub-Agent Orchestration
Agents can spawn independent child agents for parallel task execution:
| Tool | Parameters | Description |
|---|---|---|
spawn_agent | label, agent_type, prompt | Spawn a typed child agent in an isolated session |
wait_agent | agent_id, timeout_secs | Wait for a child agent to complete and return output |
send_input | agent_id, text | Send follow-up input to a running agent (multi-turn) |
close_agent | agent_id | Terminate a running agent and clean up resources |
resume_agent | agent_id, prompt | Resume a completed/failed agent with new prompt (preserves context) |
team_create | team_name, agents[] | Spawn N typed agents as a named team (parallel) |
team_broadcast | team_name, message | Fan-out message to all running agents in a team |
team_delete | team_name | Cancel and clean up all agents in a team |
Agent Types
When spawning, agent_type selects a specialized role with a curated tool registry:
| Type | Role | Tool Access |
|---|---|---|
general | Full-capability (default) | All parent tools minus recursive/dangerous |
explore | Fast read-only codebase navigation | read_file, glob, grep, ls |
plan | Architecture planning | read_file, glob, grep, ls, bash |
code | Implementation with full write access | All parent tools minus recursive/dangerous |
research | Web search + documentation lookup | read_file, glob, grep, ls, web_search, http_request |
ALWAYS_EXCLUDED tools (no agent type has these): spawn_agent, resume_agent, wait_agent, send_input, close_agent, rebuild, evolve – no recursive spawning, no self-modification from subagents.
Browser Automation
Native headless Chrome control via Chrome DevTools Protocol (CDP):
| Tool | Parameters | Description |
|---|---|---|
navigate | url | Open a URL in the browser |
click | selector | Click an element by CSS selector |
type | selector, text | Type text into an input field |
screenshot | selector | Capture a screenshot |
eval_js | code | Execute JavaScript in the page context |
extract_content | selector | Extract text content from elements |
wait_for_element | selector, timeout | Wait for an element to appear |
find | pattern, mode | Find elements by CSS, XPath, text, or aria-label. Returns stable selectors |
browser_close | - | Close browser tab and free CDP session. Prevents stale page reuse across browser actions (v0.3.18) |
Auto-detects your default Chromium browser. Feature-gated under browser (enabled by default).
Dynamic Tools
Define custom tools at runtime via ~/.opencrabs/tools.toml. See Dynamic Tools for details.
| Tool | Parameters | Description |
|---|---|---|
tool_manage | action, various | Create, remove, or reload dynamic tools |
System
| Tool | Parameters | Description |
|---|---|---|
slash_command | command, args | Execute slash commands (/cd, /compact, etc.) |
config_manager | action, various | Read/write config, manage commands |
evolve | check_only | Download latest release |
rebuild | - | Build from source and restart |
plan | action, various | Create and manage execution plans |
Error Handling
v0.2.92 improved error surfacing across all tool connections. Channel connect tools (slack_connect, whatsapp_connect, trello_connect) now surface actual connection errors instead of silently swallowing them. Tool call status correctly transitions from “running” to success/failure instead of showing a perpetual spinner.
System CLI Tools
OpenCrabs runs in a TUI with full terminal access. The agent can execute any CLI tool installed on the host via the bash tool – no plugins, no wrappers. If it’s on your system, the agent can use it. Common ones:
| Tool | Purpose | Check |
|---|---|---|
gh | GitHub CLI: issues, PRs, repos, releases, actions | gh --version |
gog | Google CLI: Gmail, Calendar (OAuth) | gog --version |
docker | Container management | docker --version |
ssh | Remote server access | ssh -V |
node | Run JavaScript/TypeScript tools | node --version |
python3 | Run Python scripts and tools | python3 --version |
ffmpeg | Audio/video processing | ffmpeg -version |
curl | HTTP requests (fallback when http_request insufficient) | curl --version |
GitHub CLI (gh)
Authenticated GitHub CLI for full repo management:
gh issue list / view / create / close / comment
gh pr list / view / create / merge / checks
gh release list / create
gh run list / view / watch
Google CLI (gog)
OAuth-authenticated Google Workspace CLI. Supports Gmail and Calendar:
gog calendar events --max 10
gog gmail search "is:unread" --max 20
gog gmail send --to user@email.com --subject "Subject" --body "Body"
Requires GOG_KEYRING_PASSWORD and GOG_ACCOUNT env vars.
Companion Tools
SocialCrabs: Social Media Automation
SocialCrabs is a social media automation tool with human-like behavior simulation (Playwright). Supports Twitter/X, Instagram, and LinkedIn.
The agent calls SocialCrabs CLI commands via bash:
node dist/cli.js x tweet "Hello world"
node dist/cli.js x mentions -n 5
node dist/cli.js ig like <post-url>
node dist/cli.js linkedin connect <profile-url>
Read operations are safe. Write operations (tweet, like, follow, comment) require explicit user approval.
WhisperCrabs: Floating Voice-to-Text
WhisperCrabs is a floating voice-to-text widget controllable via D-Bus. Click to record, click to stop, text goes to clipboard. The agent can start/stop recording, switch providers, and view transcription history via D-Bus commands.
Custom Commands
Define your own slash commands in ~/.opencrabs/commands.toml. Commands work from the TUI and all channels (Telegram, Discord, Slack, WhatsApp).
Configuration
# ~/.opencrabs/commands.toml
[commands.credits]
description = "Show remaining API credits"
action = "prompt"
value = "Check my API credit balance across all providers and give me a summary"
[commands.deploy]
description = "Deploy to production"
action = "prompt"
value = "Run the production deployment pipeline: git pull, build, test, deploy"
[commands.status]
description = "Show system status"
action = "system"
value = "System is operational. All channels connected."
Action Types
| Action | Behavior |
|---|---|
prompt | Sends the value as a message to the agent: the agent processes it like any user message |
system | Displays the value directly as a system message: no agent involvement |
Using Commands
Type /commandname in the TUI or any connected channel:
/credits → agent checks API balances
/deploy → agent runs deployment
/status → shows static system message
Visibility
Custom commands appear in:
/helpoutput (TUI and channels) under a “Custom Commands” section- TUI slash autocomplete when typing
/
Commands are sorted alphabetically and show their description.
Memory System
OpenCrabs uses a 3-tier memory system for persistent context across sessions.
Memory Tiers
1. Daily Notes (memory/YYYY-MM-DD.md)
Automatic daily files for session-specific observations:
~/.opencrabs/memory/2026-03-07.md
The agent writes here during conversations: new integrations, bugs fixed, decisions made, server changes.
2. Long-term Memory (MEMORY.md)
Curated knowledge that persists across all sessions:
- Server details, SSH access, credentials locations
- User preferences and workflows
- Integration configurations
- Lessons learned from debugging
3. Semantic Search (session_search)
Full-text search across all past sessions stored in SQLite. The agent can query:
- Previous conversations
- Tool execution history
- Past decisions and context
Memory Search
The agent uses session_search for fast memory lookups (~500 tokens) instead of reading full memory files (~15K tokens). This is the primary recall mechanism.
Chunk-Hash Caching (v0.3.82)
Embedding is skipped for chunks whose content has not changed (#1107). Each chunk carries a hash; on write, only chunks whose hash differs from the stored one are re-embedded. Editing one line of a large brain file no longer re-embeds the whole document.
Scoped Search (v0.3.80)
memory_search takes a scope that picks which corpus to search (#1020):
| Scope | Corpus | Use it for |
|---|---|---|
memory (default) | Daily logs | History: what happened, when, what was decided |
brain | Brain files (SOUL, USER, AGENTS, TOOLS, CODE, SECURITY, MEMORY, BOOT, HEARTBEAT) | Rules and policy: does a rule about this ALREADY exist, and which file owns it |
all | Both | “Have I ever written about this anywhere” |
Picking the wrong scope is the usual reason a search comes back with nothing useful. Daily logs outnumber brain files and reuse the same words for unrelated things, so searching memory for a rule usually fails: history outranks policy and you get confident irrelevant hits. Search brain before appending any rule: a hit tells you WHICH file owns it, and then load_brain_file with a query reads the whole section.
Chunked Retrieval and Index-on-Write (v0.3.80)
Memory retrieval was rebuilt around chunking (#998-1002, #1018):
- Documents are chunked before embedding, so chunks past the first are searchable. Previously a long document effectively hid everything after its opening.
- Lexical hits are narrowed to the matching chunk, so keyword results point at the relevant slice instead of the whole document.
- The index updates on write: memory is searchable immediately, not from a boot-time snapshot. Brain files are indexed into the brain collection on write too.
- The store resolves per profile, so profiles never share or cache each other’s memory index.
- The chunker is multi-byte safe: no more panics on UTF-8 boundaries.
- MEMORY.md recall is ranked with BM25 instead of shared-word counts (#996), and recall folds Latin diacritics so accented queries match.
In-tree Memory Store (v0.3.81)
The qmd binary dependency is gone (#1032). OpenCrabs now owns its memory store in-tree (src/memory/): SQLite FTS5 for lexical search plus vector embeddings in one store, resolved per profile. One fewer external binary to install or break, and the store schema ships with the binary.
External Index Paths (v0.3.81)
Memory search can read indexes that live outside the profile directory (#1051, #1055):
[memory]
# Each entry is a bare path string or a { path, pattern } table.
# Relative paths resolve against the OpenCrabs home (not the session cwd),
# so the index stays stable across /cd and profile switches.
extra_paths = [
"~/knowledge/product-docs",
{ path = "~/knowledge/website-mirror", pattern = "docs/**/*.md" },
]
| Field | Default | Description |
|---|---|---|
extra_paths | [] | Paths indexed into the external collection. Bare strings or { path, pattern } tables |
exclude | VCS/build/secret globs | Glob excludes applied to external indexing, global across all entries (.git, node_modules, .env*, *.pem, .ssh/**, *credential*, …) |
external_allowed_in_shared | false | Shared/group sessions are default-deny: external content stays out of memory_search results unless you opt in |
sweep_interval_secs | 300 | Seconds between freshness sweeps that pick up added/removed files. Modified files are also caught lazily at search time |
Indexed files are searchable within one sweep interval (~5 min), no restart needed. Results come back as ranked excerpts with file paths via memory_search scope="external"; the agent can then read the full file for verbatim quotes.
Gotchas: UTF-8 text only (binary files are skipped with a warning); HTML files index as raw markup, so mirror sites to .md first; nested roots and symlinks are skipped by design; test external scope from an owner session, group sessions return nothing unless you set external_allowed_in_shared = true.
Build a knowledge base from any docs site
web_scrape sitemap mode pairs with extra_paths into a complete, zero-cost pipeline: scrape a site to markdown, index it, then ask questions answered verbatim from those docs (see Web Scraping):
[memory]
extra_paths = ["scrapes/docs.example.com"]
web_scrape url="https://docs.example.com" mode=sitemap export=true: every sitemap page saved as clean markdown underscrapes/, local extraction, no AI/API cost (hard cap: 100 pages per scrape)- Point
extra_pathsat the scrapes directory (relative paths resolve against the OpenCrabs home) - Ask anything: answers are grounded in and quoted from the indexed docs
Structural Code Search Upgrades (v0.5.1)
The code-graph answers (who calls X, what does X call, impact of X) got four upgrades:
- Truncation is now visible. Caller sets in real repos are unbounded (5,000+ call sites exist), so every structural listing that had to cut ends with a marker line ( “… and N more callers of X (re-query with higher n or offset)”) and sets beyond 500 collapse into a per-file rollup instead of one-liners. Nothing is silently chopped anymore.
- Offset pagination.
memory_searchaccepts anoffsetalongsidenfor structural listings, so the full set can be walked page by page. Ranked text/vector results stay rank-truncated: the window applies to listings only. - Depth-2 impact chains.
impact of Xnow walks two hops over the call-edge graph, surfacing the callers-of-callers that a direct query misses. - Cleaner hits. External code hits render repo-relative paths instead of absolute
machine paths, and every
scope=allhit carries a corpus provenance tag (which index the fact came from), so a memory answer and a code-graph answer can be told apart (#89).
Embedding Hardening (v0.3.81)
Embedding API calls now carry timeouts, a vector gate (malformed or empty vectors never reach the store), and non-blocking writes (embedding failures never stall the turn) (#1062). /doctor reports embedding health, and a sweep finds unembedded documents and backfills them (#1069, #1067).
Embedding Modes
OpenCrabs supports three embedding configurations:
- Local GGUF (default): downloads a 300MB embedding model and runs it locally via llama.cpp
- OpenAI-compatible API: configure external embedding providers (OpenAI
text-embedding-3-small, Ollamanomic-embed-text, Jina, LM Studio, or any/v1/embeddingsendpoint) via[memory.embedding]config withurl,model,api_key,dimensions - FTS5-only: pure keyword search with zero RAM overhead. Set
[memory] vector_enabled = false. Auto-detects VPS environments and configures automatically
Context Compaction
When context reaches ~80% capacity, OpenCrabs automatically compacts:
- Summarizes the conversation so far into a comprehensive continuation document
- Clears old messages from context
- Continues with the summary as context
Manual compaction: type /compact in chat.
Auto-Save Triggers
The agent saves to memory when:
- New integrations are connected
- Server/infrastructure changes occur
- Bugs are found and fixed
- New tools are configured
- Credentials are rotated
- Architecture decisions are made
- You say “remember this”
- Errors take >5 minutes to debug
Proactive Memory Surfacing (v0.3.76)
The agent now surfaces relevant memory without being asked. When a conversation topic matches something stored in MEMORY.md or daily notes, the relevant context is loaded and injected automatically. Previously, memory was only recalled when the agent explicitly called memory_search or load_brain_file. Now the system proactively checks for relevant context on each turn, so the agent brings up past decisions, server details, or preferences that apply to the current conversation without you having to say “check your memory.”
Confidence, Decay and Pruning (v0.5.3)
MEMORY.md facts carry confidence and decay over time (#1643): a belief’s trust
drops as it goes unused and unverified, so stale claims stop outranking fresh ones when
memory is recalled. Decay is config-driven through the [epistemic] section.
Cold content is managed in two passes (#1657):
- Archive pass: cold MEMORY.md sections move to
memory/archive/with a backup and reindex, instead of silently accumulating forever. opencrabs memory prune: a dry-run preview (the default) of cold beliefs (key, confidence, hits, age) and cold sections (heading, bytes).--applyarchives the sections first, then sweeps the remaining cold beliefs.--max-age-days <N>overrides the cold threshold (default: 90).
Brain Files
See Brain Files for the full list of files the agent reads on startup.
Brain Files
Brain files define the agent’s personality, knowledge, and behavior. They live at ~/.opencrabs/ and are loaded on every session start.
Startup Read Order
SOUL.md: Personality and valuesUSER.md: Your profile and preferencesmemory/YYYY-MM-DD.md: Today’s notesMEMORY.md: Long-term memoryAGENTS.md: Agent behavior guidelinesTOOLS.md: Tool reference and custom notesCODE.md: Coding standards and file organizationSECURITY.md: Security policiesHEARTBEAT.md: Periodic check tasks
File Reference
SOUL.md
Agent personality. Core truths: strong opinions, brevity, resourcefulness, honesty. Hard rules: never delete files without approval, never send emails without request, never commit code directly.
USER.md
Your profile: name, location, timezone, role, specialties, communication preferences, pet peeves.
AGENTS.md
Comprehensive agent behavior docs: memory system, safety rules, git rules, workspace vs repository separation, cron best practices, platform formatting, heartbeat guidelines.
TOOLS.md
Tool parameter reference, system CLI tools, provider configuration, integration details for all channels and services.
CODE.md
Coding standards brain template. Enforces: no file over 500 lines (target 100–250), types in types.rs, one responsibility per file, mandatory tests for every feature, security-first patterns. Rust-first philosophy, single binary, no runtime dependencies. The agent follows these rules when writing or reviewing code.
SECURITY.md
Security policies: third-party code review, attack playbook awareness, network security, data handling, incident response.
HEARTBEAT.md
Tasks for periodic proactive checks. Keep empty to skip heartbeat API calls. Add tasks for the agent to rotate through (email checks, calendar, weather, etc.).
BOOT.md
Startup procedures: check git log, verify build, greet human with context awareness.
Query-Based Loading (v0.3.76)
load_brain_file now accepts an optional query parameter that returns only the sections matching the query instead of the entire file. This saves significant context budget:
load_brain_file(name="TOOLS.md", query="telegram")
→ Returns only the Telegram-related sections, not the full 2000-line file
Whole sections are returned (never cut mid-section), so a rule is never truncated. This is especially useful for large brain files like TOOLS.md and AGENTS.md where loading the full file wastes 10K+ tokens on irrelevant content.
Customization
These files are yours. The agent reads them but you control the content. Templates are at src/docs/reference/templates/ in the source repo, compare your local files against templates when updating to pick up new sections without losing custom content.
New installs (v0.2.72+): CODE.md and SECURITY.md are automatically seeded on first run. Existing users can ask their crab: “Check my brain templates and update them if any are missing or outdated.”
Upgrading: Brain files are never overwritten by
/evolveor/rebuild. After updating, ask your crab to compare templates against local files and patch in new sections.
User-owned files are never synced (v0.3.82)
SOUL.md, USER.md and MEMORY.md are excluded from upstream template sync (#1119). They hold your agent’s personality, your identity, and what it has learned about you, so upstream has no authority over them. Before this, every startup appended upstream sections into them, which grew one user’s SOUL.md from under 2 KB to nearly 5 KB, re-appending after each manual prune.
Seeding is unaffected: all three are still created on first run. Only the merge is forbidden. The remaining brain files (AGENTS, TOOLS, CODE, SECURITY, BOOT, HEARTBEAT) continue to sync normally.
Related (#1121): rules belong in AGENTS.md, not MEMORY.md. MEMORY.md is on-demand, reached only through memory_search, so a rule written there does not bind on a cold session and does not survive compaction. Facts go in MEMORY.md; anything that must always hold goes in AGENTS.md, which is always loaded.
The Desktop App
OpenCrabs ships two apps over the same agent. opencrabs is the terminal app you already know. opencrabs-gui is a native window with the same brain, the same sessions and the same config, rendered as cards instead of panes. Neither is a cut-down version of the other: the window runs the full agent, serves your channels and runs cron.
Both live in every release archive (v0.6.0). On macOS the window has its own bundle, OpenCrabs Desktop.app, so a double click opens the window instead of the terminal. On Linux the archive carries opencrabs-gui.desktop and an icon, so the window gets a menu entry with a real icon. On Windows the zip carries opencrabs-gui.exe beside the CLI.
One profile, one owner
Launching either app claims the profile. If a background daemon is already serving that profile, the app you just opened takes it over: the daemon is asked to stop and the interactive app inherits the channels, the cron scheduler and the background work. That is the same rule the terminal app has always followed, and it means you never end up with two agents answering the same Telegram message.
Starting a second daemon is refused outright, and the error names the PID holding the profile.
What the window gives you
| Surface | What it is for |
|---|---|
| Conversation | The transcript, with a turn folding and unfolding per ctrl+o, attachments rendering in place and code blocks keeping their own scroll |
| Rail | Sessions, pinned first, with a find field and a filter for automation sessions |
| Topics | A tab row per conversation, placed top, left, bottom or right |
| Split panes | Two or more conversations side by side, each with its own composer and transcript |
| Projects | Project and session cards, with batch assignment over a selection |
| Seeker | One field that finds a conversation, a command, a screen, a skill or a docs page |
| Settings | The agent’s own config and credentials, written to config.toml and keys.toml |
| Themes | Four palettes, a font row and whole-window transparency |
| Hint row | A suggestion card that rides on the composer, naming the command or follow-up that fits what you just typed |
Voice messages in the composer
From v0.6.1 the composer carries a microphone. Press it and the composer becomes the recording block; send, and your voice note lands in the conversation with a seekable waveform, so a long note can be scrubbed instead of replayed from the top. A voice note folds its transcript behind a toggle, so you can read what was said without playing it back, and a note lands with the project it belongs to.
When a voice note reaches the agent, the answer comes back aloud, spoken, for that turn. A typed message in the same conversation still gets a written answer: audio answers only the turn that spoke.
The bang operator
Typing ! opens the editor dialog from the composer. It previews rich text and edits raw, with mouse and scroll, so a long draft can be shaped without fighting the single-line input.
The chords
The window keeps the terminal’s chords where they make sense and moves the rest onto the platform key. ctrl+h opens the help panel, which lists every chord the window answers, grouped the way the terminal groups them.
| Chord | What it does |
|---|---|
alt+space (or cmd+k) | Open Seeker |
ctrl+, | Open the settings card |
ctrl+shift+t | Choose a theme |
alt+p | Open projects |
ctrl+n | New session |
ctrl+s | List sessions |
ctrl+f | Find in the rail |
ctrl+g | Files for the selected session |
ctrl+shift+p | Pin the selected session |
ctrl+d | Delete the selected session (asks first) |
ctrl+shift+| / ctrl+shift+_ | Split the window |
alt+tab / alt+shift+tab | Rotate the caret between panes |
ctrl+o | Fold or unfold the newest turn |
ctrl+k | Clear the session |
ctrl+plus / ctrl+minus / ctrl+zero | Zoom the window |
ctrl+h | Help |
ctrl+shift+u | Usage: tokens, cost and context |
cmd/ctrl+1..9 | Jump to the nth topic; topics win over sessions, digit 0 opens the tenth |
Bare letters belong to the rail’s find field once it is focused, which is why rename, topics and close-topic stay terminal-only: a typed name cannot double as a command. The row menu carries those actions in the window.
The window follows config.toml live
From v0.6.1 the window hot-reloads config.toml instead of needing a restart. One reload pass serves both front ends, so a value saved in the settings card is read by the terminal on its next boot and a value edited by hand is picked up by the window in place.
Settings without a text editor
ctrl+, opens one card over the conversation, and every row writes through the same validated config path the terminal uses, so a value saved in the window is a value the terminal reads on its next boot.
The card covers the agent’s approval policy, completion and failure notifications, redaction for groups and direct messages, lazy tool loading, the thinking-loop timeout, time markers, debug logging, the memory knobs, and a credentials section that writes an API key into keys.toml while keeping it masked on screen.
Projects
alt+p opens the projects screen. Projects and sessions are cards, and the selection is what an action applies to: assigning, moving or clearing runs as one guarded operation over everything picked, so a batch cannot half-apply. The screen is backed by the same project service the terminal uses, which means a project you create in the window is the project opencrabs -p lists.
Related
- Themes for the four window palettes, the font row and transparency
- Seeker for what the card searches
- Message actions for editing, reacting, replying and forwarding a row
- Split Panes for the pane layout both apps share
Sessions
Sessions as Isolated Agents
A session in OpenCrabs is not a tab, not a window, not a chat thread. Each session is a fully independent agent with its own brain: conversation history, provider, model, working directory, tool state, approval policy, and context window. When you create a new session, you are spinning up a separate agent that knows nothing about any other session and shares nothing with them.
This is the core mental model: one session = one agent = one context. You can run dozens of sessions in parallel and they will never interfere with each other.
Zero Context Contamination
Sessions are completely isolated at every layer:
- Separate message queues: each session has its own queue. Messages are routed strictly to their originating session. No cross-session bleeding, even when 10 sessions are processing simultaneously.
- Separate provider and model: switching to Gemini in session A does not affect session B running Claude. Each session remembers its own provider independently.
- Separate working directory:
/cdin one session does not change the working directory of any other session. - Separate conversation history: full SQLite-backed history per session. No shared memory, no prompt pollution, no context bleed.
- Separate token tracking: cumulative usage, cost, and context window are tracked per session.
This isolation is guaranteed by Rust’s thread safety and async runtime. Each session runs as an independent tokio task with its own state, and the type system prevents accidental sharing at compile time. You can run split panes, channel sessions, background agents, and sub-agents all at once with zero risk of one session’s output leaking into another.
Switching Sessions Keeps the Transcript
Switching sessions with /sessions and coming back does not fold your transcript away. The fold state for every turn is keyed by a stable role and timestamp anchor, so a turn you had opened stays open across a reload, and a turn you had folded stays folded (#2155). A turn that is still running also stays unfolded while it runs, so the work in flight stays visible instead of hiding behind a collapsed header.
The display window keeps a bounded number of recent messages in the pane rather than trimming by token budget, so one huge tool result can no longer evict the rest of the conversation. The hidden-count marker still tells you how many older rows are out of view, and Ctrl+O pages back through them.
Workflow Patterns: One Session Per Context
The power of isolated sessions becomes clear when you treat each one as a dedicated agent for a specific domain:
Pattern 1: DevOps for a Server
Create a session for a specific server or infrastructure concern. Send a first message like "Devops for server XYZ, monitor nginx builds, manage cronjobs, handle deployments, run log cleanups". The session locks into that context: working directory set to the server’s codebase, provider set to a fast model for quick ops tasks, history filled with that server’s deployment patterns. Come back to it days later and the agent remembers every previous deploy, every cron change, every nginx config tweak.
Pattern 2: Mobile App Development with a Co-Founder
Create a session named mybrand-mobile and connect it to a Telegram group with your co-founder. The agent is locked into the Dart/Flutter codebase, the product design context, and the mobile-specific toolchain. Your co-founder can ask questions, request design changes, or review PRs directly in Telegram while you work on backend tasks in a separate session. The two contexts never mix.
Pattern 3: Production Logs with a Team on Slack
Create a session named mybrand-prod-logs-debug and connect it to a Slack channel. Your team can ask questions about production, staging, or dev logs without you having to context-switch. The agent stays locked into log analysis mode with the right SSH aliases, the right log paths, and the right debugging tools. Meanwhile, your main TUI session is free for development work.
The key insight: you never have to explain the full context again. Once a session is locked into a domain, every follow-up message inherits that context automatically.
Session Context Integrity (v0.3.78)
Two fixes harden session_context (the tool agents use to store key-value state):
- Atomic writes: context writes now use atomic file operations, eliminating trailing-character corruption that could occur when a write was interrupted mid-flush. Previously, a crashed write could leave a JSON file with a truncated trailing character, making the entire context unreadable.
- Concurrency pinning: concurrent
session_contextcalls from parallel tool executions no longer race on the same file. A concurrency pin serializes writes, and temp files are cleaned up after each operation.
Creating Sessions
- TUI: Press
Ctrl+Nor type/new - Channels: Type
/newin any channel
The First Message Matters
When you create a new session, the first message you send becomes the seed for the entire session’s context. OpenCrabs uses it to:
- Auto-generate a session title: a background LLM call extracts a 3-8 word descriptive title from your first message. This runs asynchronously and never enters the conversation context.
- Anchor the agent’s context: the initial message establishes what this session is about, what codebase it should focus on, what tools it should prioritize.
Good first messages are specific and contextual:
"Devops for server XYZ: nginx, cronjobs, deployments, log cleanups""Flutter mobile app for mybrand: Dart codebase at ~/srv/mobile/mybrand""Debug production logs for mybrand staging and dev environments"
The auto-title will generate something like Devops Server XYZ, Mybrand Mobile Flutter, or Mybrand Prod Logs Debug. You can always rename it later.
Switching Sessions
- TUI: Press
Ctrl+Lto open the sessions screen, navigate with arrow keys, pressEnterto select - Channels: Type
/sessionsto see recent sessions with inline buttons
Renaming Sessions
Auto-generated titles are a starting point, not a final name. You can rename any session:
- TUI: Press
Ctrl+L, navigate to the session, pressrto rename - Agent-initiated: the
rename_sessiontool lets the agent rename the current session with a descriptive title when the conversation evolves beyond its original scope
Empty or whitespace-only titles are rejected (v0.3.30, #128).
Session Screen
The sessions screen shows:
- Session name
- Created date
- Provider/model badge
- Working directory
- Token usage
- Context window usage (current session)
- Status indicators (processing spinner, pending approval, unread)
- Live activity line on a busy session: the running tool’s description, thinking, or responding, as it happens (#2718, #2722)
Sub-Agent Sessions Stay Out of Your Way (v0.3.79)
Every spawned sub-agent creates a session titled subagent: {label}, and a busy turn can create several. They are an implementation detail of one tool call, so since v0.3.79:
- Sub-agent sessions are hidden from session lists the moment they exist, your session screen only ever shows your sessions.
- They are automatically purged once past
agent.subagent_session_ttl_days(default 7; set0to keep them forever). - Your own sessions are never touched: the cleanup sweep matches the
subagent:title prefix only.
Per-Session State
Each session remembers:
- Provider and model: Switch to Claude in one, Gemini in another
- Working directory:
/cdpersists per session - Conversation history: Full message history in SQLite
- Token count and cost: Cumulative usage tracking
v0.3.74 hardened per-session isolation:
- Per-session working directory: the working directory is isolated per session so it can’t leak across concurrent sessions (#703).
- Restore session provider: a session’s saved provider is restored before its turn, so it never accidentally runs on the global default (#704).
- Don’t persist involuntary remap: an involuntary provider/model remap is not persisted over a session’s saved pair (#705).
Session Management
| Action | TUI | Channels |
|---|---|---|
| New | Ctrl+N / /new | /new |
| Switch | Ctrl+L + Enter | /sessions |
| Rename | R on sessions screen | - |
| Delete | D on sessions screen | - |
| Filter by plan state | s on sessions screen | - |
| Show/hide cron + RSI sessions | a on sessions screen | - |
| Search titles + message content | / on sessions screen | - |
Filtering the Session List
The rail keeps your sessions and hides the machinery by default (#2719, #2723):
- Plan-state filter:
sin the terminal cycles a chip through all, in progress, finished, and no plan. The window carries the same filter in its rail menu. - Automation visibility: cron and RSI sessions are hidden by default.
ain the terminal, or the window’s filter menu, shows or hides them. An explicit keyword search still spans every session, hidden automation included.
Finding a Session: Keyword and Deep Search
The rail search reads stored message content, not just titles (#2720, #2724). Press / in the terminal’s sessions screen, or ctrl-f in the window, and type a keyword:
- A session whose title matches keeps its place at the top.
- A session the title missed still surfaces when a message inside it matches, with the snippet centered on your word standing in for the row preview. One row per session, even when both ways match.
- The read is debounced and only the newest query lands, so typing never stacks stale results.
Seeker (Alt+Space in the terminal, cmd-k in the window) runs the same deep search from its single field (#2721, #2725). A conversation whose title never mentions your word surfaces with the matching snippet in place of its date, next to the commands, screens, skills, and docs pages the card already finds. Your query and caret stay put while the rows refresh, and a repeated query rebuilds from cache without another read.
Background Processing
Sessions can process in the background while you work in another session. The sessions screen shows:
- Spinner for actively processing sessions
!for sessions waiting for tool approval- Dot for sessions with unread messages
- Live activity text on the busy session: the running tool’s description, thinking, or responding, so you can see what each background session is doing without opening it (#2718, #2722)
Background Tasks (v0.3.74)
Long-running shell commands no longer block your session. When the agent runs a known-long command (cargo test, cargo build, npx remotion render, gh run watch, and similar), OpenCrabs auto-promotes it to a background task (#722): the command runs detached, the session is freed immediately, and the agent can keep working (or you can switch away) while it finishes.
When the task completes, the result is injected back into the originating session and resumes it automatically. On the TUI the session picks up at the next tool-call boundary; on Telegram the resume is delivered to the same chat (#722). No polling loops, no re-running the command to “check”, the completion report arrives on its own.
The agent is told via its preamble that long tasks run in the background and resume the session when done, so it wraps up or moves on instead of sitting in a wait loop (#722).
Two related session fixes landed in the same release:
- No perpetual resume: a completed session no longer resumes on every restart. Resume turns are not re-tracked as pending requests, so a finished background task stays finished across restarts (#729).
- No lingering cancelled query: a query cancelled before the agent replied, plus its empty assistant placeholder, are dropped as a pair so they don’t linger in context and duplicate on resend (#730).
Background-Task Resume Everywhere (v0.3.75)
v0.3.74 introduced background-task resume on the TUI and Telegram. v0.3.75 extends it to every channel: Discord, Slack, WhatsApp, and the interactive CLI agent now resume your session the moment a long task finishes, powered by a shared bg_resume helper so the behaviour is identical across surfaces.
A few refinements make background tasks easier to live with:
- Indicator on the input border: the background-task indicator moved onto the input border, and a detached command shows what it’s currently doing.
- No scaffolding in chat: a background task’s system scaffolding no longer reaches the chat.
- Restart-killed tasks reported: background tasks a restart killed are reported instead of leaving the session waiting forever.
Split Panes
Run multiple sessions side by side with tmux-style pane splitting. Each pane is a fully isolated agent, see Split Panes for details.
State Management
v0.2.92 improved session state tracking:
- Session reload after cancellation: After Esc+Esc cancel, session context reloads from DB to pick up any changes made during the cancelled operation
- Cached state cleanup: Deleting a session now clears stale pane cache entries, preventing phantom state on restart
- CLI tool segment persistence: Tool results from CLI providers (Claude CLI, OpenCode CLI) are now saved to DB alongside regular messages, preserving correct text/tool interleaving across restarts
- Case-insensitive tool input: Tool input descriptions use case-insensitive key lookup, fixing failures when providers return different casing
Channel Sessions
All channels (Telegram, Discord, Slack, WhatsApp, Trello) persist sessions in SQLite by channel/group title. Sessions survive process restarts, no more lost context after daemon restart. Each channel group gets its own isolated session, while owner DMs share the TUI session. Cross-channel stable session suffixes ([chat:<id>]) ensure reliable session resolution across Discord, Slack, and WhatsApp (v0.3.29).
Session-Routed Recovery Reports (v0.3.81)
Crash-recovery reports route by session (#1037): a resumed turn reports back to the session that owned it, not to whichever session happened to boot the recovery. Multi-session setups no longer cross-deliver recovery noise.
Seeker
Seeker is one field over everything the app can do. Press alt+space in the terminal or in the window (cmd+k opens it too on a Mac), type what you want, and the card ranks the answer: a conversation, a command, a screen, a skill, a channel, a model, a docs page, or a new session built from the words you just typed.
It replaced the old command palette, and the difference is the point. A palette lists commands and hopes you remember the name. Seeker also looks at your own history and at the documentation, so “that thing about telegram polls” can land on the right page even when you do not know what the page is called.
What it finds
| Kind | What a row is |
|---|---|
| Conversation | A session from the rail, opened on Enter |
| Command | A compiled slash command, run on Enter |
| Surface | A screen or panel the app can show |
| Action | A direct interface action, such as opening or closing the sidebar |
| Help | A chord from the shared help table, so the card teaches the keys it answers |
| Model | A model from the provider catalogue |
| Skill | A skill from skills/, described in its own words |
| User command | A command from your own commands.toml |
| Channel | A messaging channel the agent can be reached on. Picking the row starts its setup |
| Docs | A page on docs.opencrabs.com, opened in your browser |
| New session | The row you get when nothing matched: it starts a fresh session with your typed text as the request |
How matching works
Whole words, not loose letter sequences. Each word you type has to land on a real word in the row, so a query cannot drag in an unrelated row by matching one letter out of every field. The fields are weighted, and the ranking follows the weight: a command’s own name outranks a title, a title outranks keywords, and keywords outrank a subtitle.
Two things bend that rule on purpose. A skill is matched against its description as prose, which is how “beat synced film” finds a skill whose title says nothing about it. A session is matched against its title with substring tolerance, because a session name is not always a dictionary word: proxy still finds OCProxy.
If a query matches nothing, the card does not just sit there. It offers to start a new session with what you typed, which is usually what you wanted anyway.
The recording orb is liquid glass
From v0.6.1, when Seeker carries a voice recording, its orb is rendered by a procedural glass shader: depth, rim and horizon layers, animated by the voice wave itself. Nothing is a texture. It is also a calculator: type a sum into Seeker and it evaluates it, with the answer printed above every row and copy available on both surfaces.
The docs index
The documentation rows are not a hand-picked sample. The index is the site’s own table of contents, generated from the published sitemap by scripts/gen-docs-index.py, and a test pins the coverage: a page that ships without a row fails the suite instead of quietly missing from the card.
The case studies are deliberately left out. With them indexed, the word telegram armed a story above the setup page that answers the question, and a search that lands you on an anecdote is worse than no result.
Related
- Desktop app for the window’s own chords
- Sessions for the rail the conversation rows come from
- Skills System for what the skill rows point at
Message Actions
Every row in the window carries its own actions. Hover a message and the affordance appears in its corner; right-click opens the menu. Nothing is global, so acting on one answer never depends on which row the caret happens to be in.
On a single row
| Action | Where it is | What it does |
|---|---|---|
| Edit | The pencil on your own message, on hover | Opens the row in the composer with its text, so you fix a typo instead of sending a correction |
| Copy as Markdown | The copy glyph on an answer, on hover | Puts the stored markdown source on the clipboard, headings and fences intact. The glyph becomes a check in the same box, so the confirmation costs the row no height |
| React | The row menu, then the crab pack | Puts one of the pack’s pictures on the row. Picking the same one again takes it back |
| Reply | The row menu on an answer | Quotes the picked rows into the composer, so your next message carries the context instead of pointing at it |
| Forward | The row menu on an answer | Opens the destination picker: the rows going out, a query field, and the sessions a forward can land in. The forward is staged for review, not sent on the click |
| Select | The row menu | Enters select mode and arms the bulk bar |
The menu is not identical on every row. Reply and Forward belong to answers, because quoting an answer back or sending it on is what a reader does with it. Your own rows keep the shorter menu: a press on a message you already sent should not offer to reply to it or send it somewhere else.
A turn that is still streaming carries the same actions on the exact live entry, so you can copy an answer or react to it while it is being written instead of waiting for the turn to land.
On a selection
Select mode replaces the composer with a bar that shows how many rows are picked, and it carries the bulk actions: Copy, Reply, Forward and Cancel.
Picks are keyed by row, not by position. A row that scrolls out of the viewport, or a refresh that re-renders only the visible window, does not lose what you already picked. A shift-click unions the rows between the anchor and the one you clicked, so a second run of rows can be added without dropping the first. Forward and Reply both read the picks in transcript order, which means the destination reads the same conversation you selected rather than the order you happened to click.
A count of zero forwards nothing and replies to nothing: the click is refused where it happens instead of opening an empty picker.
Related
- Desktop app for the window itself
- Sessions for where a forward can land
- Split Panes for why a react picked in a split leaf paints on that leaf’s transcript
Split Panes
OpenCrabs supports tmux-style pane splitting in the TUI. Run multiple sessions side by side, each with its own provider, model, and context, all processing in parallel.
Splitting
| Action | Shortcut |
|---|---|
| Split horizontal | | (pipe) |
| Split vertical | _ (underscore) |
| Cycle focus | Tab |
| Close pane | Ctrl+X |
How It Works
Each pane runs an independent session. You can have one pane writing code with Claude while another reviews tests with Gemini. The status bar shows [n/total] to indicate which pane is focused.
- Independent providers: Each pane can use a different AI provider and model
- Independent context: Conversation history is isolated per pane
- Parallel processing: All panes process concurrently via Tokio
- Persistent sessions: Each pane’s session is saved to SQLite like any other session
Example Layout
┌──────────────────────┬──────────────────────┐
│ Session 1 (Claude) │ Session 2 (Gemini) │
│ Writing code... │ Reviewing PR... │
├──────────────────────┴──────────────────────┤
│ Session 3 (OpenRouter) │
│ Running tests... │
└──────────────────────────────────────────────┘
Split vertically with _, then horizontally with | in the top pane.
Persistent Layout
Split pane configuration (splits, sizes, focused pane) saves to ~/.opencrabs/pane_layout.json on quit and Ctrl+C. On restart, your layout is restored exactly as you left it. Each restored pane preloads its session messages from the database, so content is visible immediately instead of blank.
Non-Focused Panes
Non-focused panes show compact tool call summaries and stripped reasoning text. Tool groups display as single collapsed lines matching the focused pane style. All panes auto-scroll to the bottom when new messages arrive.
v0.2.92 fixed several rendering issues:
- Tool calls no longer show a perpetual “running” spinner after completion
- Scroll position correctly tracks for inactive panes
- Stale cache is cleared when sessions are updated or deleted
State Management
Deleting a session now properly cleans up cached pane state. Previously, deleting a session left stale entries in the pane cache, which could cause phantom panes on restart.
Live Background Updates (v0.3.36)
Inactive panes now update live in the background. Previously, non-focused panes only refreshed when you switched focus to them. Now a background-session live-state cache routes IntermediateText and QueuedUserMessage events into per-session deltas, so you can watch tool calls and responses appearing in other panes in real time without switching focus.
Provider/model contamination prevention: When closing or switching panes, the old session’s provider is captured before the switch. This blocks cross-provider model leaks at 27 call sites throughout the codebase. The footer always shows the correct provider+model for the focused pane.
Ctrl+N binds the focused pane and live-refreshes the footer title, so new sessions show up immediately in the status bar.
Reasoning Expand (v0.3.74)
Reasoning blocks now cycle through three states instead of toggling open/closed. Click a reasoning block (or press Ctrl+O) to cycle: collapsed → capped → full. The capped middle state shows a bounded preview so a long chain-of-thought never floods the viewport (#727, #726).
Two refinements make expanding predictable:
- Anchor block on expand: the clicked block’s header is pinned to its screen row, so expanding or collapsing grows the block in place instead of jumping the viewport (#728).
- Click vs drag on mouse-up: click-vs-drag is decided on mouse-up, so a click-drag selects text (for copying) instead of toggling the expand state (#726).
Version in the UI (v0.3.74)
The running OpenCrabs version now shows on the TUI header and in channel /help and /usage output (#696), so you always know which build a session is on.
Double-Escape Returns the Query (v0.3.74)
Pressing Esc twice before any reply now returns the query to the input box and removes it from the conversation (#698), so a half-typed prompt you cancel doesn’t linger as an empty turn.
Per-Turn Headers (v0.3.75)
Every turn now gets a one-line header summarising the work that turn did, and the turn’s working-out folds up into it. OpenCrabs infers turn boundaries so each turn can be grouped, then folds the narration, intermediate text, and tool calls underneath the header.
The view stays clean by default:
- Fold every turn by default: turns fold as soon as they settle (and even while still running), so settled work collapses out of the way instead of scrolling off screen.
- Fold live: intermediate text folds while the turn is still running, and stale narration the model kept thinking past is collapsed.
- Readable folded turn: a folded turn stays readable and holds its place when toggled, and the tool-call summary stays at full visibility.
- Short live-thinking excerpt: live thinking shows a short excerpt with room to finish a thought, not a scrolling wall.
- Labelled token counter: the live token counter is labelled as a turn total and shows the ctx budget; ctx dropped from the spinner since it already shows under the input.
Expanding a turn is smooth: the header is kept after expand, and expanding no longer scrolls the view up by its own size.
TUI Improvements (v0.3.76–v0.3.78)
Steps AND Tools Display (v0.3.76)
The TUI now shows both steps and tool calls in the turn view. Previously it was either/or: if tool calls existed, steps were hidden. Now both render, with steps providing the narrative and tool calls showing the mechanical detail.
Background Task Position (v0.3.77)
Background task feedback moved from the left border to the right border of the input box. This prevents it from colliding with the context budget footer on the left.
Duplicate-Submit Guard (v0.3.76)
Pressing Enter twice quickly no longer submits the same message twice. The TUI drops a re-submitted message if the running turn is already answering it.
Command Labelling (v0.3.76)
Commands in the TUI are now labelled by what they run (e.g. “cargo test”) instead of the working directory. Makes the activity feed readable at a glance.
Deliverable Report Visibility (v0.3.78)
When a turn produces a deliverable report (audit, comparison, analysis), the report stays visible even when the turn folds. Previously, folding a turn would hide the report along with the working-out.
Background Running Indicator (v0.3.78)
The “running” indicator is now cleared before delivering the final response. Previously, the indicator could linger for a moment after the response appeared, creating a visual glitch.
Limits
There is no hard limit on pane count – you can run as many as your terminal fits. Each pane is a full session with its own token tracking and working directory.
Dynamic Tools
Define custom tools at runtime without recompiling. Tools are defined in ~/.opencrabs/tools.toml and can be created, removed, and reloaded on the fly.
Defining Tools
Create ~/.opencrabs/tools.toml:
[[tools]]
name = "deploy"
description = "Deploy the application to production"
executor = "shell"
command = "cd {{project_dir}} && ./deploy.sh {{environment}}"
[[tools]]
name = "check-status"
description = "Check service health"
executor = "http"
method = "GET"
url = "https://api.example.com/health"
Executors
| Executor | Description |
|---|---|
shell | Runs a shell command |
http | Makes an HTTP request |
Template Parameters
Use {{param}} syntax for dynamic values. The agent fills these in when calling the tool:
[[tools]]
name = "search-logs"
description = "Search application logs for a pattern"
executor = "shell"
command = "grep -r '{{pattern}}' /var/log/myapp/ --include='*.log' -l"
Runtime Management
The tool_manage meta-tool lets the agent manage dynamic tools during a session:
- Create: Add a new tool definition
- Remove: Delete an existing dynamic tool
- Reload: Re-read
tools.tomlwithout restarting
Dynamic tools appear alongside built-in tools in the agent’s tool list. Enable or disable individual tools without restarting the process.
Per-Parameter Value Coercion (v0.3.24)
Dynamic tools defined in tools.toml can now handle empty-string or null parameters gracefully. When a parameter arrives as "" or null, the engine substitutes a configured value before rendering the command template.
| Field | Purpose |
|---|---|
coerce_empty_to | Substitute when parameter is "" |
coerce_null_to | Substitute when parameter is null |
[[tools]]
name = "deploy"
description = "Deploy to environment with optional verbose flag"
executor = "shell"
command = "cd {{project_dir}} && ./deploy.sh --env {{environment}} {{verbose}}"
[[tools.deploy.params]]
name = "verbose"
type = "string"
required = false
coerce_empty_to = "--quiet"
A shell tool with an optional --verbose flag no longer breaks when the parameter is omitted. The engine substitutes --quiet (or any configured default) instead of passing an empty string.
(#95)
External contributions now enable tools.toml to be loaded in run mode and agent mode (not just the TUI). Previously, dynamic tools only worked in the interactive TUI session. Now they’re available across all modes, allowing headless automation and scripted workflows to use custom tools.
(#79: thanks @leshchenko)
Shell Parameter Escaping (v0.3.35)
Dynamic shell tool parameters now properly escape single quotes, preventing command injection edge cases when user-supplied values contain quotes. Contributed by @leshchenko1979.
Browser Automation
OpenCrabs includes native headless Chrome control via the Chrome DevTools Protocol (CDP). No Selenium, no Playwright, direct browser control built into the binary.
Requirements
- A Chromium-based browser installed (Chrome, Brave, Edge, or Chromium)
- Feature flag:
browser(enabled by default)
OpenCrabs auto-detects your default Chromium browser, no manual path configuration needed.
Browser Tools
| Tool | Description |
|---|---|
navigate | Open a URL in the browser |
click | Click an element by CSS selector |
type | Type text into an input field |
screenshot | Capture a screenshot of the page |
eval_js | Execute JavaScript in the page context |
extract_content | Extract text content from elements |
wait_for_element | Wait for an element to appear |
find | Find elements matching a pattern (CSS, XPath, text, or aria-label). Returns stable selectors for subsequent click/type operations |
browser_act | Batched multi-action in one call: an ordered array of click / fill / press / select / wait / upload (max 10 actions, 120s budget). Selectors resolve up front, so a stale reference rejects the whole batch instead of half-running it; aborts on first failure and reports the completed prefix; one screenshot at the end. upload attaches local files to a file input without putting their bytes in the context (#2112) |
How It Works
The browser is lazy-initialized as a singleton, it only launches when the agent first needs it. It runs in stealth mode with a persistent profile directory, so cookies and sessions survive across tool calls.
On macOS, display auto-detection enables headed mode when a display is available, falling back to headless in CI or daemon environments.
Example
Ask the agent:
“Go to our staging site, log in with the test account, navigate to the dashboard, and take a screenshot”
The agent will chain navigate → type (username) → type (password) → click (login button) → navigate (dashboard) → screenshot: all autonomously.
Inventory Mode (v0.3.80)
browser_find now works without a pattern (#1022). Call it bare and it enumerates every visible interactive element on the page (links, buttons, inputs, selects, textareas, role=button elements, onclick handlers, tabindex elements, labels, and disclosure widgets) each stamped with a selector and index you can click directly.
This is the structural fix for the screenshot-as-discovery loop: instead of screenshotting repeatedly and guessing selectors, the agent gets the page’s clickable inventory in one call. When browser_screenshot reports an identical page, the hint now nudges toward inventory mode.
Shadow-DOM Resolution (v0.5.2)
Selector resolution is shadow-DOM aware: an element inside one or more shadow roots is reached by piercing the roots along the path, so web components and widget libraries that host their UI in shadow trees are automatable like light-DOM content. Applies across the browser tools (click, type, find, screenshot targeting).
Configuration
No configuration needed. The browser feature is enabled by default. To disable it at build time:
cargo build --release --no-default-features --features "telegram,discord,slack"
Cron Jobs
Schedule tasks to run on a recurring schedule. Cron jobs can run in isolated sessions or wake the main session.
CLI Management
# Add a job
opencrabs cron add \
--name "Morning Report" \
--cron "0 9 * * *" \
--tz "Europe/London" \
--prompt "Check emails, calendar, and give me a morning briefing" \
--deliver-to telegram:123456
# List all jobs
opencrabs cron list
# Enable/disable (accepts name or ID)
opencrabs cron enable "Morning Report"
opencrabs cron disable "Morning Report"
# Remove (accepts name or ID)
opencrabs cron remove "Morning Report"
Agent Management
The agent can also manage cron jobs via the cron_manage tool:
"Create a cron job that checks my emails every morning at 9am"
Since v0.3.80, cron_manage supports an update action that patches an existing job in place (#966), change the schedule, prompt, model, or delivery target without deleting and recreating the job.
Options
| Flag | Description |
|---|---|
--name | Job name (unique identifier) |
--cron | Cron expression (e.g. 0 9 * * *) |
--tz | Timezone (e.g. America/New_York) |
--prompt | The prompt to send to the agent |
--provider | AI provider to use (optional) |
--model | Model to use (optional) |
--thinking | Thinking mode: on, off, budget_XXk |
--deliver-to | Channel delivery: telegram:CHAT_ID, discord:CHANNEL_ID, HTTP webhook URL, or comma-separated multiple targets |
--auto-approve | Auto-approve tool use for this job |
Multi-Target Delivery
deliver_to accepts comma-separated targets to send results to multiple destinations simultaneously:
opencrabs cron add \
--name "Morning Report" \
--cron "0 9 * * *" \
--prompt "Give me a morning briefing" \
--deliver-to "telegram:-12345,http://webhook.example.com/notify"
Supported targets in any combination:
telegram:CHAT_IDortelegram:-GROUP_IDdiscord:CHANNEL_IDslack:CHANNEL_IDwhatsapp:PHONE_OR_JIDhttp://...orhttps://...(webhook URL)
Target URLs (v0.5.1)
Since v0.5.1 every delivery field also speaks a unified oc:// target scheme, resolved by a
central resolver against the live channel bindings (issue #148):
| Form | Meaning |
|---|---|
oc://telegram/<chat>[/<thread>] | Telegram chat (optionally a forum topic) |
oc://discord/<channel> | Discord channel |
oc://slack/<channel> | Slack channel |
oc://whatsapp/<phone|jid> | WhatsApp contact |
oc://session/<uuid-or-prefix> | Park the result in that OpenCrabs session’s notify queue, the agent gets cron output the same way a sub-agent or a detached command reaches its parent (v0.5.1) |
here | This conversation’s channel (refused on headless surfaces, which have none) |
Target URLs are resolved once, at create/update time, and the concrete channel target is baked into the job; if an unbaked URL ever reaches fire time the run fails loudly instead of resolving against a possibly-changed world.
Forum-topic delivery (v0.5.1, opt-in)
telegram:CHAT_ID:THREAD_ID (or the oc://telegram/<chat>/<thread> form) delivers into a
specific topic of a forum group. It is deliberately opt-in: the chat must actually be a
forum and the topic must exist: an invalid thread target is rejected loudly at fire
time, never silently re-routed to the general topic. When a job is created from inside a
thread (here/oc:// form), the origin thread id is persisted so the result lands back in
the same topic (#104).
Results are stored in the DB via the cron_results table regardless of delivery target, so you can query past execution results with opencrabs cron results <name>.
Trigger-gated jobs (v0.5.3)
A job can carry a pre-flight trigger: at each fire time the scheduler runs a shell command first, and only executes the prompt when a condition on that command’s result is met. This turns scheduled jobs from “fires into the void every hour” into “acts when something actually happened” (a file appeared, a health check failed, a log line matched) (#233).
Set it through the cron_manage tool at create or update time:
| Field | What it does |
|---|---|
trigger_cmd | Shell command run under /bin/sh -c before the prompt. 30s timeout; a hung trigger is killed, not orphaned. Either prompt or trigger_cmd must be set. |
trigger_on | Fire condition (see below). Default non_empty. |
set_goal | On fire, set the active goal in the destination session instead of a plain prompt turn. Requires deliver_to to target a session; refused for passive channel deliveries. |
goal_template | Template for the goal/notification text. Interpolates {output}, {stdout}, {stderr}, {exit_code}. |
trigger_on conditions
| Value | Fires when |
|---|---|
non_empty (default) | stdout or stderr contains any non-whitespace output |
exit_zero | the trigger exits 0 |
exit_non_zero | the trigger exits non-zero (health checks, grep misses) |
regex:PATTERN or re:PATTERN | combined output matches the regular expression |
always | the trigger finished, regardless of output or exit code |
Semantics
- Condition not met → the run is short-circuited at 0 tokens and recorded as a skipped/success run. The prompt never executes, nothing is delivered.
- Trigger command errors or times out → the run is recorded as an error; the prompt still does not execute.
- Empty
promptwith a trigger → direct 0-token delivery: the formatted trigger output (goal_template, or the raw output) is delivered todeliver_towithout an agent turn at all. set_goal→ the fired trigger dispatches into the target session as an active goal, so the session’s agent works the condition it detected rather than just echoing output.
Put the watching in trigger_cmd (deterministic, cheap, script-runner pattern), the
condition in trigger_on, and the acting in the prompt or goal.
Scheduler Lock (v0.3.65)
The cron scheduler uses a file lock to prevent duplicate job execution. Only one scheduler instance can run per profile at a time. If you accidentally start OpenCrabs twice, the second instance won’t fire duplicate cron jobs.
Heartbeat vs Cron
Use heartbeat (HEARTBEAT.md) when:
- Checks are periodic but timing is flexible (~30 min)
- You want to reduce API calls by batching
- Tasks share the main session context
Use cron when:
- Exact timing matters (“9:00 AM every Monday”)
- Task needs isolation from main session
- You want a different model or thinking level
- Output should deliver to a specific channel
Plans
Plans provide structured multi-step task execution with a live progress widget in the TUI.
Creating a Plan
Ask the agent to plan a complex task:
"Plan the migration from PostgreSQL to SQLite"
The agent uses the plan tool internally to create a plan with:
- Title and description
- Technical stack
- Risk assessment
- Test strategy
- Ordered tasks with dependencies and complexity ratings
Plan Lifecycle
- Draft: Agent creates the plan and adds tasks
- Finalize: Agent calls
finalizewhich triggers the tool approval dialog - Approved: You approve in the tool dialog, plan status becomes
Approved, and the agent begins executing tasks immediately - In Progress: Tasks execute in dependency order
- Completed: All tasks done
In ask mode (default), the finalize step triggers the tool approval dialog, you review the full plan before execution begins. In auto-approve mode, finalize is auto-approved and the agent plans and executes without pausing.
Plan Requirement Gate
A turn that crosses a threshold of tool calls has to stop and write a plan before it continues (#2128). This is what keeps a sprawling refactor from being discovered after twenty files have already changed: you see the shape of the work, and you get a chance to say no before it lands.
The gate is configurable under [agent]. A turn that already has a live plan is never gated again, and a session configured to run autonomously is not stalled by an approval prompt it was told to skip.
Task States
Each task in a plan can be:
Pending(·): Waiting for dependenciesInProgress(▶): Currently executingCompleted(✓): DoneSkipped(✓): Manually skippedFailed(✗): Execution failedBlocked(·): Dependencies not met
TUI Plan Widget
When a plan is active, a live checklist panel appears above the input box showing:
- Plan title and progress counter (e.g.
3/7) - Progress bar: Visual
██████░░░░bar with percentage - Task list: Up to 6 tasks visible with status icons and task numbers
- Overflow indicator:
... (N more)when tasks exceed the visible limit
The widget updates in real-time as the agent completes each task.
Managing Plans
Plans are managed through natural language:
"Approve the plan"
"Reject the plan"
"What's the plan status?"
"Skip task 3"
The agent handles plan creation, approval, execution, and status reporting through the plan tool.
Mid-Plan Insertion (v0.3.36)
Tasks can be inserted at any position in an existing plan using insert_after:
plan(operation: "add_task", insert_after: 3, title: "Re-run tests after fix", ...)
This inserts the new task as task #4, and all existing tasks from #4 onward are renumbered automatically. Dependencies between tasks are preserved through the renumber.
This is useful when a later task introduces a bug caught by an earlier test. Instead of re-opening the completed test task, insert a fresh re-test task right after the fix.
Finished Checklist Persistence (v0.3.76)
When a plan completes all tasks, the finished checklist now stays on screen instead of disappearing. You can review the final state (all tasks marked ✓) without having to ask “what was the plan?” again. The completed card renders its final state with the full task list and progress bar at 100%.
Epistemic Orient Gate (v0.3.78)
Plan execution is now gated behind an epistemic Orient phase before any task starts. The agent must:
- Observe: gather ground truth (read files, check state)
- Orient: map observations against current beliefs and goals
- Decide: form intention, confirm alignment and safety
- Act: execute through mechanical gates
This prevents the agent from charging into a plan task with stale assumptions. The Orient gate checks whether the agent’s beliefs about the codebase/state still hold before writing anything.
Criteria-Aware Verification (v0.3.78)
The Ralph loop (OpenCrabs’ iterative task execution engine) now verifies task completion against declared acceptance criteria instead of just “did the command exit 0?”. Each task’s criteria are checked mechanically:
- If a task declares
acceptance_criteria, the verification gate checks each one - Criteria that require specific output (e.g. “clippy passes with zero warnings”) are verified against actual tool output
- Tasks without explicit criteria fall back to the standard exit-code check
This means a task marked “complete” actually met its stated goals, not just “something ran.”
Ralph Verification Gate + Iteration Cap (v0.3.78)
The Ralph loop gained a mechanical verification gate with an iteration cap:
- After each task execution, the gate checks whether the outcome matches the intention
- If verification fails, the task retries (up to the iteration cap)
- The cap prevents infinite loops on tasks that can never satisfy their criteria
- State lives in files, not context, each iteration reads fresh state from disk
Combined with the epistemic Orient gate, this makes plan execution significantly more reliable: the agent orients before acting, and verifies after acting, with bounded retries.
Plan State Across Sessions (v0.3.79)
Plans are no longer tied to the lifetime of a single session. Plan state threads across session boundaries, so a plan survives session swaps, restarts, and context compaction. Spawned child sessions resolve their parent’s plan file automatically, which is what makes the next feature possible.
Isolated Plan-Task Execution
Each plan task can now run in a freshly spawned isolated worker session: the worker gets only the task brief and the plan file, not the parent conversation’s context. The brief is self-contained and the worker reports its verdict back via disk, so nothing leaks between the parent session and the task, and a long-running task can’t burn the parent’s context window.
agent.plan_isolated_executionis the master switch, and it defaults ON since v0.3.79: Ralph loops run fresh-context by construction, so isolation is the only sane default for autonomous execution.- An explicit
isolated: true/falseon astartcall still wins over the default. - Ralph verification now runs in the session’s own working directory, not the directory OpenCrabs was launched from, a plan in one repo is verified against that repo’s build results, not another repo’s (#921).
- The plan gate’s
RequireApprovaldecision respectsauto_approve, so autonomous sessions are not stalled by an approval prompt they were configured to skip (#934).
Type-Aware Verification (v0.3.83)
Acceptance criteria are checked against the plan’s toolchain (#1133): a Rust task must satisfy cargo-shaped criteria, a Flutter task flutter-shaped ones, and a task whose criteria cannot be verified is marked instead of waved through. Plans also verify with the project’s own toolchain rather than always cargo, and locate the project from the folder the session is working in. Checklist plans no longer write a design scaffold .md (#1145).
Importing Pre-Defined Plans (v0.3.35)
Plans can be loaded from JSON files for repeatable workflows:
plan(operation: "import", file_path: "~/plans/rust-refactor.json")
Bundled reference plans ship with OpenCrabs at ~/.opencrabs/profiles/<profile>/plans/ covering common patterns like rust-fast, rust-medium, rust-full, python-fast, python-medium, python-full, and sample-minimal-plan.
The JSON format requires a minimum of 6 fields: title, description, plus 3 fields per task (title, description, task_type). Full schema supports dependencies, complexity ratings, acceptance criteria, and technical stack.
Security: Import validates symlinks against the target path only (rejecting ancestor false positives on macOS) and checks for orphan dependencies that reference non-existent tasks.
Multi-Agent Orchestration
OpenCrabs supports spawning specialized sub-agents that run autonomously in isolated sessions. Each child agent gets its own context, tool registry, and cancel token. Introduced in v0.2.97 with a typed agent system and team orchestration.
Agent Types
When spawning an agent, an agent_type parameter selects a specialized role with a curated tool set:
| Type | Role | Tools |
|---|---|---|
general | Full-capability agent (default) | All parent tools minus recursive/dangerous |
explore | Fast codebase navigation (read-only) | read_file, glob, grep, ls |
plan | Architecture planning (read + analysis) | read_file, glob, grep, ls, bash |
code | Implementation (full write access) | All parent tools minus recursive/dangerous |
research | Web search + documentation lookup | read_file, glob, grep, ls, web_search, http_request |
Each type receives a role-specific system prompt that shapes its behavior. Explore agents are fast and lightweight – they only read files. Code agents can modify anything. Research agents can search the web but not touch your filesystem.
Safety: ALWAYS_EXCLUDED Tools
No agent type has access to these tools, preventing dangerous or recursive operations:
spawn_agent– no spawning agents from agentsresume_agent,wait_agent,send_input,close_agent– no managing siblingsrebuild– no building from sourceevolve– no self-updating
Five Orchestration Tools
| Tool | Description |
|---|---|
spawn_agent | Create a typed child agent to handle a sub-task autonomously in the background |
wait_agent | Wait for a spawned agent to complete and return its output (configurable timeout) |
send_input | Send follow-up instructions to a running agent (multi-turn conversation) |
close_agent | Terminate a running agent and clean up its resources |
resume_agent | Resume a completed or failed agent with a new prompt (preserves prior context) |
Spawn an Agent
spawn_agent(
label: "refactor-auth", # Human-readable label
agent_type: "code", # general | explore | plan | code | research
prompt: "Refactor auth...", # Task instruction
include_brain: false # opt in to workspace brain pre-injection (v0.5.1)
)
The agent runs in its own session with auto-approved tools. No blocking – it executes in the background while the parent continues.
Lean children and include_brain (v0.5.1)
Sub-agents start lean: no pre-injected workspace brain (SOUL.md, USER.md, AGENTS.md,
project directives). Pass include_brain: true to spawn_agent (or per-agent in
team_create) to opt into pre-injection; the choice is frozen for the agent’s lifetime and
resume_agent re-attaches accordingly. When a child runs lean, its prompt discloses the
gap: the child is told the workspace brain is not loaded and pointed at load_brain_file
for on-demand access, so neither side operates on the assumption rules are ambiently known (#145).
Headless children (v0.5.1)
Child agents are headless by law: interactive-only tools (session_notify,
suggest_options) are stripped from the child’s tool surface and the registry refuses to
register them there: a call returns a hard tool error, not a silent no-op. The headless
tool roster excludes interactive-only tools wholesale, and headless prompts (spawn and
resume, cron/daemon, CLI one-shot) carry a preamble saying so, so the child never reaches for
a button it does not have (#129). The same backstop covers cron’s here target: it is
refused on headless surfaces.
Wait for Completion
wait_agent(
agent_id: "abc-123",
timeout_secs: 300 # Max wait time (default: 300s)
)
Multi-Turn with send_input
After spawning, you can send additional instructions without restarting:
send_input(
agent_id: "abc-123",
text: "Also add unit tests for the new module"
)
The child agent processes the input on its next iteration. This enables iterative workflows – review the agent’s output, then ask it to refine or continue.
Resume a Completed Agent
resume_agent(
agent_id: "abc-123",
prompt: "Now port the same changes to the other two files"
)
The agent continues in its original session, preserving all prior context. No need to re-explain the codebase.
Team Orchestration
The TeamManager coordinates named groups of agents for parallel execution. Three team-specific tools:
Create a Team
team_create(
team_name: "backend-refactor",
agents: [
{ label: "auth", agent_type: "code", prompt: "Refactor auth module" },
{ label: "tests", agent_type: "code", prompt: "Write tests for auth" },
{ label: "docs", agent_type: "general", prompt: "Update documentation" }
]
)
All agents spawn simultaneously and run in parallel. Returns the team name and all agent IDs.
Broadcast to a Team
team_broadcast(
team_name: "backend-refactor",
message: "Use the new AuthError enum instead of plain strings"
)
Sends a message to all running agents in the team. Non-running agents are skipped. Useful for sharing context or direction changes.
Delete a Team
team_delete(team_name: "backend-refactor")
Cancels all running agents and cleans up resources. Completed agents are left in the subagent manager for reference.
Subagent Provider/Model Config
By default, every spawned agent inherits the parent session’s provider and model. You can override this globally in config.toml so child agents route to a different (usually cheaper or faster) backend:
[agent]
subagent_provider = "openrouter" # Provider for child agents
subagent_model = "qwen/qwen3-235b" # Model override
# Omit both keys and child agents inherit the parent session's provider
# and run on that provider's default model.
The override applies to spawn_agent, resume_agent, and every member of a team_create team. Changes take effect on next session start; running sessions keep their existing provider.
Per-Call Overrides (v0.3.35)
spawn_agent, resume_agent, and team_create now accept optional provider and model fields that override config defaults for a single call. This enables mixed-model teams:
team_create(
team_name: "mixed-stack",
agents: [
{ label: "planner", provider: "zhipu", model: "glm-5", prompt: "Architect the feature" },
{ label: "coder", provider: "deepseek", model: "deepseek-coder", prompt: "Implement it" },
{ label: "reviewer", provider: "kimi", model: "kimi-k2.5", prompt: "Review the code" }
]
)
Precedence order (highest first): per-call provider/model > [agent] subagent_provider/subagent_model in config > parent session’s provider.
Why It Matters
The common pattern is premium parent, cheap children. Your main conversation stays on a reasoning-capable model (Opus, GPT-5, Gemini 2.5 Pro) while subtasks (file exploration, test writing, web research, bulk refactors) run on a faster, cheaper model. With a 4-agent team running 10 minutes each, the cost delta between Opus and Qwen on the children is roughly 50x.
Concrete Examples
OpenRouter parent, Qwen children, best bang-for-buck on mixed workloads:
[providers.openrouter]
enabled = true
api_key = "sk-or-..."
model = "anthropic/claude-opus-4"
[agent]
subagent_provider = "openrouter"
subagent_model = "qwen/qwen3-235b-a22b-instruct"
Kimi on custom OpenCode provider: fast code generation for code and explore agents:
[providers.opencode-kimi]
enabled = true
base_url = "https://api.kimi.com/v1"
api_key = "..."
model = "kimi-k2.5"
[agent]
subagent_provider = "opencode-kimi"
subagent_model = "kimi-k2.6"
Local Ollama children: zero cost, fully offline, good for explore agents that just read files:
[providers.ollama]
enabled = true
model = "qwen3:14b"
[agent]
subagent_provider = "ollama"
subagent_model = "qwen3:14b"
Gemini parent, Gemini Flash children, single billing account, reasoning on main, flash on team:
[providers.gemini]
enabled = true
model = "gemini-2.5-pro"
[agent]
subagent_provider = "gemini"
subagent_model = "gemini-2.5-flash"
Gotchas
- The subagent provider must be enabled and have a valid API key (or be a CLI/none-auth provider). Missing keys cause the spawn to fail with a provider resolution error.
subagent_modelmust be a model the provider actually serves.qwen/qwen3-235bworks on OpenRouter, not on Anthropic. Check/modelson the target provider to confirm.team_createmembers all share the same subagent config. If you need heterogeneous routing (e.g. a research agent on web-search model, a code agent on code-specialized model), spawn them individually withspawn_agentunder different config profiles.- The CLI model override is surfaced in the
spawn_agent,resume_agent, andteam_createtool descriptions themselves, so the LLM knows to mention these keys to you instead of inventing per-call overrides.
If subagent_provider or subagent_model is not set, the spawned agent loads from the parent session’s provider and runs on that provider’s default model.
Workflow Patterns
Parallel Research + Implementation
team_create("feature-research", [
{ label: "research", agent_type: "research", prompt: "Find best practices for rate limiting in Rust" },
{ label: "explore", agent_type: "explore", prompt: "Find all middleware files in the codebase" }
])
Wait for results, then spawn a code agent with the combined context.
Iterative Code Review
# 1. Spawn a code agent
spawn_agent(label: "impl", agent_type: "code", prompt: "Implement rate limiting middleware")
# 2. Wait for completion
wait_agent(agent_id: "impl-id")
# 3. Resume with refinements
resume_agent(agent_id: "impl-id", prompt: "Add tests for the edge cases we discussed")
Large-Scale Refactoring
team_create("refactor-team", [
{ label: "module-a", agent_type: "code", prompt: "Refactor module A to use the new trait" },
{ label: "module-b", agent_type: "code", prompt: "Refactor module B to use the new trait" },
{ label: "module-c", agent_type: "code", prompt: "Refactor module C to use the new trait" },
{ label: "tests", agent_type: "code", prompt: "Update all tests for the new trait signature" }
])
Testing
84 tests cover the entire multi-agent system:
- Manager state machine (spawn, wait, close lifecycle)
SendInputwiring and input loopCloseAgentcleanupWaitAgenttimeout behaviorAgentTypetool filteringTeamManager,TeamDelete,TeamBroadcast- Registry exclusion (ALWAYS_EXCLUDED enforcement)
Sub-Agent Result Reporting (v0.3.81)
A finished agent reports its result back to the spawning session (#1036): the parent sees the outcome in-turn instead of polling or reading status files. Orphaned sub-agent status files from crashed runs are reconciled at startup (#1038), so the registry never shows ghosts of agents that no longer exist.
Sub-Agent Worktree Isolation (v0.3.83)
Each spawned agent gets its own worktree and branch instead of sharing the parent’s working tree: a fan-out of several agents on one repository can no longer clobber each other’s checkouts or builds. The parent’s tree stays untouched while children work in isolation, and results come back through the normal git flow.
Agent-to-Agent (A2A) Protocol
OpenCrabs includes a built-in A2A gateway implementing the A2A Protocol RC v1.0 for peer-to-peer agent communication.
Enabling
Legacy
[gateway]name (v0.3.82): this section was once spelled[gateway]. Both spellings now fold into one setting, and the legacy name is rewritten to[a2a]on disk so it survives a reload round trip instead of reappearing (#1116). Nothing to do by hand; an existing[gateway]block migrates itself on the next load.
# config.toml
[a2a]
enabled = true
bind = "127.0.0.1" # Loopback only (default): use "0.0.0.0" to expose externally
port = 18790
# api_key = "your-secret" # Optional Bearer token auth for incoming requests
# allowed_origins = ["http://localhost:3000"] # CORS
Configuration Options
| Option | Default | Description |
|---|---|---|
enabled | false | Enable the A2A gateway |
bind | 127.0.0.1 | Bind address: use 0.0.0.0 to accept external connections |
port | 18790 | Gateway port |
api_key | (none) | Bearer token for authenticating incoming requests. If set, all JSON-RPC requests must include Authorization: Bearer <key> |
allowed_origins | [] | CORS allowed origins: no cross-origin requests unless explicitly set |
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/.well-known/agent.json | GET | Agent Card: discover capabilities (auto-populated from tool registry) |
/a2a/v1 | POST | JSON-RPC 2.0: message/send, message/stream, tasks/get, tasks/cancel |
/a2a/health | GET | Health check |
Methods
message/send: Send a message to the agent, creates a task. Returns the task with result.message/stream: Same asmessage/sendbut returns an SSE stream with real-time status updates and artifact chunks as the agent works.tasks/get: Poll a task by ID to check status and retrieve results.tasks/cancel: Cancel a running task.tasks/list: List tasks, active or settled, so a peer can see what it is carrying (v0.6.1).session/list: List the agent’s sessions (v0.6.1).session/transcript: Read a session’s transcript (v0.6.1).
Active tasks are persisted to the database and restored on restart.
A resend that carries the same messageId answers with the first task instead of minting a second one, so a retried delivery cannot double-run the work.
The a2a_send Tool
The agent has a built-in a2a_send tool that lets it proactively communicate with remote A2A agents. This enables true bidirectional agent-to-agent communication.
Actions:
| Action | Description |
|---|---|
discover | Fetch a remote agent’s Agent Card to see its capabilities and skills |
send | Send a task to a remote agent and wait for the result |
get | Poll a task by ID on a remote agent |
cancel | Cancel a running task on a remote agent |
The agent can use this tool autonomously: for example, delegating subtasks to a specialized remote agent.
Connecting Two Agents
Example: VPS + Local Machine
On VPS (~/.opencrabs/config.toml):
[a2a]
enabled = true
bind = "0.0.0.0"
port = 18790
api_key = "your-shared-secret"
On local machine (~/.opencrabs/config.toml):
[a2a]
enabled = true
bind = "127.0.0.1"
port = 18790
Connectivity Options
-
SSH tunnel (recommended): No ports to open, encrypted:
# From local machine, tunnel VPS A2A to localhost:18791 ssh -L 18791:127.0.0.1:18790 user@your-vpsLocal agent talks to
http://127.0.0.1:18791/a2a/v1 -
Direct: Open port 18790 on VPS firewall. Simple but exposes the port. Always use
api_keywith this approach. -
Reverse proxy: Nginx/Caddy on VPS with TLS + Bearer auth via
api_key.
Pairing sessions
From v0.6.1 a peer can hand over a pairing code, and opencrabs connect turns it into a session that lives for a bounded time instead of forever. The default is 30 days; --ttl 1h mints a guest-style session for an hour. The same flag exists so a demo, a hand-off or a shared debugging window never leaves a permanent credential behind.
Examples
# Discover the agent
curl http://127.0.0.1:18790/.well-known/agent.json | jq .
# Send a message (with Bearer auth)
curl -X POST http://127.0.0.1:18790/a2a/v1 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-shared-secret" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "message/send",
"params": {
"message": {
"role": "user",
"parts": [{"text": "What tools do you have?"}]
}
}
}'
# Stream a task (SSE)
curl -N -X POST http://127.0.0.1:18790/a2a/v1 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-shared-secret" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "message/stream",
"params": {
"message": {
"role": "user",
"parts": [{"text": "Analyze the system status"}]
}
}
}'
# Poll a task
curl -X POST http://127.0.0.1:18790/a2a/v1 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-shared-secret" \
-d '{"jsonrpc":"2.0","id":3,"method":"tasks/get","params":{"id":"TASK_ID"}}'
# Cancel a task
curl -X POST http://127.0.0.1:18790/a2a/v1 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-shared-secret" \
-d '{"jsonrpc":"2.0","id":4,"method":"tasks/cancel","params":{"id":"TASK_ID"}}'
# Health check
curl http://127.0.0.1:18790/a2a/health | jq .
Session Resume and Profile Addressing (v0.3.83)
A2A sessions resume by context id (#1159): a reconnecting client restores the session bound to its context instead of starting cold. The gateway is profile-addressed (#1161), so a multi-profile host serves the right profile’s sessions, and the profile_list tool is registered for remote peers (#1160, #1161).
Bee Colony Debate
Multi-agent structured debate via confidence-weighted voting (based on ReConcile, ACL 2024). Multiple “bee” agents argue across configurable rounds, enriched with knowledge context, then converge on a consensus answer.
Security
- Loopback only by default: binds to
127.0.0.1 - Bearer auth: set
api_keyto requireAuthorization: Bearer <key>on all JSON-RPC requests - CORS locked down: no cross-origin requests unless
allowed_originsis set - For public exposure, use a reverse proxy with TLS + the
api_keyBearer auth
ACP: Editor Integration
ACP server mode lets agent-aware editors (Zed, MonoCode, any ACP client) drive OpenCrabs as a backend agent over the Agent Client Protocol. The editor spawns opencrabs acp as a child process and speaks JSON-RPC 2.0 over stdio, so your editor session and your channels share the same brain, tools, memory, and provider configuration (#1540).
Running
opencrabs acp # default model from config
opencrabs acp --model anthropic/claude-sonnet-4-20250514
Point your editor’s ACP/agent client at the opencrabs acp command and it appears as an available agent. One child process serves one conversation thread.
Protocol
- Framing: JSON-RPC 2.0, newline-delimited (NDJSON) over stdio
session/prompt: runs the full tool loop for a turn; the reply arrives when the turn settlessession/update: progress notifications stream back while the turn works (tool calls, output chunks)session/request_permission: tool approvals round-trip to the editor, so the client’s permission UI gates dangerous calls the same way channel approvals do
stdout is the protocol channel: nothing but JSON-RPC frames is ever written to it. Logs go to the daily log file (or stderr in debug builds), never stdout.
Sessions (v0.5.4)
Sessions are first-class on the ACP surface:
session/newoffers a live model catalog, so the client picks from models that actually exist in your configsession/loadreplays the transcript and restores the per-session modelset_modelpersists on the session row and survives process restartssession/set_modeapplies the approval policy server-side (native, no prompt workaround)session/compactpushes compaction to the client- The context meter is restored on load and rides usage updates, so the editor always shows a true context reading
Session Lifecycle v1 (v0.5.5)
The ACP server now implements the five v1 session lifecycle methods (#1815): session/list pages your sessions with a cursor, session/resume reattaches without replaying history while still restoring the model pin, session/set_config_option is the write half of the model picker (F4 only displayed it before), session/close cancels in-flight work and frees live state, and session/delete removes the row after freeing it. initialize now advertises the list, resume, close, and delete session capabilities. The plan is also published as a native v1 plan update, and image prompt blocks sent by the client are decoded into <<IMG>> attachments the agent can actually see.
Why it matters
Before ACP mode, driving OpenCrabs from an editor meant copy-pasting between the editor and a channel. With ACP mode the editor is a first-class surface: same providers, same skill gating, same plan approvals, same memory. Configuration is shared with the rest of OpenCrabs; there is no separate ACP config section.
Self-Healing
OpenCrabs monitors its own health and automatically recovers from failures without user intervention. All recovery events surface as visible notifications across TUI and all channels.
How It Differs from Crash Recovery
OpenCrabs has had crash recovery since early versions – if the process dies mid-request, pending requests are tracked in SQLite and automatically resumed on restart (see Pending Request Recovery below).
Self-healing (v0.2.92) goes further: the agent detects and fixes problems while it’s still running – corrupted config, degraded providers, context overflow, stuck streams, DB corruption – without restarting. Crash recovery is the safety net; self-healing prevents the fall.
Config Recovery
Every successful write to config.toml creates a snapshot at ~/.opencrabs/config.last_good.toml. When the config becomes corrupted or unparseable, OpenCrabs restores from the last-known-good snapshot automatically.
⚠️ Config was corrupted: restored from last-known-good snapshot (2 minutes ago)
A CONFIG_RECOVERED atomic flag tracks whether recovery happened during the current session, so downstream code can react accordingly.
Unknown Key Detection
Unknown top-level keys in config.toml trigger a startup warning listing the unrecognized entries. This catches typos like [teelgram] or [a2a_gatway] before they cause silent misconfiguration.
Known valid sections: [crabrace], [database], [logging], [debug], [providers], [channels], [agent], [daemon], [a2a], [image], [cron].
The [a2a] section also accepts gateway as an alias via serde, deduplicating a common typo.
Custom Provider Name Normalization
Provider names with mixed case or whitespace (e.g. "My Provider" vs "my provider") are normalized on load and save, preventing duplicate entries that would confuse the provider registry.
Provider Health Tracking
Per-provider success/failure history is persisted to ~/.opencrabs/provider_health.json. Each provider tracks:
last_successandlast_failure(epoch seconds)last_error(truncated to 200 chars)consecutive_failurescount (resets on success)
{
"anthropic": {
"last_success": 1743250500,
"consecutive_failures": 0
},
"openai": {
"last_success": 1743249800,
"last_failure": 1743249700,
"last_error": "rate_limit_exceeded",
"consecutive_failures": 0
}
}
The /doctor command surfaces health stats for every configured provider. Combined with the fallback provider chain, OpenCrabs detects degraded providers and routes to healthy ones automatically.
Source: src/config/health.rs (120 lines), integrated into src/brain/agent/service/helpers.rs.
DB Integrity Check
SQLite PRAGMA integrity_check runs at startup. If corruption is detected, a notification appears in TUI and all connected channels instead of silently failing.
Error Surfacing
v0.2.92 eliminated 14+ instances of silently swallowed errors across:
- Config writes
- Channel sends (Telegram, Discord, Slack, WhatsApp)
- Tool connections (Slack, WhatsApp, Trello connect tools)
- Pane state persistence
Before: let _ = ... and .ok() everywhere, errors vanish.
After: Every error surfaces via logging or user notification.
Onboarding config writes use try_write! macros that batch errors during wizard steps and report them all at the end, so users see exactly what failed.
AgentService Config Propagation
AgentService::new() now requires an explicit &Config parameter instead of calling Config::load() internally. This eliminates hidden I/O, makes dependencies explicit, and enables test injection via AgentService::new_for_test().
Render, dialogs, messaging, and cron modules no longer call Config::load() internally – errors propagate up the call stack instead of being swallowed.
Context Budget Management
The agent enforces a 65% context budget threshold. When token usage reaches 65% of the effective context window (context limit minus tool schema overhead), automatic LLM compaction fires:
- Detect context usage ≥ 65% of effective max tokens
- Compact via LLM summarization (preserves meaning, not just truncation)
- Retry up to 3 times if compaction fails
- Second pass with tighter budget if still over threshold
The 65% threshold exists because providers like MiniMax degrade on function-calling quality well before hitting theoretical context limits – tool calls break around ~133k tokens of a 200k limit.
Async Proactive Compaction (v0.3.16)
At 65% context, compaction now runs asynchronously in the background instead of blocking the chat. The agent continues processing while the LLM summarizes older messages. Once compaction completes, the context is swapped seamlessly. No more frozen UI during compaction.
Source: src/brain/agent/service/tool_loop.rs (lines 14-112)
Emergency Compaction (ARG_MAX Recovery)
When CLI provider conversation context exceeds the OS ARG_MAX limit (~1MB on macOS), the agent recovers with a 3-stage fallback:
- Catch the “Argument list too long” or “prompt too large” error
- Emergency compact the conversation with an LLM summarization pass
- Insert a system marker so the agent knows context was compacted
- Retry the request
If compaction still fails, hard truncation kicks in – keeps last 24 messages (12 conversation pairs) with a marker telling the agent to use search_session for older context. Both markers persist to DB for recovery across sessions.
Both actions emit SelfHealingAlert progress events so users see exactly what happened.
Source: src/brain/agent/service/tool_loop.rs (lines 550-687), tested with ArgTooLongMockProvider and ContextLengthMockProvider in src/tests/cli_arg_too_long_test.rs (352 lines).
Stream Resilience
Stuck Loop Detection
Some streaming providers (notably MiniMax) occasionally loop the same content indefinitely without sending a stop signal. The agent detects this:
- Maintains a 2048-byte rolling window of recent streamed text
- When a 200+ byte substring from the second half appears in the first half, it’s a repeat
- Stream is terminated immediately and retry logic fires
Source: src/brain/agent/service/helpers.rs – detect_text_repetition(), tested in src/tests/stream_loop_test.rs (15 tests)
Idle Timeout
If a stream goes silent for 60 seconds (API providers) or 10 minutes (CLI providers) with no events, it’s treated as a dropped connection.
CLI providers (Claude CLI, OpenCode CLI) run internal tools (cargo builds, tests, gh commands) that can take several minutes without producing stream events. The 60-second timeout caused premature termination on these, so CLI providers now get a 10-minute window before timeout fires.
If a stream goes silent:
#![allow(unused)]
fn main() {
const STREAM_IDLE_TIMEOUT: Duration = Duration::from_secs(60);
}
The tokio::select! loop races the stream against the timeout and the user’s cancellation token. Timeout triggers retry, not a hard error.
Pending Request Recovery
Crash recovery tracks every in-flight agent request in a pending_requests SQLite table. When a request starts, a row is inserted; when it completes (success or failure), the row is deleted.
On startup, any surviving rows mean the process crashed mid-request:
- Query
pending_requestsfor interrupted rows - Clear all rows (prevents double-recovery if this run also crashes)
- Dedup by session_id (resume each session only once)
- Spawn background tasks with a continuation prompt:
“A restart just occurred while you were processing a request. Read the conversation context and continue where you left off naturally.”
- Emit
TuiEvent::PendingResumedso the TUI shows a recovery notification
Source: src/db/repository/pending_request.rs, src/cli/ui.rs (lines 705-790)
Cross-Channel Crash Recovery (v0.2.93)
Before v0.2.93, pending request recovery always responded via the TUI, even if the original request came from Telegram, Discord, Slack, or WhatsApp. The resumed response would appear in the wrong place.
Now each channel passes its name and chat_id into run_tool_loop, which stores them in pending_requests. On restart, recovery routes responses back to the originating channel:
| Original channel | Recovery response goes to |
|---|---|
| Telegram | Same Telegram chat |
| Discord | Same Discord channel |
| Slack | Same Slack channel |
| Same WhatsApp chat | |
| Trello | Same Trello board |
| TUI | TUI (as before) |
The pending_requests table gained channel and channel_chat_id columns via a DB migration. get_interrupted_for_channel lets each channel handler query only its own pending rows. Selective delete_ids prevents one channel from clearing another channel’s recovery entries.
State Cleanup
Session deletion triggers cascade deletes across all related data:
- Messages (full conversation history)
- Usage ledger entries (token/cost records)
- Channel messages (Telegram, Discord, Slack, WhatsApp delivery records)
- Plans (autonomous plans created in the session)
- Cron jobs (scheduled tasks bound to the session)
- Cached pane state (stale split pane entries)
Custom provider names are normalized on load and save ("My Provider" → "my-provider"), preventing duplicate entries that would confuse the provider registry.
Model Selector Safety
Pressing Enter in the model selector no longer clears existing API keys. The selector preserves current configuration while switching models.
Model switching errors now surface the actual error with a ⚠️ prefix on all channels, instead of always showing “Model switched” even on failure.
UTF-8 Safety
split_message() across all 5 channel handlers (Telegram, Discord, Slack, WhatsApp, Trello) now uses is_char_boundary() to find safe split points, preventing panics on multi-byte characters (emojis, CJK, accented characters).
Cancel Persistence (v0.2.97)
When a user double-Escapes to abort a streaming response, the partial content is now persisted to the database before handle.abort() fires. This means cancelled content survives a session reload – you can scroll back and see exactly what the agent was saying before you stopped it.
Claude CLI Subprocess Cleanup
Previously, aborting a Claude CLI request would orphan the underlying claude subprocess. Now the stream reader loop monitors tx.closed() via tokio::select! and kills the child process when the receiver drops, preventing leaked subprocesses accumulating in the background.
Telegram Stale Delivery Suppression
When a request is cancelled mid-flight, the agent sometimes continued processing and delivered a stale response to Telegram. A cancel_token.is_cancelled() guard now fires before final delivery, preventing old agent results from posting after cancellation.
Config Overwrite Protection
The onboarding wizard previously overwrote existing channel settings on every save, causing data loss when re-running /onboard. apply_config() now scopes writes to only the current onboarding step. from_config() sets EXISTING_KEY_SENTINEL for all existing channel data, ensuring untouched fields are never overwritten.
Tool Description Wrapping
Tool call descriptions were previously truncated at 80 characters in the TUI. render_tool_group now wraps description headers and value lines to terminal width, and the 80-char pre-truncation of bash commands in format_tool_description has been removed. Long commands and file paths display fully.
Auto-Fallback on Rate Limits (v0.2.98)
When the primary provider hits a rate or account limit mid-stream, OpenCrabs catches the RateLimitExceeded error, saves the current conversation state, and resumes the same conversation on a fallback provider configured in [providers.fallback]:
[providers.fallback]
enabled = true
providers = ["openrouter", "anthropic"] # tried in order
The fallback chain reads from config at startup. has_fallback_provider() and try_get_fallback_provider() are available at runtime for dynamic queries.
Two-Tier Context Budget Enforcement
Compaction budget scales proportionally to max_tokens instead of a hardcoded 170k, supporting custom providers with different context windows:
- 65% soft trigger: LLM compaction with retries (preserves meaning)
- 90% hard floor: Forced truncation to 75% (cannot fail)
- Pre-truncate target: 85% of max_tokens
- Compaction is silent to user: summary written to memory log only, no chat spam
Mid-Stream Decode Retry (v0.3.0)
Transient stream decoding errors now trigger a 3x backoff retry before falling back to the provider fallback chain. This reduces false provider switches caused by momentary network glitches.
SIGINT Handler + Panic Hook (v0.3.0)
Proper terminal restoration on crash or Ctrl+C via custom SIGINT handler and panic hook. No more garbled terminal after interrupt, the handler restores raw mode, cursor visibility, and alternate screen before exiting.
Proactive Rate Limiting (v0.2.99)
For OpenRouter :free models, OpenCrabs paces requests automatically using a shared global static limiter to avoid account-level bans. The rate limiter’s first-call sentinel (last_granted=0) no longer causes an unnecessary sleep.
RSI Alert Suppression (v0.3.13)
RSI alerts are now suppressed when the feedback dimension already has a fix commit in the recent git history. This prevents the agent from alerting on issues that have already been addressed. Stale alerts also age out via a sliding window on tool failure stats.
Expanded Phantom Detection (v0.3.17)
The phantom detector now catches additional patterns:
- “Now <file-op gerund>” phantoms: catches phrases like “Now creating…”, “Now writing…”, “Now editing…” where the model narrates a file operation without actually executing it
- Build/deploy intent + past-tense completion claims, catches when the model claims to have built or deployed something without running the actual commands
- Module extraction: gaslighting and phantom detectors extracted into their own dedicated module for cleaner maintenance
Phantom Language Packs (v0.5.14)
Phantom detection reads a language pack per supported language, and each pack carries its intent phrases, completion claims, action verbs and character sets in a compile-time TOML file. Adding a language means editing TOML, not Rust.
- Eight packs: English, Portuguese, Spanish, French, Indonesian, Russian, Arabic and Chinese
- Script detection routes each language correctly: Arabic script is counted over the Arabic blocks, Han characters route to the Chinese pack, and kana or hangul keep Japanese and Korean text off that branch
- Comparable coverage: the non-English packs carry intent phrases at the same order of magnitude as English, instead of roughly a third of it
- European Portuguese continuous narration:
estou a carregarstyle constructions are caught next to the Brazilian gerund - Pack-level guards: a test compiles every regex in every pack, because a lookahead that fails to compile is swallowed by the detector and kills the whole arm in silence, refuses a replacement character (U+FFFD) anywhere in a pack, and pins one caught announcement and one clean sentence per language
RSI Escalation for Repeat Violations (v0.3.17)
RSI now bumps a violation counter on existing rules instead of deduping repeat violations away. Rules that keep getting broken get louder, not silenced. This prevents the agent from ignoring persistent failure patterns.
Partial JSON Repair (v0.3.17)
A new json_repair module automatically fixes common JSON corruption:
- Closes unterminated strings
- Balances brackets
- Strips trailing commas
- Drops trailing keys-without-value
Wired into 5 drop sites across OpenAI-compatible providers and the ContentBlockStop finalizer. Unrecoverable input returns a {"_partial": ..., "_repair_failed": true} envelope instead of crashing the turn.
Upstream Template Sync (v0.3.15)
Brain file templates are now automatically synced from the upstream OpenCrabs repo. The sync uses version gating (only applies templates from newer versions) and append-only diffs (never overwrites existing content). This ensures you always get the latest brain file improvements without losing your customizations.
Browser Resilience (v0.3.18)
Multiple browser reliability improvements:
- Network idle wait after navigate: now waits for
networkIdleinstead of just CDPloadevent, catching async fetches - CDP manager lock released before await: lock was held during screenshot await, blocking concurrent browser operations
- CDP pre-flight health check: added health check before screenshot capture to prevent stale connection failures
- Browser navigate errors logged: navigate errors no longer silently swallowed with
let _ =, now logged at WARN
Cloud Handshake Timeout (v0.3.18)
Bumped cloud provider handshake timeout from 30s to 60s. Routing proxies like dialagram legitimately take 20-45s; 30s was killing mid-request on slow-but-healthy providers.
Gemini API Key Security Fix (v0.3.18)
Fixed CodeQL #64 (HIGH): Gemini API key was leaked in URL query string (?key=...) in analyze_video’s resumable upload init and file-state polling. Moved to x-goog-api-key header, matching analyze_image and generate_image.
Stream & TUI Fixes (v0.3.18)
- File paths starting with
/no longer treated as slash command typos,/Users/.../file.pdf yo crabs check thistriggered “Unknown command”. Addedlooks_like_file_path()helper gating both TUI and channel handlers. - Truncation continuations no longer trigger provider fallback, mid-sentence continuations should stay on the same provider. Fallback now skipped for truncation paths.
- Fallback error reason surfaced in TUI: when fallback fired, the underlying error was swallowed. Now shows as a system message.
- Pipe-delimited rows hard-broken: when not recognized as a table, pipe rows ran together. Added hard-break between rows.
v0.3.25 Fixes
- Compaction dropped 55% kept-tail: summary IS the conversation now, no more redundant tail retention
- Self-heal 5-nudge budget: reasoning-only turns get 5 nudges before sticky fallback, preventing empty replies from silently dropping
- Completion-escape clause: phantom enforcement messages now have escape clause to prevent infinite loops
- Scroll fixes: removed
load_more_history()from scroll handler (overshoot fix), preserved scroll during streaming, skip first-render compensation - Brain file cleanup_intent:
write_opencrabs_filenow acceptscleanup_intentflag for user-driven maintenance. RSI agent blocked from shrinking brain files (issue #103) - Channel improvements: WhatsApp photo batching for multi-image uploads, Telegram
media_group_id-based batching, Gemini schema stripsdefault/examplefrom tool schemas (#101, @leshchenko1979) - Custom provider model selection persistence, properly saves and displays custom provider model selection
- Compaction prompt dominance fix: plan tool descriptions and scroll sensitivity improvements
v0.3.23 Fixes (Hotfix Release)
- Phantom detection restored: v0.3.21’s turn-level
tools_executed_this_turngate was too aggressive: once any tool ran in a turn, phantom detection went silent for the rest of the turn, letting fabricated wrap-up text reach the TUI. Dropped the gate from all three phantom branches. - Self-heal never aborts: stuck-intent-loop now fast-escalates to sticky fallback instead of aborting; cap-exhaustion resets retry counter and injects hard nudge;
phantom_retries_usednow tracks consecutive phantoms since last real tool. Recovery always retries or falls back. - Brain file guardrail: generic
write_file/edit_filenow refuse to modify protected brain files (SOUL.md, USER.md, TOOLS.md, etc.), preventing accidental clobber. Routed throughwrite_opencrabs_fileinstead. - A2A approval policy wired: A2A
message/sendtasks now resolve approval policy viacheck_approval_policy(). Withauto-alwaysset, tools auto-approve; otherwise returns warning. Fixes “Tool requires approval but no approval mechanism configured” errors. - Channel
/newsession switching fixed:/newnow uses per-message resolver’s title format everywhere (Telegram, Discord, Slack), so session switching works across all channels. - Version-aware model sort: when OpenAI-compatible servers return zero or identical
createdtimestamps, extracts numeric segments from model names and sorts newest version first. Fixes meaningless model lists on vLLM/llama.cpp.
v0.3.22 Fixes
- Compaction typing without banner: reverted the visible “🗜️ Compacting context” banner text. Now uses typing-only refresh (Telegram
send_chat_action(Typing), Discordbroadcast_typingloop) keeping the “is typing” indicator alive during the 10-60s compaction window silently. - Channel
/newarchive consistency: unified archive behavior across all channels: non-owner sessions get archived (so next title lookup resolves cleanly), owner sessions stay non-archived and remain visible in/sessions.
v0.3.21 Fixes
- Multi-language phantom detection via compile-time TOML, replaced regex patterns per language with TOML-defined char sets compiled into build-time match arms. New languages added by editing TOML, no Rust changes. Cross-language regression test added.
- Self-heal pipeline hardened: phantom detection gated on turn-level tool execution, phantom iterations no longer persisted to DB, phantom text stripped from context before next turn, sticky fallback applied on exhaust.
- OpenAI-compatible image generation: new image generation backend calling any
/v1/images/generationsendpoint. Providers override generation model independently viageneration_modelconfig field. - Working directory visible across tools: working directory now visible to all tools within the same iteration.
- Compaction banner stripped from context: compaction banner text no longer fed to LLM context, preventing models from echoing it back.
- Pipe-separate model callback: custom-provider model callbacks now pipe-separated so colons in provider names (e.g. “Qwen: DashScope”) survive parse.
- Custom-provider model selection persists:
/modelsdialog now correctly saves and syncs live model list for custom providers. one_shot_pctdisplay corrected: fixed incorrect percentage display in usage dashboard.- Session
updated_attouched on switch: session last-modified timestamp updated when switching sessions via Telegram, preventing stale session resolution.
v0.3.19 Fixes
- Cron provider/model cross-contamination fixed, cron’s
execute_jobcalled globalswap_provider()instead of session-scopedswap_provider_for_session(), so concurrent cron jobs on the sharedCronsession overwrote each other’s provider. Now each job swaps on its own session ID. - Cron mismatched pair validation: reversed cron config (e.g.
default_model = "zhipu"wherezhipuis a provider name) produced impossible pairs likedialagram/zhiputhat timed out with no diagnostics. Added validation: ifeffective_modelis not in the provider’ssupported_models(), the job is skipped with a loud error. - Windows CI test failures fixed:
tool_loop_helpers_test.rsused hardcoded Unix/tmp/paths and/etc/hostsassertions. Added platform-specific test variants with#[cfg(unix)]/#[cfg(windows)]. - CI Node 24 forced upgrade removed: removed
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: trueenv var that brokeactions/cache@v4withpunycodedeprecation on Node 21+. - Codex OAuth device flow field names fixed: OpenAI’s device auth API uses non-standard field names (
device_auth_idinstead ofdevice_code, stringintervalinstead of number,expires_atinstead ofexpires_in). Fixed with serde aliases and custom deserializer. - Codex OAuth verification URL corrected: was hardcoded to non-existent
auth.openai.com/verify, changed toauth.openai.com/codex/devicematching Codex CLI. - Codex OAuth model list curated:
/modelsdialog showed non-OpenAI models (Phi-4, Llama, Mistral) because thecodexprovider ID wasn’t mapped to the curated GPT-5 model list.
v0.3.26 Fixes
- Hashline collision detection (#105): pure content hash prevents line-shift avalanche when lines are inserted/deleted above a hash anchor. On collision, escalates to
edit_filefallback instead of corrupting the edit - RSI brain file hygiene (#111): rejects raw failure-event logs from being written to brain files. RSI now sanitizes feedback dimensions before persisting
- Tool error output (#113): tool errors now include stdout/stderr in error content, ANSI escape sequences stripped, 8000 char cap to prevent context blowout
v0.3.27 Fixes
- Ctx budget baseline on channel
/new: shows calibrated baseline immediately after/newinstead of waiting for first message - Auto-title session fix (#114): preserves
[chat:ID]suffix to prevent title duplication on subsequent auto-title fires - Sessions display (#115): arrow prefix + “current” label instead of checkmark for clearer session switching UI
v0.3.28 Fixes
- Voicebox + STT/TTS fallback chains: 2s liveness probe detects dead audio devices, librosa error translator surfaces actionable messages instead of Python tracebacks, per-provider fallback chains configured in
config.toml - Browser multi-step navigation hardening (6 commits):
text=/xpath=selector prefixes, recovery hints on click failures, semantic loop detection (4+ screenshots in 8 iterations triggers abort), no-op screenshot rejection, same-URL short-circuit - Tool-call shape recovery: dict-by-call-id extraction for Qwen-3.7-max-preview regression where tool calls arrive as flat dicts instead of nested arrays
- Edit tool improvements (#117): fuzzy line-sequence fallback when exact match fails, hashline docs clarification
- Brain backup rotation: max 5 backups per file, max 7 days old, preventing unbounded
.bakaccumulation - Auto-title fixes (#118, #120): fires on FIRST turn (not second), retries on LLM failure instead of giving up
- Ctx counter real-time only (#119): ripped out calibration system entirely, uses provider-reported
input_tokensverbatim. No more “0/max” for uncalibrated providers - Profile brain-template seeding: seeds 8 templates on
profile create, recovery path for empty profiles
v0.3.29 Fixes
- Auto-title thinking-block fallback (#121): reasoning models returning only a Thinking block (no Text block) now get a title extracted from the thinking content instead of dropping silently.
extract_title_candidatefalls back topluck_title_from_thinking(last quoted phrase, then last short sentence) - Telegram label-drift fix (PR #123 @leshchenko1979): auto-titled sessions no longer overwritten on every subsequent message.
should_refresh_labelpolicy only refreshes default→default-different or group label changes, never auto-titled or custom titles. Chat→session binding on/sessionsswitch
v0.3.30 Fixes
- 5-language deferment stall detection: self-heal catches “I need to X” / “I have to X” / “I must X” / “I should X” patterns in English, Spanish, Portuguese, French, and Russian
- Follow-up message = ESC x2 cancel: all four channel handlers treat a follow-up message during an active agent run as double-Escape cancel, then starts fresh
- Dynamic Telegram status messages: replaced hardcoded quips with context-aware messages showing actual tool being called, tokens streamed, and elapsed time
- rename_session rejects empty titles (#128): whitespace-only titles rejected so sessions can’t become unidentifiable
v0.3.31 Fixes
- Fun POST-COMPACTION PROTOCOL prompts: after compaction, the agent receives a playful system prompt instead of a sterile summary marker. These rotating prompts (e.g. “You just woke up from a nap. The summary above is everything you remember.”) make the post-compaction experience less robotic. Users can opt out with
[agent] silent_compaction = truein config.toml. - Telegram forum topic routing: in supergroups with topics enabled,
thread_idis tracked through the full pipeline. The agent can uselist_topicsto map topic names to IDs, then route responses to specific topics viathread_idon send/reply/send_photo. - PDF
page_rangeparam:parse_documentnow acceptspage_rangestrings like"1-30","5,7,10-15", or"3"for targeted extraction. Text-first routing skips Gemini for text-native PDFs. Inline preview cap raised to ~60 pages.
v0.3.32 Fixes
- Evolve hardening (#136): the
/evolvecommand now handles busy Linux binaries with a remove+rename dance (can’t overwrite a running binary on Linux), delayedsystemd-runrestart to let the current process finish cleanly, structured tracing for better error diagnosis, and a pre-flightcount_matching_systemd_unitscheck to avoid restarting when multiple OpenCrabs instances are running.
v0.3.33 Fixes
- User-correction metadata (#138, PR #140):
display_text_overridenow captures the actual user message text instead of the 236-character Telegram channel prefix that was previously stored. This makes user correction entries in the feedback ledger readable and actionable.
v0.3.34 Fixes
follow_up_questionrace fix (closes #142): all four channels (Telegram, Discord, Slack, WhatsApp) now flush intermediate text handles before presenting the follow-up keyboard. Prevents the race where the bot’s in-progress message got orphaned or duplicated when the user tapped a button mid-stream. Each channel got its own atomic commit with per-channel regression tests pinning the flush-before-keyboard sequence.follow_up_questiondisplay polish (closes #148): Telegram keyboard is now single-column with a 40-character label cap (rejects options longer than 40 chars in the tool validator with a clear error). Rolling “Running follow_up_question (16s)” status is suppressed while the keyboard is pending, and the LLM is now instructed to call the tool silently without echoing the question text in surrounding prose. Discord left alone due to its 5-ActionRow-per-message hard limit.- Phantom detector hardening: two narration shapes had been leaking past the phantom detector: pronounless deferment (
Need to read the X) and bare gerunds (Reading the current state of the affected files). Added 28 pronounless EN variants, 15 telegraphic FRbesoin devariants, and gerund+determiner bigrams. New regression file pins both leaked sentences verbatim. Follow-up fixed French accent detection:detect_languagemissedé/è/ë/ü, so French narration fell through to English and the newbesoin dephrases never matched. Added the 4 markers. - Fallback provider cascade (closes #152):
/modelsswaps and session restores were storing a raw provider instead of wrapping it inFallbackProvider, so the fallback cascade could not fire on 5xx/429 errors after a model switch. Every active provider now gets wrapped unless it is already a chain or no fallbacks are configured. 174-line integration test simulating 5xx cascades across swapped providers. - Error persistence: agent failures now persist as permanent chat bubbles with actionable wording on TUI and channels instead of vanishing after the turn. UTF-8 panic after redact-prefix scan fixed by snapping to char boundary.
- FINISHING A TURN rewrite: split the brain preamble directive into side-effect vs analysis response shapes, added a nudge on empty data-fetch closes so the agent never ends a turn silently after running research tools, and requires an explicit acknowledgement sentence instead of letting
finish_reason: stopwith no content reach the user. - Claude CLI model auto-learn: footer showed Opus 4.7 after Anthropic shipped 4.8 because
default_for_aliashardcodedopus -> opus-4-7. Now the provider learns the CLI-resolved version frommessage_startevents, persists to~/.opencrabs/claude_cli_models.json(rewriting only when the value changes), and the TUI refreshes the session model live so the footer self-corrects to the actual version without code changes.default_for_aliasprefers the learned cache and falls back to a build-time seed only on a fresh install. - tok/s in channel footers: channel context budget footers showed only
ctx: XK/YK Z%while the TUI also showed| N tok/s. Addedtokens_per_second: Option<f64>toAgentResponse, extendedformat_ctx_footerto accept a thirdtpsparameter, computed tok/s fromtotal_output_tokens / turn_durationacross the whole turn intool_loop.rs, and wired it through all four channels.
Unreleased (post-v0.3.33)
- Phantom post-success exemption: the phantom detector used to fire on short completion acknowledgments like “Pushed.”, “Done.”, or “Committed as abc123” because those look like past-tense completion claims without a tool call. But when the agent just finished a real tool run, that one-line ack is the correct behavior. A turn-scoped
tool_calls_completed_this_turncounter and aphantom_eligiblegate now suppress phantom detection once real tool calls have landed in the current turn. The complementaryFINISHING A TURNbrain preamble directive tells the agent to reply with one short ack, skip verification re-runs, and stop restating conclusions in different wording. follow_up_questionintermediate flush (issue #142): when the agent calledfollow_up_questionafter typing an explanatory preamble, Telegram/Discord/Slack/WhatsApp sometimes delivered the button block before the preamble text because intermediate text sat in a 500ms-polled queue whilefollow_up_questionsent directly. All four channel handlers now flush pending intermediateJoinHandles before dispatching the question, guaranteeing the explanatory text renders above the buttons.
v0.3.36 Fixes
- Near-miss tool name self-heal (closes #176): when the model guesses a wrong tool name (e.g.
tg_send_messageinstead oftelegram_send), the tool registry now tries three fallback strategies before returning NotFound: (1) normalized match (strip underscores, lowercase), (2) abbreviation expansion (tg→telegram,wa→whatsapp), (3) typo fallback (Levenshtein distance). Conservative: only heals on a unique high-confidence match, so ambiguous guesses still return an error. - Retry overhaul: patient backoff defaults changed from 100ms hammering to 1s/2s/4s/8s. Rate limits now retry in-place (3 retries) before falling through the fallback chain. Hard-down endpoints (DNS failure, connection refused) fail fast instead of wasting retries. Transient 4xx HTML infra pages (Cloudflare, nginx error pages) are retried. Each retry surfaces as a
RetryAttempt N/M - reasonevent to the user. - Provider/model contamination prevention: atomic provider+model swap across 27 call sites prevents the footer from showing a stale provider after switching panes or sessions.
- Secret redaction expanded: query-param keys (
?api_key=...) and URL passwords (https://user:pass@host) now redacted alongside Bearer tokens and API key patterns. RSI TUI notifications also redacted.
v0.3.35 Phantom Hardening
- Re-engaged on forward intent: phantom detector now re-engages self-heal when forward intent is detected after a successful tool call, preventing the agent from narrating what it’s about to do instead of just doing it.
- Five-language cleanup: destructive verb intent phrases cleaned up across EN, ES, FR, PT, and RU. Prevents the agent from narrating destructive actions (“I’ll now delete the file”) when it should just execute the tool.
Thinking-Loop Timeout (v0.3.78)
A new thinking-loop timeout catches the agent stuck in an infinite reasoning loop (producing thought tokens but never emitting a tool call or response). When the timeout fires:
- The stuck stream is terminated
- Phantom enforcement retry fires (nudges the agent to produce real output)
- If still stuck after retries, sticky fallback provider kicks in
This eliminates the “agent appears to be thinking forever but never does anything” failure mode.
Expanded Phantom Detection (v0.3.76–v0.3.78)
The phantom detector gained significant coverage across three releases:
v0.3.76 Additions
- File-delivery claims: catches “I’ve sent the file” / “document delivered” when no file-sending tool ran
- Null-effect tool calls: tools that execute but produce no observable effect no longer grant phantom immunity
- Command verification: quoted commands are checked against what the turn actually ran
- Evidence checking: quoted evidence (output, logs) is verified against actual tool returns
- Investigation claims: “I investigated” / “I looked into” counts as a completion claim requiring evidence
- Both-ends check: examines both the lead-in AND the wrap-up of a turn, not just the opening
- Self-update claims: “I updated my memory” / “I noted this” counts as a completion claim
v0.3.78 Additions
- Shipped-and-tracked claims: “shipped and tracked in issue #N” without actual gh/git calls
- Colloquial delivery claims: “that’s out the door”, “it’s in your inbox”, casual completion language
- Media-delivery claims: “I’ve attached the image” / “video sent” without media tools running
v0.3.75 Hardening
- Bounded self-heal loop: the phantom self-heal loop is now bounded instead of re-nudging forever, and discarded phantom self-heal narration is stripped from the live buffer so it never reaches the chat.
- Patient mid-stream retry: mid-stream retry is more patient: 5 attempts with exponential backoff instead of giving up early.
- Flaky 404 retried: a flaky-provider 404 is retried instead of being treated as a permanent failure.
- Multilingual hallucination detection: image-generation hallucination detection (a media claim with no marker and zero tool calls) now works across languages, and self-heal no longer delivers an image hallucination when it gives up.
- Poisoned-session recovery: auto-recovers from a repetitive-tool-call poisoned session instead of looping on the same broken call.
- Phantom verdict on recovery paths: the turn-end phantom verdict now catches narration delivered via recovery paths, and issue-tracker actions count as completion claims.
Loop Guards (v0.3.80)
Three guards stop the agent repeating itself (#957, #961):
- Cross-turn announcement loop guard: detects when the agent keeps announcing the same action across turns without actually doing it
- Near-match loop guard: catches reworded repetitions of the same tool call, generalized to ALL tools, not just bash
- Mid-turn announcement checks: reworded announcement loops are caught inside the turn, not only between turns
When the loop detector kills a stalled turn, that kill reaches the fallback chain (#1023): it is raised as a provider-attributable error so the turn can retry with another provider instead of surfacing as a hard failure, and it is no longer misreported as a provider fault. Spent thinking-loop budget is routed into the fallback chain the same way (#1021).
Notifications
All self-healing events are delivered to:
- TUI (status bar notification)
- Telegram, Discord, Slack, WhatsApp (if connected)
Nothing happens silently. If the crab fixes itself, it tells you what it fixed.
Early Loop Detection (v0.3.81)
The loop detector now notices a repeating tool round before the provider rejects the turn. Instead of burning the context window on identical rounds and surfacing a provider error, the detector catches the pattern early and routes it through the existing loop-kill path (which reaches the fallback chain since v0.3.80).
Fact-Based Detectors Fire the Heal (v0.3.81)
Phantom-detection refinements (#1073, #1074):
- Fact-based detectors self-heal: detectors that verify against ground truth (files, command output) now fire the self-heal path directly, not just gate the claim
- Wider command allowlist: inspection-style claims are checkable, so “I ran X” verification covers more real phrasings
- Dotted commands survive the sentence split:
some.command --flagis no longer torn in half when the claim is parsed
Self-Improvement (RSI)
OpenCrabs improves itself over time through Recursive Self-Improvement (RSI). The agent analyzes its own performance, identifies patterns, and autonomously updates its own brain files.
How It Works
1. Feedback Collection
Every tool execution, user correction, and interaction is automatically logged to the feedback ledger. Categories include:
tool_success/tool_failure: whether tool calls workeduser_correction: when you corrected the agent’s behaviorprovider_error: LLM stream drops, rate limits, timeoutspattern_observed: recurring behaviors the agent notices
2. Pattern Analysis
The agent calls feedback_analyze to review its performance:
- Per-tool success rates
- Recent failure patterns
- User correction frequency
- Provider reliability trends
3. Autonomous Improvement
When patterns are identified, the agent calls self_improve to:
- read: Load a brain file (SOUL.md, TOOLS.md, etc.) before modifying
- apply: Append new instructions based on observed patterns
- update: Surgically replace existing sections that need refinement
- list: Show all previously applied improvements
4. Change Tracking
Every improvement is logged to ~/.opencrabs/rsi/improvements.md with:
- Timestamp
- Target file modified
- Description of the change
- Rationale (which feedback event triggered it)
Old improvements are archived to ~/.opencrabs/rsi/history/ to keep the active file lean.
Example
User: "stop including testing steps in your output"
→ feedback_record(event_type="user_correction", dimension="output_hygiene")
Agent notices pattern of 5+ corrections on output hygiene:
→ feedback_analyze(query="failures")
→ self_improve(action="apply", target_file="SOUL.md",
content="Never include testing steps or verification commands in user-facing output.")
→ Logged to rsi/improvements.md
Key Rules
- No human approval needed for self-improvements, the agent identifies patterns and applies fixes directly
- Surgical updates only: replaces specific sections, doesn’t rewrite entire files
- Always reads before modifying: never blindly overwrites brain files
- Archives old improvements: keeps the improvement log manageable
RSI Engine Architecture
The RSI engine is a background task that runs continuously alongside OpenCrabs. Here’s how it works at each layer:
Feedback Ledger
Every tool execution, user correction, provider error, and self-heal event is automatically logged to a SQLite-backed feedback ledger. Event types:
| Event Type | What It Tracks |
|---|---|
tool_success / tool_failure | Whether tool calls worked, with args and error details |
user_correction | When you corrected the agent’s behavior |
provider_error | LLM stream drops, rate limits, timeouts |
pattern_observed | Recurring behaviors the agent notices |
context_compaction | Context budget exceeded |
improvement_applied | RSI applied a fix to a brain file |
self_heal_trigger | Runtime self-heal caught and fixed an issue |
Cycle Flow
- Startup: writes a digest of feedback stats to
~/.opencrabs/rsi/digest.md - Every hour: checks for new feedback entries since the last cycle
- Opportunity detection: identifies tools with >20% failure rate (7-day window), user correction patterns, and provider errors
- Git-aware suppression: checks if a fix commit already landed for the tool in question. If yes, suppresses the alert instead of re-reporting stale issues
- Autonomous agent spawn: if opportunities are found, spawns a lightweight agent with RSI-only tools (feedback_analyze, self_improve, rsi_propose) that analyzes the data and applies targeted fixes
Brain File Taxonomy
RSI routes improvements to the correct brain file based on what went wrong:
| Brain File | What It Controls | When RSI Writes Here |
|---|---|---|
SOUL.md | Behavior, tone, reasoning patterns | Phantom tool calls, verbose responses, wrong tone |
TOOLS.md | Tool usage, argument formats, pitfalls | Repeated tool failures with similar args |
USER.md | User preferences and corrections | Repeated user corrections |
MEMORY.md | Persistent knowledge and context | Agent lacks context it should retain |
AGENTS.md | Workspace rules, safety policies | Agent-level behavior issues |
CODE.md | Coding standards | Code quality feedback |
SECURITY.md | Security policies | Security-related feedback |
Repeat-Violation Escalation
RSI tracks violation counters inline in brain file rules. When a rule keeps getting broken, RSI bumps the counter and appends evidence (dates, session IDs). Rules that keep getting broken get louder, not silenced. This is the escalation pattern that makes RSI effective at fixing persistent bad habits.
RSI Proposals
The RSI loop can propose new dynamic tools and slash commands based on gaps it observes in the agent’s capabilities. Proposals land in TOML inboxes at:
~/.opencrabs/rsi/
├── proposed_tools.toml # pending tool proposals
├── proposed_commands.toml # pending command proposals
├── applied/ # accepted proposals (daily archive)
│ ├── 2026-05-01-tools.toml
│ └── 2026-05-01-commands.toml
└── rejected/ # rejected proposals (daily archive)
├── 2026-05-01-tools.toml
└── 2026-05-01-commands.toml
How Proposals Work
- RSI analyzes feedback and notices the agent repeatedly working around a missing capability
- RSI drafts a tool or command definition with a rationale citing the evidence
- Proposal lands in the inbox: reviewed via Mission Control or the
rsi_proposalstool - User applies or rejects: applied entries go to
tools.toml/commands.toml, rejected entries are archived with an optional reason
When RSI Proposes a Tool
- A specific bash command appears repeatedly across sessions (e.g.
gh issue list,docker ps) - The agent calls
http_requestto the same endpoint multiple times with similar payloads - Only safe-by-default tools are proposed (read-only verbs, GET requests). Shell-based tools always set
requires_approval=true
When RSI Proposes a Command
- The user types
/somethingrepeatedly that doesn’t exist - A common multi-step prompt gets reused verbatim, a slash command saves typing
Safety Guardrails
- RSI never installs directly: proposals require user approval via Mission Control or the
rsi_proposalstool - No destructive proposals: RSI will never propose
rm,dd,mv, or any shell tool with destructive side effects - Deduplication: if a proposal was already filed and not applied, RSI won’t repropose it
- One proposal per cycle: quality over quantity
- Evidence required: every proposal cites the feedback events that drove it
RSI Hardening (v0.3.13)
- Append-only brain files: brain files (SOUL.md, TOOLS.md, etc.) are now append-only with backup-before-write. The agent can only add new content, never delete or overwrite existing lines. This prevents accidental data loss from bad self-improvements.
- Upstream template sync: brain file templates are automatically synced from the upstream repo with version gating and append-only diffs. You get the latest improvements without losing your customizations.
- RSI alert suppression: alerts are suppressed when the dimension already has a fix commit, preventing noise on already-addressed issues.
RSI Autonomous Proposals (v0.3.16)
The RSI loop can now propose new tools and slash commands autonomously. Proposals land in the Mission Control inbox for review, the agent identifies gaps from feedback data and drafts solutions, but installation requires human approval via the inbox UI or /mission-control.
RSI Escalation for Repeat Violations (v0.3.17)
RSI now bumps a violation counter on existing rules instead of deduping repeat violations away. When a rule keeps getting broken across multiple sessions, the escalation counter increases and the agent prioritizes fixing that pattern. This prevents persistent bad habits from being silently ignored.
v0.3.10 Additions
- Cycle summaries no longer truncated: full text displays in TUI instead of cutting off mid-sentence
- Phantom detection reduced to 2-signal requirement, needs both intent keyphrase AND zero tool calls before flagging, eliminating spurious self-heal triggers
- Uses active provider: respects current provider/model config instead of hardcoded Anthropic
- Persistent session reuse: one session per cycle, survives app restarts by persisting
last_cycletimestamp - Skips unchanged feedback: if feedback count hasn’t changed, skips analysis to avoid wasted LLM calls
v0.3.11 Additions
- DashScope migration: Qwen OAuth rotation replaced with simple API-key provider, deleting ~2,500 lines of complexity
- Local model tool-call extraction: auto-extracts tool calls from text content: bare JSON
{"tool_calls":[...]}, Claude-style XML<TOOLNAME><PARAM>value</PARAM></TOOLNAME>, and Qwen-specific<!-- tool_calls -->markers - 40+ TUI/self-heal fixes: narrowed phantom gate, split thinking per iteration, anti-code-block nudge for local models, tighter phantom scope, mid-turn “Let me see:” catch, backtick code reference detection
- Per-session provider isolation: each session carries its own provider instance; no global swap affecting all sessions
- Sub-agent
AwaitingInputstate:wait_agentpolls state and returns partial progress on timeout instead of deadlocking
v0.3.20 Additions
- RSI home directory resolution fixed: RSI now resolves
~to the actual home directory instead of using CWD-relative paths, preventing brain file writes to wrong locations - Bare tool-call arrays caught: top-level arrays from models no longer crash RSI’s feedback dimension parsing; wrapped correctly before recording
v0.3.21 Additions
- Multi-language phantom detection: compile-time TOML char sets replaced language-specific regex patterns. RSI feedback now works with all supported languages via the new char-set system. Cross-language regression test added.
- RSI cycle output dedup by hashing: cycle output dedup now uses hash comparison of assembled opportunities instead of string matching, preventing duplicate cycle reports.
- Sticky fallback on phantom exhaust: when phantom detection exhausts retries, RSI applies sticky fallback provider to prevent cascading failures.
- Phantom iterations not persisted: phantom iterations no longer written to DB, keeping history clean of failed self-heal attempts.
- OpenAI-compatible image generation: image generation via any
/v1/images/generationsendpoint with configurablegeneration_modeloverride.
v0.3.23 Additions
- Brain file clobber guardrail: generic
write_file/edit_filenow refuse protected brain files, routing throughwrite_opencrabs_filewhich enforces append-only, dedup-aware shrink, and.baksnapshots. - A2A approval policy: A2A tasks now resolve approval policy correctly.
auto-alwaysandauto-sessionpolicies work for remote agents.
v0.3.25 Additions
- Brain file cleanup_intent:
write_opencrabs_fileacceptscleanup_intentflag for user-driven brain file maintenance. RSI agent explicitly blocked from shrinking brain files, preventing autonomous self-improvement from accidentally wiping content (issue #103). - RTK Token Savings integration: bundled RTK binary (4MB, v0.40.0) as default feature with zero-config. Works as direct proxy: agent runs
git status, RTK intercepts output through Rust, filters it, returns token-optimized version. 100+ commands supported (git, cargo, npm, pnpm, docker, kubectl, grep, find, ls, tree, curl), blocklist for interactive/REPL commands (vim, ssh, python, mysql). Binary discovery checks bundled location first, falls back to PATH./rtkslash command shows savings stats. Real-world results: 53.5% token savings across 180 commands (PR #102).
v0.3.19 Additions
- RSI feedback records actual model used: when helpers remap a mismatched model to the provider default, RSI now records the resolved model instead of the impossible original pair. All 3 recording sites in
tool_loop.rsnow resolve the actual model before constructing the feedback dimension - Tool loop reasoning markers persisted: reasoning content persisted in non-CLI content column so thinking state survives across tool loop iterations
- @ file picker fixed for large repos: recursive walk now skips
.git/.hg/.svndirectories and raised result cap from 5k to 20k, preventing pack/ref files from exhausting the cap
v0.3.26 Additions
- RSI brain file hygiene: rejects raw failure-event logs from being written to brain files. Feedback dimensions are sanitized before persisting, preventing noise accumulation in SOUL.md and TOOLS.md
- Hashline collision escalation: when hashline_edit detects a collision (two lines with identical content hashes), RSI escalates to
edit_filefallback instead of applying a corrupted edit - Dynamic help screen: help screen auto-generates from
SLASH_COMMANDSconstant, so new commands appear automatically without manual help text updates
v0.3.28 Additions
- Brain backup rotation: max 5 backups per file, max 7 days old. Prevents unbounded
.bakaccumulation in~/.opencrabs/from repeated RSI writes - Profile brain-template seeding:
profile createnow seeds 8 brain file templates automatically, with recovery path for empty profiles. Ensures new profiles start with complete brain file sets - Auto-title retry on LLM failure: auto-title no longer gives up on first LLM error; retries with backoff before falling back to truncated first message
v0.3.30 Additions
- RSI rejects trivial content:
self_improveapply action now rejects trivial test content before it can pollute brain files, preventing noise from accumulating in SOUL.md and TOOLS.md
v0.3.31 Additions
- RSI skill proposals:
skillis now a third proposal kind alongsidetoolandcommand. When RSI identifies a multi-stage workflow pattern that recurs across sessions, it proposes aSKILL.mdfile instead of a simple tool or command. Applied skill proposals write to~/.opencrabs/skills/<name>/SKILL.mdand become immediately invocable as/<name>across all channels. - Bash command visibility: RSI now sees the actual bash command text plus a subsystem classifier (git, cargo, docker, npm, etc.) in feedback events. This lets RSI identify recurring shell patterns more accurately and propose targeted tools or skills.
- Successful patterns surface as proposals: RSI doesn’t only react to failures. When a tool/command/skill pattern works reliably across multiple sessions, RSI surfaces it as a proposal to make the pattern more discoverable or ergonomic.
v0.3.34 Additions
- Brain dedup scan (closes #147): new RSI proposal kind
BrainDedupthat scans all 11 brain files daily, clusters duplicate lines (minimum 10 chars, skips structural markdown like headings and separators), and files dedup proposals into Mission Control with a soft purple badge. Runs every 24 RSI cycles (about once per day at 1-hour intervals), never auto-applies, human approval required through the existingrsi_proposalsapply/reject flow. Core scan logic indedup_scan.rs(393 lines), hooked into the RSI cycle with periodicity gating, 14 regression tests covering empty files, short-line filtering, cross-file detection, proposal format, and canonical selection. - Skill description injection (closes #151): skill descriptions were documented in TOOLS.md as LLM auto-invoking triggers but were never actually injected into the system prompt, so the LLM could not auto-invoke from description alone. Added
push_skills_section()toprompt_builder.rsthat loads all skills viacrate::brain::skills::load_all_skills()and formats each as- skill_name: description, appending an## Available Skillsblock to bothbuild_core_brain()andbuild_system_brain(). 2 regression tests. - RSI decorative counters removed (closes #149, PR #150): removed the counter-bumping logic that incremented inline counters in SOUL.md like
phantom_tool_call: 219. These counters were decorative only, nothing read them, and the real canonical source is the SQLite feedback ledger at~/.opencrabs/feedback.db. Counters went stale (ledger showed 302, SOUL.md showed 219) and got wiped by upstream template sync. Replaced with evidence appends (date/session). DB stays the single source of truth. Follow-up commit escaped unescaped double quotes the PR introduced in the prompt string literal and added text regression tests.
v0.3.35 Additions
cycle_numberpersistence:cycle_numbernow persists to~/.opencrabs/rsi/cycle_numberacross TUI restarts. Previously it reset to 0 on every process restart, meaning the brain dedup scan (which fires every 24 cycles) would never trigger if the TUI restarted more frequently than 24 hours. Now the cycle counter survives restarts and the daily dedup scan fires as intended.
v0.3.66 Additions
- Skill candidates from tool sequences: RSI detects recurring tool sequences as skill candidates. When the agent repeatedly calls the same sequence of tools (e.g.
read_file→edit_file→bashwith specific patterns), RSI proposes a skill that encapsulates the workflow. - Slash commands from repeated asks: RSI proposes slash commands from repeated user requests. When users type the same multi-word prompt repeatedly, RSI suggests a
/commandthat captures the pattern. - RSI staleness indicator: Mission Control shows a staleness indicator for RSI cycles, plus a provider-creation fallback when the primary provider is unavailable.
v0.3.75 Additions
- Brain dedup system: a new
/dedupcommand runs an on-demand cross-file brain dedup scan, backed by a post-write scan that fires after brain writes and a weekly cron safety net that catches cross-file duplication. The scanner ignores fenced code and table rows so it only flags real prose duplication. - Inline-keyboard dedup approval: dedup proposals can be approved straight from a Telegram inline keyboard.
- Brain-file hints on tool misses: when a tool call misses or errors (including approval-branch errors), the relevant brain notes surface automatically so the agent can self-correct (#767).
- Wider TOOLS.md load trigger, routing, skill, and cron questions now proactively load TOOLS.md.
v0.3.76 Additions
- RSI /evolve proposal: when a new OpenCrabs release is available, RSI surfaces it as an
/evolveproposal in the Mission Control inbox instead of silently ignoring it. The proposal cites the version delta and links to the release notes. - Config-example tracking: RSI tracks config examples so pricing fixes and new provider entries reach users through template sync.
v0.3.78 Additions
- TOML brain verification: a new
brain_verify.tomldefines post-write verification rules. After any brain file write, the system re-reads the file and checks required anchors (H1 title,**Owns:**header) are still present. If verification fails, the write is flagged. - brain_verify Orient gate:
self_improvenow routes through the epistemic Orient gate before applying changes. The agent must orient (verify current state) before writing, preventing RSI from applying fixes based on stale beliefs about brain file content. - RSI digest totals: the RSI digest now surfaces raw failure totals alongside surfaced opportunities, giving better visibility into what’s actually failing vs what RSI chose to act on.
- Rule size cap: brain file rules are now capped in size. A narrow consolidation path allows merging related rules, preventing unbounded growth from repeated RSI appends.
- Contradiction scope fix: brain_verify contradiction matching is now scoped per-entry instead of whole-file, eliminating false positives where unrelated entries triggered contradiction warnings.
Self-Healing vs Self-Improvement
| Self-Healing | Self-Improvement |
|---|---|
| Fixes runtime errors (config corruption, DB issues) | Fixes behavioral patterns (bad habits, user corrections) |
| Automatic, no analysis needed | Requires feedback analysis first |
| Protects the system from crashing | Makes the agent better over time |
| Immediate | Accumulates across sessions |
RSI Convergence Gates (v0.3.80)
The self-improvement engine now knows when to hold back (#977):
- Pauses on convergence self-reports: when a cycle reports its findings have converged, the RSI agent pauses instead of churning
- Interval backs off on zero-improvement streaks: repeated cycles that improve nothing automatically lengthen the wait before the next cycle
- Findings hashed by stable identity: the same finding keeps the same identity across cycles, so no description churn and no duplicate proposals
- Gated on actionable feedback deltas: cycles only run when there is new actionable feedback to work with
- Session history sealed each cycle with a compaction marker, so every cycle starts from a clean read
- Cycle provider resolved from user config, not registry order
RSI Engine Gate (v0.3.81)
The autonomous RSI engine is gated behind rsi_enabled (#1063). In the TUI nothing changes, but headless daemons default RSI off, an unattended service no longer rewrites its own brain files by default. Opt in explicitly:
[agent]
rsi_enabled = true
Mission Control
Mission Control is a full-screen TUI dashboard that brings RSI activity, inbox proposals, and scheduled jobs into one place. Open it with /mission-control.
The Three Panels
The screen is divided into three panels: a large Inbox on the left, and Activity + Schedule stacked on the right.
Inbox
Pending RSI proposals displayed as cards. Each card shows:
- Tool proposals (orange
toolbadge): new dynamic tools RSI thinks you need, with the shell command template - Command proposals (teal
commandbadge): new slash commands RSI drafted based on usage patterns - Skill proposals: new
SKILL.mdfiles RSI drafted when it detects a repeated multi-step workflow that isn’t covered by an existing skill
Each card shows the proposal name, type badge, description or command template, and how long ago it was proposed.
Apply or reject proposals inline:
a: apply the selected proposal (installs tool/command to config, or creates skill directory)r: reject the selected proposal (archives with optional reason)
Applied and rejected entries are archived daily to ~/.opencrabs/rsi/applied/ and ~/.opencrabs/rsi/rejected/ so the trail is auditable.
A banner on session start shows the count of pending inbox items.
Activity
A chronological feed of the last 100 RSI improvements. Shows what the autonomous engine did, when, and why:
- Brain file modifications (SOUL.md, MEMORY.md, TOOLS.md, etc.)
- Template syncs from upstream
- Hard rule additions
- Feedback analysis summaries
- Violation count updates
Each entry shows the time ago, a summary of the change, and the target file.
Schedule
Your cron job queue with paused/active state. Each job shows:
- Job name
- Cron expression
- Next run time (when active)
pausedlabel (when paused)
See Cron Jobs for full cron documentation.
Cron BLOB Recovery (v0.3.20)
Cron jobs with legacy BLOB-typed prompt rows in the database are now tolerated instead of causing silent failures. The schedule panel resumes showing jobs normally.
Compaction Typing Without Banner (v0.3.22)
The visible compaction banner text has been removed. The schedule panel now uses typing-only indicators during compaction windows (10-60s), keeping the experience clean.
Context Counter Evolution (v0.3.26→v0.3.28)
- v0.3.26: introduced per-provider tokenizer calibration. Uncalibrated providers showed
0/maxuntil first message calibrated the ratio - v0.3.28: calibration system removed entirely. Context counter now uses provider-reported
input_tokensverbatim, showing real-time usage without calibration overhead
Keyboard Navigation
| Key | Action |
|---|---|
Tab / Shift+Tab | Cycle focus between panels (Inbox → Activity → Schedule) |
↑ / ↓ | Move selection within a panel |
Enter | Open detail popup for selected item |
a | Apply selected inbox proposal |
r | Reject selected inbox proposal |
Esc | Close popup or exit Mission Control |
Architecture
Mission Control is split into three module trees:
| Layer | Path | Purpose |
|---|---|---|
| Data services | brain/mission_control/ | Fetches inbox proposals, activity log, schedule items |
| Panel renderers | tui/render/mission_control/ | Draws each panel (inbox, activity, schedule, detail popup) |
| App state + input | tui/app/mission_control/ | Focus management, keystroke handling, actions |
Layout and keystroke contracts are unit-testable without spinning up a full App instance.
Analytics Panel (v0.3.78)
Mission Control gained a full Analytics view with its own database layer, event emitters, and responsive UI.
What It Tracks
Every agent interaction emits analytics events to a dedicated SQLite table:
| Event Category | Examples |
|---|---|
| Phantom detection | Detect/resolve events, false-positive rate |
| Streaming | Recovery count, tool_use per stream |
| Brain verification | Orient gate pass/reject, contradiction hits |
| Model usage | Active model per turn, provider switches |
The Analytics UI
Open the analytics panel from Mission Control. It has:
- Global time filter: Day / Week / Month / All toggle at the top. All cards and tabs respect the selected window.
- Responsive 3-across card grid: summary cards (total events, phantom rate, streaming recoveries, brain verify hits) laid out in a 3-column grid that adapts to terminal width.
- Model status icons: each model row shows a health icon (green/yellow/red) based on recent success rate.
- Tabbed detail panels: Phantom / Model / D-W-M tabs with independent scroll. Each tab shows a ranked breakdown relevant to its category.
Architecture
| Layer | Purpose |
|---|---|
analytics_events DB table | Append-only event store with category, model, timestamp |
| Event emitters | Wired across tool_loop, streaming, brain_verify, and provider paths |
| Query + report layer | Aggregation queries (counts, rates, top-N) with time-window filtering |
| TUI renderer | Card grid + tabbed scroll panels in Mission Control |
Related
- Self-Improvement (RSI): the engine that generates proposals
- Skills System: skills proposed by RSI land in the inbox
- Dynamic Tools: what RSI tool proposals install into
- Custom Commands: what RSI command proposals install into
- Cron Jobs: the schedule panel
Multi-Profile Support
Run multiple isolated OpenCrabs instances from a single installation. Each profile gets its own config, memory, sessions, brain files, skills, cron jobs, and gateway service.
Introduced in v0.2.94.
Why Profiles?
Common use cases:
- Work vs personal: separate API keys, brain files, Telegram bots
- Multiple clients: different persona and config per customer
- Model experimentation: compare different provider setups without clobbering your main config
- Staging vs production: test brain file changes on a staging profile before rolling to your main agent
Creating a Profile
# Create a new profile
opencrabs profile create hermes
# List all profiles
opencrabs profile list
# Show details for a profile
opencrabs profile show hermes
# Delete a profile
opencrabs profile delete hermes
Switching Profiles
There are two ways to use a non-default profile:
# CLI flag (per-session)
opencrabs -p hermes
# Environment variable (persistent)
export OPENCRABS_PROFILE=hermes
opencrabs
The default profile (~/.opencrabs/) works exactly as before: zero breaking changes.
Directory Structure
Each profile gets its own directory under ~/.opencrabs/profiles/<name>/:
~/.opencrabs/
├── config.toml # default profile config
├── memory/ # default profile memory
├── sessions.db # default profile sessions
└── profiles/
├── hermes/
│ ├── config.toml
│ ├── memory/
│ ├── sessions.db
│ ├── logs/
│ └── layout/
└── assistant/
├── config.toml
└── ...
Profile Migration
Copy config and brain files from one profile to another:
# Copy from default to hermes
opencrabs profile migrate --from default --to hermes
# Overwrite existing files in target
opencrabs profile migrate --from default --to hermes --force
Migration copies all .md and .toml files plus the memory/ directory. It excludes the database, sessions, logs, and layout state, so the target profile starts fresh with the source’s personality and configuration, not its history.
Export and Import
Share profiles as portable archives:
# Export a profile as .tar.gz
opencrabs profile export hermes
# → creates hermes.tar.gz in current directory
# Import on another machine
opencrabs profile import ./hermes.tar.gz
Token-Lock Isolation
Two profiles cannot bind the same bot token simultaneously. Before connecting a Telegram, Discord, Slack, or Trello channel, OpenCrabs checks for existing token locks using PID-based lock files:
~/.opencrabs/locks/telegram_<token_hash>.lock
If another profile (still running) holds the lock, startup fails with a clear message. Stale locks (process dead) are automatically cleaned up.
This prevents split-brain scenarios where two agents fight over the same bot.
Profile-Aware Daemons
Install a separate OS service per profile:
# Install daemon for the hermes profile
opencrabs -p hermes service install
# Start it
opencrabs -p hermes service start
# macOS: creates com.opencrabs.daemon.hermes.plist
# Linux: creates opencrabs-hermes.service
Multiple profile daemons can run simultaneously as separate OS services, each with its own ports, bot connections, and config.
Per-Session Provider Isolation
Changing the provider in one session does not affect other sessions or profiles. Each session remembers its own provider independently. See Sessions for the full isolation story.
Profile-Aware Paths (v0.3.35)
All internal paths now resolve through opencrabs_home() instead of hardcoded ~/.opencrabs/. This means subagent status directories, tools.toml fallback resolution, and write_opencrabs_file confirmation messages all respect the active profile. No more cross-profile contamination when running multiple instances.
/profiles Command and TUI Dialog (v0.3.55)
The /profiles command works across every channel: TUI, Telegram, Discord, WhatsApp, and Slack.
In the TUI, /profiles opens a native dialog with full keyboard navigation:
- Browse all profiles with active profile highlighted
- Create a new profile inline with name validation
- Delete a profile with confirmation
- Migrate brain files and config from one profile to another
- Switch instantly to another profile
On Discord, WhatsApp, and Slack, /profiles renders a rich profile browser showing all profiles, the active one, and quick switch/delete/create actions.
# From any channel
/profiles
# In the TUI, use j/k to navigate, Enter to select, d to delete, c to create, m to migrate
Voice (TTS & STT)
OpenCrabs supports text-to-speech and speech-to-text with five provider tiers: Off, Groq (API), OpenAI-compatible (any /v1/audio endpoint), Voicebox (self-hosted), or Local (on-device, zero cost).
Quick Setup
Run /onboard:voice in the TUI to configure everything interactively. The voice screen has radio selectors for both STT and TTS, with fields shown/hidden based on the selected provider. API keys are wired to keys.toml automatically.
Speech-to-Text (STT)
Providers
| Provider | Engine | Cost | Latency | Setup |
|---|---|---|---|---|
| Groq | Whisper (whisper-large-v3-turbo) | Per-minute pricing | ~1s | API key in keys.toml |
| OpenAI-compatible | Any Whisper-compatible endpoint | Varies | ~1-3s | stt_base_url + stt_model + API key |
| Voicebox | Self-hosted open-source | Free | ~2-5s | voicebox_stt_enabled=true + voicebox_stt_base_url |
| Local | whisper.cpp (on-device) | Free | ~2-5s | Auto-downloads model |
Local STT Models
| Model | Size | Quality | Speed |
|---|---|---|---|
local-tiny | ~75 MB | Good for short messages | Fastest |
local-base | ~142 MB | Better accuracy | Fast |
local-small | ~466 MB | High accuracy | Moderate |
local-medium | ~1.5 GB | Best accuracy | Slower |
Models auto-download from HuggingFace to ~/.local/share/opencrabs/models/whisper/ on first use.
Configuration
# config.toml
[voice]
stt_enabled = true
stt_mode = "local" # "api" or "local"
local_stt_model = "local-tiny" # local-tiny, local-base, local-small, local-medium
For API mode:
# keys.toml
[providers.stt.groq]
api_key = "your-groq-key" # From console.groq.com
Text-to-Speech (TTS)
Providers
| Provider | Engine | Cost | Voices | Setup |
|---|---|---|---|---|
| OpenAI | gpt-4o-mini-tts | Per-character pricing | alloy, echo, fable, onyx, nova, shimmer | API key in keys.toml |
| OpenAI-compatible | Any /v1/audio/speech endpoint | Varies | Varies by server | tts_base_url + tts_model + tts_voice + API key |
| Voicebox | Self-hosted async POST /generate | Free | Configurable profiles | voicebox_tts_enabled=true + voicebox_tts_base_url + voicebox_tts_profile_id |
| Local | Piper or Kokoro-82M (on-device) | Free | 6 + 54 voices | Auto-downloads model |
Local TTS Engines
Two engines ship behind local-tts. Pick one with the engine field in [providers.tts.local]; leaving engine unset keeps Piper, so every existing config keeps its meaning.
Piper is the default. Six English voices, two locales, runs on practically anything:
| Voice | Description |
|---|---|
ryan | US Male (default) |
amy | US Female |
lessac | US Female |
kristin | US Female |
joe | US Male |
cori | UK Female |
Models auto-download from HuggingFace to ~/.local/share/opencrabs/models/piper/. A Python venv is created automatically for the Piper runtime.
Kokoro-82M is the second engine, an 82 million parameter Apache 2.0 model that runs on CPU through ONNX Runtime. It ships 54 voices across nine languages, including Portuguese, Spanish, French, Italian, Hindi and Japanese, where Piper has no coverage at all:
| Language | Voices |
|---|---|
| US English | 20 |
| UK English | 8 |
| Japanese | 5 |
| Mandarin | 8 |
| Spanish | 3 |
| French | 1 |
| Hindi | 4 |
| Italian | 2 |
| Brazilian Portuguese | 3 |
Kokoro gets its own Python venv (kokoro-onnx + soundfile, no system espeak-ng needed: the espeakng-loader wheel carries the data) and its own model directory under models/kokoro/, so an existing Piper install is not touched. Downloads are the quantised model kokoro-v1.0.int8.onnx (114 MB) plus the shared voices file voices-v1.0.bin (28 MB), about 142 MB total. Audio comes out at 24 kHz and goes through the same resample and OGG/Opus encode path as Piper. Chinese voices are not in the first cut: they need a separate model file and vocabulary.
Configuration
# config.toml
[voice]
tts_enabled = true
tts_mode = "local" # "api" or "local"
local_tts_engine = "kokoro" # "piper" (default) or "kokoro"
local_tts_voice = "af_heart" # Piper: ryan, amy, lessac, kristin, joe, cori. Kokoro: see the picker
For API mode:
# config.toml
[voice]
tts_mode = "api"
tts_voice = "echo" # OpenAI voice name
tts_model = "gpt-4o-mini-tts" # OpenAI model
# keys.toml
[providers.tts.openai]
api_key = "your-openai-key"
Full Configuration Reference
# config.toml
[voice]
# Speech-to-Text
stt_enabled = true
stt_mode = "groq" # "groq", "openai_compatible", "voicebox", "local"
local_stt_model = "local-tiny" # local-tiny, local-base, local-small, local-medium
stt_base_url = "https://..." # OpenAI-compatible STT endpoint
stt_model = "whisper-1" # OpenAI-compatible STT model
voicebox_stt_enabled = false
voicebox_stt_base_url = "https://..."
# Text-to-Speech
tts_enabled = true
tts_mode = "openai" # "openai", "openai_compatible", "voicebox", "local"
tts_voice = "echo" # OpenAI TTS voice name
tts_model = "gpt-4o-mini-tts" # OpenAI TTS model
local_tts_engine = "kokoro" # "piper" (default) or "kokoro"
local_tts_voice = "af_heart" # Local mode: Piper voice, or a Kokoro voice when engine is kokoro
tts_base_url = "https://..." # OpenAI-compatible TTS endpoint
tts_model = "tts-1" # OpenAI-compatible TTS model
voicebox_tts_enabled = false
voicebox_tts_base_url = "https://..."
voicebox_tts_profile_id = "profile-id"
# keys.toml
[providers.stt.groq]
api_key = "your-groq-key"
[providers.stt.openai_compatible]
api_key = "your-api-key"
[providers.tts.openai]
api_key = "your-openai-key"
[providers.tts.openai_compatible]
api_key = "your-api-key"
OpenAI TTS Onboarding (v0.3.78)
The onboarding wizard (/onboard:voice) now includes a dedicated OpenAI TTS voice selector and API key field. When you select OpenAI as your TTS provider during onboarding:
- A voice picker appears with all available OpenAI voices (alloy, echo, fable, onyx, nova, shimmer)
- An API key field is shown if no key is configured yet
- Selection is saved to
config.toml(tts_voice) andkeys.toml(API key) automatically
This removes the need to manually edit config files for the most common TTS setup path.
How Voice Messages Work
When a voice message arrives on Telegram, WhatsApp, Discord, or Slack:
- Audio is decoded (OGG/Opus or WAV)
- Transcribed via STT (local whisper.cpp or Groq API)
- Agent processes the text and generates a response
- Response is converted to speech via TTS (local Piper/Kokoro or OpenAI API)
- Audio is encoded as OGG/Opus and sent back as a voice message
Local mode handles everything on-device: no API calls, no cost, no data leaves your machine.
Hardware Requirements
| Feature | CPU Requirement | Notes |
|---|---|---|
| Local STT (rwhisper) | AVX2 (Haswell 2013+) | Metal GPU on macOS Apple Silicon |
| Local TTS (Piper) | No restrictions | Tested on 2007 iMac: works on any x86/ARM |
| Local TTS (Kokoro-82M) | ONNX Runtime (CPU) | Python 3.10 to 3.13 with venv; same probe Piper already uses |
| Local embeddings | AVX (Sandy Bridge 2011+) | Falls back to FTS-only search |
OpenCrabs detects CPU capabilities at runtime and hides unavailable options in the onboarding wizard. Local TTS (Piper) has no CPU limitations and should work on virtually any machine.
Building Without Voice
Voice features are enabled by default. To build without them (smaller binary):
cargo build --release --no-default-features --features telegram,whatsapp,discord,slack,trello
Feature flags: local-stt (whisper.cpp), local-tts (Piper, Kokoro-82M).
Voice Dialog Key Handling (v0.3.81)
The voice settings dialog no longer hides stored API keys behind placeholder text or overwrites them when you save unrelated changes (#1039). What is in keys.toml stays there unless you explicitly replace it.
Skills System
Skills are reusable workflow templates that extend OpenCrabs with specialized capabilities. They work across Claude Code, Anthropic managed agents, and OpenClaw using a shared SKILL.md format.
How Skills Work
Each skill lives in its own directory under ~/.opencrabs/skills/:
~/.opencrabs/skills/
├── security-audit/
│ └── SKILL.md
├── cost-estimate/
│ └── SKILL.md
└── my-custom-skill/
└── SKILL.md
Skill Format
Every skill is a markdown file with YAML frontmatter:
---
name: security-audit
description: Language-agnostic security & CVE audit for any codebase
---
# Security Audit
You are a senior security engineer performing a comprehensive
security audit of the codebase in the current working directory...
### Path-Triggered Skills: `globs` (v0.5.1)
A skill can claim file patterns the way editor rule files do, via an opt-in `globs:`
frontmatter field: a comma string, an inline flow list, or a block list:
```markdown
---
name: rust-style
description: Project conventions for Rust edits
globs: ["src/**/*.rs", "build.rs"]
---
When the agent is about to touch a matching path without that skill loaded in the current
context, the tool call is rejected once, carrying the full skill body in the rejection. The
identical retry then passes: the model has now read the rules. A registry of seen skills
(track of loads, epoch-tracked) re-arms the gate after context compaction, and the master
switch is [agent] skill_glob_gate (default: on). The effect: conventions attached to a path
are impossible to edit against by omission.
Stage 1: Project detection
…
The `name` and `description` fields in the frontmatter are required. The markdown body becomes the prompt that gets injected when the skill runs.
## Built-in vs User Skills
Skills come from two sources:
- **Built-in** (orange badge): ship with the OpenCrabs binary via `include_str!`. Always available.
- **User** (teal badge): created by you in `~/.opencrabs/skills/<name>/SKILL.md`. Override built-ins by file presence.
## Built-in Skills
| Skill | Description |
|-------|-------------|
| `opencli` | Reference for all 25+ opencli-rs dynamic tools (news, social, search, web). Use when user asks about trending topics, news, social media, jobs, or web search. |
| `browser-cdp` | Native CDP browser automation reference. Headless/headed Chrome control, screenshots, JS evaluation. |
| `a2a-gateway` | Agent-to-Agent (A2A) protocol gateway reference. JSON-RPC 2.0 peer-to-peer agent communication. |
| `dynamic-tools` | Runtime tool management with tool_manage and tools.toml format. Create, enable, disable, reload tools without restart. |
| `security-audit` | Language-agnostic security & CVE audit. Detects project type from manifests, runs the appropriate scanner, reviews the diff for injection / auth / crypto / deserialization / path-traversal patterns, and scores 0-100. |
| `cost-estimate` | Codebase cost-to-build estimate, AI-assisted ROI breakdown, and fair-market valuation. |
| `repo-audit` | Language-agnostic repository health checks. 5-phase pipeline: language detection, native tool execution, git metrics, AST analysis, scoring + recommendations. Covers Rust, JS/TS, Python, Go. (v0.3.18) |
## Running Skills
### Skills Picker (`/skills`)
Type `/skills` to open the full-screen filterable picker. The top shows a filter bar with the total skill count. The main area lists all skills, each showing:
- **Skill name** as a slash command (e.g. `/security-audit`)
- **Type badge**: orange `built-in` or teal `user`
- **Description** of what the skill does
- **Keywords** for search matching in parentheses
| Key | Action |
|-----|--------|
| `Tab` / `↑↓` | Navigate the skill list |
| `Enter` | Run the selected skill |
| `Esc` | Close the picker |
| Type | Filter skills by name and description (case-insensitive) |
When the filter narrows to a single match, Enter fires it immediately.
### Slash Commands
Type any skill name directly as a slash command:
/security-audit
### Channels
Skills auto-register as slash commands across all connected channels (Telegram, Discord, Slack, WhatsApp). No `commands.toml` entry needed. Just type `/<skill-name>` in any channel to run it.
## Creating Custom Skills
1. Create a directory under `~/.opencrabs/skills/`:
```bash
mkdir -p ~/.opencrabs/skills/my-skill
- Create
SKILL.mdwith frontmatter and prompt:
---
name: my-skill
description: What this skill does
keywords: [my-skill, custom, example]
---
# My Skill
Instructions for the agent when this skill runs...
- The skill immediately appears in
/skills(with auserbadge) and as/my-skillin TUI and all channels.
Cross-Harness Compatibility
The SKILL.md format works identically on:
- OpenCrabs: native support via
/skillspicker and slash commands - Claude Code: drop the same
SKILL.mdfile into Claude Code’s skills directory - Anthropic managed agents: compatible with managed agent skill loading
- OpenClaw: works with OpenClaw’s skill system
Write a skill once, use it everywhere.
RSI-Proposed Skills
The RSI engine can propose new skills based on usage patterns it observes in the feedback ledger. For example, if the agent repeatedly performs a multi-step workflow that isn’t covered by an existing skill, RSI will draft a skill and file it in the Mission Control inbox for your review.
This is part of the RSI Proposals system: RSI identifies gaps in the agent’s capabilities and drafts solutions, but installation always requires your approval.
Slash Command Resolution (v0.3.78)
The slash_command tool now correctly resolves skills and the /onboard:<topic> form. Previously, calling a skill via slash_command could fail if the skill name didn’t exactly match the internal registry key. The resolver now checks skills, built-in commands, and user commands in priority order, and the /onboard:voice / /onboard:provider / /onboard:channels sub-topic forms route correctly.
Themes
The TUI is colored by semantic roles, not raw hexes. Every render site resolves a role
(accent, text_primary, selection_bg, …) through the active theme, so one switch restyles
the whole interface at runtime. A theme is one file, 43 keys, done.
Switching themes
| Command | What it does |
|---|---|
/theme | Opens the interactive picker: ↑/↓ (or j/k) move the cursor and preview live, the whole UI recolors under the arrow keys. Enter applies and persists, Esc (or q) cancels and reverts to whatever was active when the picker opened. |
/theme list | Lists built-in themes and user presets, then re-scans ~/.opencrabs/themes/. Files that fail validation are listed with a human-readable rejection reason, never silently ignored. |
/theme set <name> | Applies a theme immediately and writes it to your config. Lookup is case-insensitive across built-ins and user presets; an unknown name tells you to run /theme list. |
/theme reset | Returns to the default (crab-dark) and clears the config key. |
To pin a theme without the picker, set it in config.toml:
[tui]
theme = "nord"
The value is applied at boot before the first frame. An empty or unknown name falls back to
crab-dark. User theme files are re-scanned on every /theme invocation, so editing a preset
file hot-loads it without restarting the TUI.
The window’s themes (v0.6.0)
The desktop app has its own theme set, because a 43-role terminal palette is not what a window wants. ctrl+shift+t opens the theme card, which shows four palettes as miniature windows carrying the palette they would paint, so a card is legible before you pick it.
| Theme | What it is |
|---|---|
orgn | The window’s own dark palette |
light | Soft paper, easy on the eyes |
custom | Your base and your accent, with surfaces, borders and every text tone derived from them |
auto | Follows the system appearance, and keeps following it while the app runs |
auto is the default, and it is the only one that reads the system: orgn and light ignore the appearance, so switching the OS between light and dark does not repaint them.
custom takes two values. custom_accent is the accent the interface paints, and base is the background it draws on. Everything else is derived from base, so one value moves the whole window instead of a list of overrides you have to keep in step.
[gui]
theme = "custom"
custom_accent = "#C96A2B"
base = "#101418"
transparency = 20
The font row
The theme card carries a Font row listing the families the machine actually has installed, and a Mono row for code blocks. A saved mono family that is no longer installed falls back to the first installed candidate rather than rendering a code block in a proportional face, because column alignment is the whole point of a code block.
Transparency
transparency is a percentage from 0 to 40, and 0 is opaque. The window clamps anything higher to 40 before painting, because past that the text stops being legible against whatever is behind the window. The desktop also tells the compositor the window is translucent, so the effect is a real fade rather than a flat grey blend.
Built-in themes
There are 39 built-in themes: 8 hand-tuned presets plus a curated pack of 31 converted
from popular upstream palettes (see Imported themes). crab-dark is the
default and matches the historical OpenCrabs look.
| Preset | Vibe |
|---|---|
crab-dark | The house palette: burnt-orange accent, cool grays, deep ink |
dracula | The classic purple-blue dark theme with orange accent |
alucard | Warm dark, muted contrast (Castlevania’s good-boy Dracula) |
monokai | Sublime’s iconic warm dark with pink/yellow |
catppuccin-mocha | Pastel dark, soft and low-contrast |
catppuccin-latte | The same pastels on light surfaces |
solarized-light | Ethan Schoonlif’s light base |
solarized-dark | The original dark base |
The curated pack adds: aura, ayu, carbonfox, catppuccin-frappe, catppuccin-macchiato,
cobalt2, cursor, everforest, flexoki, github, gruvbox, gruvbox-light, kanagawa,
material, matrix, mercury, nightowl, nord, one-dark, opencode, orng,
osaka-jade, palenight, rosepine, rosepine-dawn, synthwave84, tokyonight,
tokyonight-storm, vercel, vesper, zenburn.
Gallery
Swatches show four anchor roles per theme (accent, body text, success, ink background), read
from the shipped sources. Regenerate with python3 docs/scripts/gen_theme_gallery.py.
| Theme | Type | accent | text | success | ink | Source |
|---|---|---|---|---|---|---|
| crab-dark | default | #d76414 | #c8c8d2 | #50c878 | #14141e | built-in |
| dracula | hand-built | #ffb86c | #f8f8f2 | #50fa7b | #282a36 | built-in |
| alucard | hand-built | #a34d14 | #1f1f1f | #14710a | #1f1f1f | built-in |
| monokai | hand-built | #fd971f | #f8f8f2 | #a6e22e | #272822 | built-in |
| catppuccin-mocha | hand-built | #fab387 | #cdd6f4 | #a6e3a1 | #1e1e2e | built-in |
| catppuccin-latte | hand-built | #fe640b | #4c4f69 | #40a02b | #4c4f69 | built-in |
| solarized-light | hand-built | #cb4b16 | #657b83 | #859900 | #073642 | built-in |
| solarized-dark | hand-built | #cb4b16 | #839496 | #859900 | #002b36 | built-in |
| aura | curated pack | #a277ff | #edecee | #61ffca | #0f0f0f | opencode, dark, 2026-09-11 |
| ayu | curated pack | #e6b450 | #bfbdb6 | #7fd962 | #0b0e14 | opencode, dark, 2026-09-11 |
| carbonfox | curated pack | #ff7eb6 | #f2f4f8 | #25be6a | #161616 | opencode, dark, 2026-09-11 |
| catppuccin-macchiato | curated pack | #f5bde6 | #cad3f5 | #a6da95 | #24273a | opencode, dark, 2026-09-11 |
| cobalt2 | curated pack | #2affdf | #ffffff | #9eff80 | #193549 | opencode, dark, 2026-09-11 |
| cursor | curated pack | #88c0d0 | #e4e4e4 | #3fa266 | #181818 | opencode, dark, 2026-09-11 |
| everforest | curated pack | #d699b6 | #d3c6aa | #a7c080 | #2d353b | opencode, dark, 2026-09-11 |
| flexoki | curated pack | #8b7ec8 | #cecdc3 | #879a39 | #100f0f | opencode, dark, 2026-09-11 |
| github | curated pack | #39c5cf | #c9d1d9 | #3fb950 | #0d1117 | opencode, dark, 2026-09-11 |
| gruvbox | curated pack | #8ec07c | #ebdbb2 | #b8bb26 | #282828 | opencode, dark, 2026-09-11 |
| kanagawa | curated pack | #d27e99 | #dcd7ba | #98bb6c | #1f1f28 | opencode, dark, 2026-09-11 |
| material | curated pack | #89ddff | #eeffff | #c3e88d | #263238 | opencode, dark, 2026-09-11 |
| matrix | curated pack | #c770ff | #62ff94 | #62ff94 | #0a0e0a | opencode, dark, 2026-09-11 |
| mercury | curated pack | #8da4f5 | #dddde5 | #77c599 | #171721 | opencode, dark, 2026-09-11 |
| nightowl | curated pack | #c792ea | #d6deeb | #c5e478 | #011627 | opencode, dark, 2026-09-11 |
| nord | curated pack | #8fbcbb | #eceff4 | #a3be8c | #2e3440 | opencode, dark, 2026-09-11 |
| one-dark | curated pack | #56b6c2 | #abb2bf | #98c379 | #282c34 | opencode, dark, 2026-09-11 |
| opencode | curated pack | #9d7cd8 | #eeeeee | #7fd88f | #0a0a0a | opencode, dark, 2026-09-11 |
| orng | curated pack | #fff7f1 | #eeeeee | #6ba1e6 | #0a0a0a | opencode, dark, 2026-09-11 |
| osaka-jade | curated pack | #549e6a | #c1c497 | #549e6a | #111c18 | opencode, dark, 2026-09-11 |
| palenight | curated pack | #89ddff | #a6accd | #c3e88d | #292d3e | opencode, dark, 2026-09-11 |
| rosepine | curated pack | #ebbcba | #e0def4 | #31748f | #191724 | opencode, dark, 2026-09-11 |
| synthwave84 | curated pack | #b084eb | #ffffff | #72f1b8 | #262335 | opencode, dark, 2026-09-11 |
| tokyonight | curated pack | #ff966c | #c8d3f5 | #c3e88d | #1a1b26 | opencode, dark, 2026-09-11 |
| vercel | curated pack | #8e4ec6 | #ededed | #46a758 | #000000 | opencode, dark, 2026-09-11 |
| vesper | curated pack | #ffc799 | #ffffff | #99ffe4 | #101010 | opencode, dark, 2026-09-11 |
| zenburn | curated pack | #93e0e3 | #dcdccc | #7f9f7f | #3f3f3f | opencode, dark, 2026-09-11 |
| catppuccin-frappe | curated pack | #e5c890 | #c6d0f5 | #a6d189 | #303446 | alacritty-theme, 2026-09-11 |
| gruvbox-light | curated pack | #b57614 | #3c3836 | #98971a | #fbf1c7 | alacritty-theme, 2026-09-11 |
| rosepine-dawn | curated pack | #d38d2f | #575279 | #286983 | #faf4ed | alacritty-theme, 2026-09-11 |
| tokyonight-storm | curated pack | #ff9e64 | #a9b1d6 | #9ece6a | #24283b | alacritty-theme, 2026-09-11 |
The 43 roles
A user theme is a flat TOML file mapping every role to a #RRGGBB hex. Role names double as
the TOML keys. What each one colors:
| Group | Key | Colors |
|---|---|---|
| Accents | accent | Primary emphasis: prompts, active states, the crab orange |
accent_teal | Primary action / selected accent | |
accent_soft | Passive, informational accent (soft white) | |
| Text | text_primary | Body text |
text_secondary | Secondary text | |
text_muted | Muted labels | |
text_dim | Deepest text tier | |
| Chrome grays | gray | Borders, passive labels, info lines (the workhorse) |
gray_mid | Secondary borders, quiet panel text | |
gray_detail | Detail rows under primary rows (tool list) | |
gray_dim | Inactive borders (unfocused input frame) | |
gray_dark | Deeper inactive chrome | |
gray_base | Darkest neutral foreground (plan-widget borders) | |
gray_light | Bright neutral text | |
gray_soft | Soft label text | |
gray_muted | Muted body text (plan widget) | |
| Positive | success | “ok” states, active pane borders |
analytics_green | Mission-control bars and values | |
green_check | Checked-markdown checkboxes | |
| Negative | error | Primary failures |
error_soft | Error titles | |
error_faded | Error bodies | |
| Warning | warning | Amber input hints |
warning_muted | Muted amber | |
amber_muted | Proposed-skill inbox badges | |
| Teal tiers | teal_vivid | Selection/active in input + tools |
teal_bright | Dialogs | |
teal_muted | Completed/skipped plan tasks | |
teal_calm | Plan progress bars | |
| Blue tiers | blue_slate | Help text, input placeholders |
blue_steel | Informational accents (sessions, files, projects) | |
blue_link | Markdown links | |
blue_sky | Projects | |
blue_soft | Chat accents | |
blue_vivid | Onboarding voice brand accent | |
blue_code | Inline code (markdown) | |
| Surfaces | selection_bg | Selected text in the composer |
surface_panel | Mission-control panel background | |
surface_qr | QR panel background (onboarding) | |
surface_code | Code-block background | |
surface_code_alt | Code-block background, alternate shade | |
| Ink | ink | The main background canvas |
| Misc | purple_soft | Proposed-brain-dedup inbox badges |
Decorative animation cycles (like the rotating project badge colors) are deliberately not roles: they stay preset-agnostic.
Writing your own theme
Drop a file at ~/.opencrabs/themes/<name>.toml. The file stem is the theme name. All 43
keys are required; here is a complete valid theme (nord, from the curated pack):
accent = "#8fbcbb"
accent_teal = "#8fbcbb"
accent_soft = "#eceff4"
text_primary = "#eceff4"
text_secondary = "#8b95a7"
text_muted = "#767b84"
text_dim = "#9ca0a8"
gray = "#434c5e"
gray_mid = "#9ca0a8"
gray_detail = "#91959e"
gray_dim = "#7e838c"
gray_dark = "#6b707a"
gray_base = "#434c5e"
gray_light = "#d0d3d9"
gray_soft = "#afb3ba"
gray_muted = "#8d929a"
success = "#a3be8c"
analytics_green = "#a3be8c"
green_check = "#a3be8c"
error = "#bf616a"
error_soft = "#bf616a"
error_faded = "#6f4853"
warning = "#d08770"
warning_muted = "#9f6e62"
amber_muted = "#87625a"
teal_vivid = "#8fbcbb"
teal_bright = "#8fbcbb"
teal_muted = "#6d8c90"
teal_calm = "#5a7177"
blue_slate = "#698f9e"
blue_steel = "#88c0d0"
blue_link = "#81a1c1"
blue_sky = "#88c0d0"
blue_soft = "#648896"
blue_vivid = "#88c0d0"
blue_code = "#88c0d0"
selection_bg = "#505660"
surface_panel = "#3b4252"
surface_qr = "#343a45"
surface_code = "#434c5e"
surface_code_alt = "#494e59"
ink = "#2e3440"
purple_soft = "#81a1c1"
Validation rules
Validation is loud, never silent. A theme file is rejected, with the reason shown by
/theme list, when it:
- misses any of the 43 roles: the error names the missing key;
- carries an unknown key: strict typo guard, there is no partial-schema mode;
- uses a malformed value: only
#RRGGBBorRRGGBB, case-insensitive; - fails the contrast floor (eight reading-critical (foreground, background) pairs must
hit 2.5:1 WCAG contrast:
text_primary/text_secondary/accent/success/error/warningonink,blue_codeonsurface_code, andgray_midonsurface_panel. Deliberately dim tiers (text_muted,text_dim, …) are excluded) dim is their job; - collides with a built-in name: user files can never shadow a shipped preset.
Everything else is free for the runtime: each valid theme gets its ANSI-256 fallback tier derived automatically, so terminals without truecolor still render it (nearest index in the 6×6×6 cube, grayscale ramp for neutrals).
Theme enforcement (v0.5.3)
Every widget in the TUI now resolves its colours through the theme engine, the last hardcoded ANSI sites are gone, and a suite-level guard fails the build if a new raw ANSI colour site appears (#1634). Themes can also declare an optional canvas background (the source background carries through catalog conversion), so a theme can restyle the whole terminal canvas, not just the widgets on it.
Imported themes
The 31-theme curated pack was generated by the in-tree converter (tui::theme_catalog) from
two upstream formats:
- alacritty-theme TOML (
[colors.primary]background/foreground plus the 16 ANSI colors): thealacritty/alacritty-themecatalog, 176 themes; - opencode theme JSON (
defs+themetoken maps with dark/light variants, hex strings, ANSI integers,defsreferences and"none"), thesst/opencodebuilt-in themes, 33 assets.
Both convert through a fixed 43-role mapping (semantic token first, ANSI color or
deterministic bg/fg mix as fallback), and every generated file is pre-certified by the same
validator user themes face: a converted file that doesn’t validate never ships. Each pack
file carries a # source: provenance header naming the upstream repo, file, and fetch date;
the gallery table shows it. Upstream palettes belong to their authors; the pack imports their
colors, not their names’ goodwill.
The converter is generation-time tooling: the TUI itself only knows the embedded presets and your drop-in files.
Usage Dashboard
The Usage Dashboard shows your token usage, costs, models, tools, and project breakdown. Open it with /usage.
Overview
The header shows your totals:
| Metric | Description |
|---|---|
| Tokens | Total tokens consumed (in millions) |
| Cost | Total spend in USD |
| Sessions | Number of sessions |
| Calls | Total API calls made |
The Four Panels
The dashboard is a 2x2 grid of panels:
Daily Activity (top-left)
A horizontal bar chart showing token usage per day. Peak days stand out clearly. Useful for spotting burst activity or debugging unexpected spikes.
By Project (top-right)
A ranked table of projects by cost:
| Column | Description |
|---|---|
| Project | Working directory name |
$ | Total cost |
M | Tokens in millions |
s | Total session time |
By Model (bottom-left)
A ranked table of every model used:
| Column | Description |
|---|---|
| Model | Provider + model name |
$ | Total cost |
M | Tokens in millions |
C | Number of API calls |
The selected row is highlighted in orange. Use this to spot expensive models or optimize your provider mix.
By-Model Quantization Tree View (v0.3.20)
Model variants grouped under parent rows with tree connectors:
| Column | Description |
|---|---|
| Model | Provider + model name (parent row, bold) |
├─ / └─ | Variant rows (e.g. qwen3.6-35b-a3b-gguf-oq2, qwen3.6-35b-a3b-gguf-oq4) |
Parent rows show aggregated stats (total tokens, cost, calls) across all quant variants. This eliminates the noisy duplication where qwen3.6-35b-a3b-gguf, -oq2, -oq4, -iq4_xs each appeared as separate rows.
Before: 6 separate rows for one model family After: 1 parent row + 3 variant rows with aggregated parent stats
Core Tools (bottom-right)
A horizontal bar chart ranking your most-used tools. bash and read_file typically dominate. Useful for understanding your agent’s workflow patterns.
By Activity (footer)
A summary table showing cost and turns by activity category (Development, CI/Deploy, Features), plus the 1-shot success rate for each.
Cache Efficiency Card (v0.3.36)
A new card on the dashboard shows your cache hit rate as a percentage. Providers that support prompt caching (like Anthropic and Z.AI) return cache_creation_input_tokens and cache_read_input_tokens in their usage data. These are now persisted to the messages table (DB migration #25), and the dashboard aggregates them into a hit-rate percentage.
When cache data is unavailable (provider doesn’t report it, or no cached tokens yet), the card degrades gracefully with a dash instead of showing 0%.
Time Filters
| Key | Filter |
|---|---|
T | Today |
W | This week |
M | This month |
A | All time |
Esc | Close dashboard |
Provider and Model Breakdown (v0.3.63)
The /usage command now shows per-provider and per-model cost breakdowns with period filters. This helps identify which providers or models are driving costs and optimize your usage accordingly.
Use the time filters (T/W/M/A) to scope the breakdown to specific periods. The By Model panel already shows provider + model name, but the new breakdown provides aggregated views for quick cost analysis.
Per-Model Cache Breakdown (v0.3.76)
The /usage command on Telegram now shows a per-model cache breakdown: for each model that supports prompt caching, you see cache creation tokens, cache read tokens, and the resulting hit rate. This makes it easy to spot which models benefit most from caching and whether your cache strategy is working.
Pricing Updates (v0.3.76)
- Claude Opus 5 pricing added to the cost calculator
- qwen3.8-max-preview pricing added
- Cost attribution fix: costs are now attributed to the provider that actually served the request, not the originally-requested provider (matters when fallback fires mid-turn)
- Provider-reported costs (v0.5.4): the ledger prefers the cost the provider actually reported in its usage payload over the calculator estimate (#1707)
Navigation
| Key | Action |
|---|---|
Tab | Cycle focus between panels |
Enter | Open details for selected item |
Esc | Close dashboard |
RTK: Rust Token Killer
RTK is natively bundled into OpenCrabs as a built-in feature. It intercepts bash commands before they run, filters and compresses their output, and returns a token-optimized version to the LLM context. The result: 60-90% token savings on common development commands, which directly translates to lower API costs and faster responses.
What It Does
When OpenCrabs runs a bash command like git status or cargo build, RTK:
- Intercepts the command before execution
- Runs it through RTK’s filtering engine
- Compresses verbose output (removes noise, keeps signal)
- Returns the optimized output to the agent
The agent sees the same information, but using a fraction of the tokens.
Real-World Impact
From production usage (13,600+ commands executed):
| Metric | Value |
|---|---|
| Total Commands | 13,600+ |
| Input Tokens | 245M |
| Output Tokens | 35M |
| Tokens Saved | 209M |
| Savings Rate | 85.6% |
| Total Exec Time | 40h 50m (avg 10.8s per command) |
Top Commands by Savings
| Command | Count | Tokens Saved | Avg Savings |
|---|---|---|---|
rtk grep | 1,920 | 175M | 16.3% |
rtk find | 1,670 | 24M | 71.1% |
rtk cargo test --all-... | 90 | 5.4M | 99.8% |
rtk cargo test | 40 | 2.1M | 100.0% |
rtk:toml ps aux | 30 | 1.2M | 97.9% |
Supported Commands
RTK supports 40+ common development and sysadmin commands:
Version Control
git,gh(GitHub CLI),glab(GitLab CLI)
Package Managers
npm,npx,pnpm,cargo,dotnet
Build & Test
jest,vitest,tsc,next,prisma,prettier,eslint,playwright
Cloud & Infrastructure
aws,docker,kubectl,psql
System Inspection (Sysadmin)
ps,top,lsof,netstat,ss,journalctl,dmesg,dig,nslookup,host,traceroute
File Operations
grep,find,ls,tree,diff,curl,wget
Blocked Commands
RTK never rewrites these (too interactive, security-sensitive, or already RTK meta-commands):
sudo, ssh, scp, sftp, rsync, vim, vi, nvim, nano, emacs, less, more, man, python, python3, node, mysql, redis-cli, psql
How It Works
Command Rewriting
When the agent runs git status, OpenCrabs automatically rewrites it to rtk git status. RTK then:
- Executes
git statusinternally - Parses the output structure
- Applies command-specific filters (e.g., for
git diff: show file names and change stats, not full diffs) - Returns the compressed output
Smart Filtering
RTK uses different strategies per command:
- Git commands: Show file-level summaries, not full diffs
- Cargo build/test: Show errors and warnings, skip successful compilations
- System commands (
ps,top): Use TOML filter templates to extract key metrics - File searches (
grep,find): Limit output length, show context only when relevant
/rtk Command
In the TUI, type /rtk to see your token savings dashboard:
═══ RTK Token Savings Report ═══
Total Commands: 13,600+
Total Tokens Saved: 209M
Average Savings: 85.6%
Tracking Since: 2026-05-15 10:30:00 UTC
Savings by Command Type:
grep: 1,920 cmds, 175M tokens saved, 16.3% avg
find: 1,670 cmds, 24M tokens saved, 71.1% avg
cargo: 130 cmds, 7.5M tokens saved, 99.9% avg
...
Installation
RTK is enabled by default in all OpenCrabs builds. No setup required.
If you’re building from source and want to disable it:
cargo build --no-default-features --features telegram,whatsapp,discord,slack,trello,local-stt,local-tts,browser
To verify RTK is active:
# In the TUI, type:
/rtk
# Or check if the binary is available:
which rtk
Why It Matters
LLM API costs are based on token count. A typical git diff on a large repo can produce 50,000+ tokens of output. With RTK, that same diff might use only 5,000 tokens, a 90% reduction.
Over a day of heavy development work:
- Without RTK: ~250M tokens consumed by command outputs
- With RTK: ~35M tokens consumed
- Savings: ~215M tokens per day
At typical API pricing ($3-15 per 1M input tokens), that’s $600-3,000+ saved per day in token costs alone.
Learn More
- RTK source: github.com/rtk-ai/rtk
- RTK is developed by fast-rlm and integrated natively into OpenCrabs
Autonomous Goal Loop (/goal)
The /goal command lets you set a high-level goal and have OpenCrabs work toward it autonomously, executing actions, self-evaluating with an LLM judge, and continuing until the goal is satisfied or a turn budget runs out.
How It Works
- Set a goal:
/goal <description of what you want> - The agent loops: executes an action, then an LLM judge evaluates whether the goal is met
- Self-correction: if the goal isn’t satisfied, the agent continues with a correction prompt
- Completion: the loop ends when the judge says the goal is met, or the turn budget (default 20 turns) is exhausted
This is fully hands-off. Set the goal, walk away, come back to results.
Usage
/goal <text> (Set a new goal and start the autonomous loop
/goal status) Check current goal progress
/goal pause (Pause the autonomous loop
/goal resume) Resume a paused goal
/goal clear: Remove the current goal
Examples
/goal Fix all failing tests in the auth module and make sure clippy passes
/goal Research the top 5 Rust web frameworks and write a comparison in research/frameworks.md
/goal Set up a CI pipeline with GitHub Actions for this project
/goal Refactor the database layer to use connection pooling
/goal Find and fix all TODO comments in src/handlers/
Turn Budget
The default turn budget is 20 autonomous turns. Each turn is one full LLM round-trip (action + evaluation). The agent uses a lightweight LLM judge to evaluate progress, keeping costs low.
If the budget runs out before the goal is satisfied, the agent reports what it accomplished and what remains.
Best Practices
- Be specific: “Fix the login bug” works better than “make the app better”
- Set boundaries: mention files, modules, or constraints in the goal
- Use for multi-step tasks:
/goalshines on tasks that need repeated execution and self-correction - Check status: use
/goal statusto monitor progress on long-running goals - Pause when needed:
/goal pauseif you need the agent for something else
Self-Goaling (v0.3.61)
The agent can also set and drive its own multi-turn goals autonomously via the goal_manage tool. This lets the agent break down a complex request into self-directed goal loops without the user needing to invoke /goal manually. The agent evaluates its own progress and adjusts course, the same way a user-set /goal loop works.
Availability
/goal works across all channels: TUI, Telegram, Discord, Slack, and WhatsApp. Set autonomous goals from wherever you talk to your agent.
When to Use /goal vs /btw vs Plans
| Feature | Use Case |
|---|---|
/goal | Autonomous loop for a single clear objective. Agent self-evaluates until done. |
/btw | Spawn a parallel side task while you keep chatting. |
| Plans | Multi-step structured work with explicit tasks, dependencies, and acceptance criteria. |
/goal is best when you have a clear outcome and want the agent to figure out the steps itself.
Companion Tools
OpenCrabs works with companion tools that extend its capabilities.
WhisperCrabs: Voice-to-Text
WhisperCrabs is a floating voice-to-text tool. Click to record, click to stop, transcribes, copies to clipboard.
- Local (whisper.cpp, on-device) or API transcription
- Fully controllable via D-Bus: start/stop recording, switch providers, view history
- Works as an OpenCrabs tool: use D-Bus to control WhisperCrabs from the agent
Installation
git clone https://github.com/adolfousier/whispercrabs.git
cd whispercrabs
cargo build --release
Usage with OpenCrabs
Just ask naturally. OpenCrabs controls WhisperCrabs via D-Bus:
“Start recording” / “Stop and transcribe” / “Switch to Groq Whisper”
SocialCrabs: Social Media Automation
SocialCrabs automates social media via CLI + GraphQL with human-like behavior simulation. Twitter/X, Instagram, LinkedIn. No browser needed for read operations.
Setup
git clone https://github.com/adolfousier/socialcrabs.git
cd socialcrabs && npm install && npm run build
# Add cookies from browser DevTools to .env (auth_token + ct0 for Twitter)
# See SocialCrabs README for per-platform credential setup
node dist/cli.js session login x # Authenticate Twitter/X
node dist/cli.js session login ig # Authenticate Instagram
node dist/cli.js session login linkedin # Authenticate LinkedIn
node dist/cli.js session status # Check all sessions
Usage with OpenCrabs
Just ask naturally. OpenCrabs calls SocialCrabs CLI commands via bash automatically:
“Check my Twitter mentions” / “Search LinkedIn for AI founders” / “Post this to X”
Read operations run automatically. Write operations (tweet, like, follow, comment, DM) always ask for your approval first.
Twitter/X commands
node dist/cli.js x whoami # Check logged-in account
node dist/cli.js x mentions -n 5 # Your mentions
node dist/cli.js x home -n 5 # Your timeline
node dist/cli.js x search "query" -n 10 # Search tweets
node dist/cli.js x read <tweet-url> # Read a specific tweet
node dist/cli.js x tweet "Hello world" # Post a tweet
node dist/cli.js x reply <tweet-url> "text" # Reply to tweet
node dist/cli.js x like <tweet-url> # Like a tweet
node dist/cli.js x follow <username> # Follow a user
Instagram commands
node dist/cli.js ig feed -n 5 # Your feed
node dist/cli.js ig search "query" -n 10 # Search posts
node dist/cli.js ig read <post-url> # Read a specific post
node dist/cli.js ig like <post-url> # Like a post
node dist/cli.js ig comment <post-url> "text" # Comment on post
node dist/cli.js ig follow <username> # Follow a user
LinkedIn commands
node dist/cli.js linkedin feed -n 5 # Your feed
node dist/cli.js linkedin search "query" -n 10 # Search posts
node dist/cli.js linkedin read <post-url> # Read a specific post
node dist/cli.js linkedin like <post-url> # Like a post
node dist/cli.js linkedin comment <post-url> "text" # Comment on post
Web Scraping
OpenCrabs includes a native URL-to-markdown scraping tool (web_scrape) that converts any web page into clean markdown. Zero AI cost, zero API tokens for the extraction itself. The agent uses tool_search to activate it on demand, keeping it out of the always-loaded core tool set.
How It Works
web_scrape follows a five-step pipeline:
- Validate: SSRF guard rejects private IPs, localhost, loopback, link-local addresses, cloud metadata endpoints (169.254.169.254), and non-http(s) schemes
- Fetch:
reqwestwith browser User-Agent and timeout.is_js_shellheuristic detects JS-heavy pages (React/Vue/Angular/Svelte shells,<div id="app">, no<article>). Escalates to browser manager when available - Extract: CSS selector cascade (article, main, .content, etc.) isolates primary content from HTML, falling back to body with junk selectors (header, nav, sidebar, ads) removed
- Clean: Language-agnostic HTML cleaner strips scripts, styles, inline handlers, HTML comments. Decodes entities, collapses blank lines
- Convert:
htmdconverts cleaned HTML to markdown.absolutize_urlsresolves relative src/href against page base URL. Images preserved astags for selective agent vision
Single URL Mode
Scrape a single URL and return the markdown content directly:
web_scrape https://example.com/page
The agent receives the markdown in its context, ready for analysis, summarisation, or extraction.
Sitemap Mode
Discover and crawl an entire site via its sitemap:
web_scrape https://example.com --sitemap
This discovers /sitemap.xml, /sitemap_index.xml, and common variations. Recursively crawls sitemap indexes (iterative worklist, 1000-URL cap, 3 levels deep). Returns the URL list for the agent to pick from.
Each page’s markdown is exported to a directory. The output path resolves to the project files directory if the session is assigned to a project, or the profile-scoped OpenCrabs home otherwise. Files never land outside managed workspace.
Pair it with memory: point [memory] extra_paths at the export directory and every scraped page becomes searchable via memory_search scope="external", a zero-cost knowledge base your agent quotes verbatim. Full walkthrough in Memory System → Build a knowledge base. Note the hard cap: 100 pages per sitemap scrape.
SSRF Protection
The SSRF guard uses url::Host enum classification to properly handle:
| Blocked | Reason |
|---|---|
| Private IPs (10.x, 172.16-31.x, 192.168.x) | Internal network |
| Localhost (127.0.0.1, ::1) | Local services |
| Link-local (169.254.x.x) | Cloud metadata, DHCP |
| Non-http(s) schemes | file://, ftp://, gopher:// |
This runs before any network request, so malicious URLs never reach the fetcher.
JS-Shell Detection
When a page returns mostly empty HTML with JS framework markers (React root, Vue app, Angular bootstrap, Svelte kit), web_scrape detects it as a JS shell and escalates to the browser manager if available. This avoids returning empty markdown for single-page applications that require JavaScript rendering.
Image Handling
Images are preserved as  markdown tags rather than being stripped. This lets the agent decide which images are worth visioning (via analyze_image) and which can be ignored, rather than losing all visual context.
Document Generation
OpenCrabs writes real documents, not just text files. The built-in generate_document tool creates XLSX, DOCX, and PDF natively inside the binary (no Python, no LibreOffice, no font installs), and PPTX through python-pptx when the host has it. On channels the agent sends the finished file back as a downloadable attachment in the same turn.
Supported Formats
| Format | Engine | Content | Styling |
|---|---|---|---|
| XLSX | Native Rust (rust_xlsxwriter) | Multiple sheets, rows of typed cells; any cell starting with = becomes a live Excel formula that recalculates when the user edits the file | Colored header row, zebra striping, frozen header, autofilter dropdowns, colored sheet tabs, per-column number formats (currency, percent, date, integer, or raw Excel codes) |
| DOCX | Native Rust (docx-rs) | Headings (real Word styles, navigation pane works), paragraphs, bullet/numbered lists (real numbering), tables, image blocks (inline PNG/JPEG with optional caption) | Accent-colored headings, page header/footer on every page, shaded table headers, zebra rows |
Native Rust (printpdf + bundled DejaVu Sans) | Same block model as DOCX; A4 flow with word wrap, page breaks, content-sized table columns with header separators and row rules; image blocks (inline PNG/JPEG with aspect-preserving sizing and optional caption); real Unicode text (accents, Cyrillic, arrows, checkmarks) | Brand accent + text colors, H1 underline bar, page header with logo image (local PNG/JPEG), footer with exact Page N of M, zebra tables | |
| PPTX | Host python-pptx (clear install hint when missing) | Slides with title, bullets, speaker notes | Brand template: build slides into an existing .pptx so they inherit the company master (logos, fonts, backgrounds); accent-colored titles; per-slide layout choice |
How It Works
Everything is driven by one structured tool call, so it works with any provider including local models. All styling defaults off; bad colors or a missing logo degrade to the plain look instead of failing the document.
The tool accepts:
- Format (xlsx, docx, pdf, pptx)
- Content blocks (headings, paragraphs, lists, tables, image blocks)
- Style configuration (brand colors, logos, page furniture)
Image Blocks
PDF and DOCX support embedding PNG and JPEG images inline with optional captions. Images are sized to fit the page while preserving aspect ratio.
Page Size and Orientation (v0.3.65)
All three document formats support custom page sizes and orientations:
| Format | Options |
|---|---|
landscape mode, custom page_width and page_height (in points) | |
| DOCX | orientation (portrait or landscape), custom page_width and page_height (in twips) |
| PPTX | slide_width and slide_height (in EMUs), aspect ratio control |
Default sizes: PDF/DOCX use A4 portrait, PPTX uses 16:9 widescreen.
Brand Templates
For PPTX, you can point the tool at an existing .pptx file to inherit the company master (logos, fonts, backgrounds). Each slide gets a layout choice and accent-colored titles.
Delivery
On Telegram, WhatsApp, Discord, and Slack, generated documents are sent as downloadable attachments in the same turn the tool was called. No separate “here’s your file” message needed.
Examples
Ask the agent:
- “Create a PDF report with these sales figures”
- “Generate an Excel spreadsheet with formulas for monthly totals”
- “Make a Word document with this content and our company logo”
- “Build a PowerPoint presentation from these bullet points”
The agent handles formatting, styling, and delivery automatically.
User Stories
These are use cases, not reviews. Real workflows people run on OpenCrabs, tagged by what they automate, and linked back to the original post wherever we have it. Click any card for the full breakdown and the source. For what people say about the tool itself, see the reviews on the landing page.
Running a workflow like these? Tell us.
We collect real use cases with the receipts. The best ones land on this wall, tagged and linked back to you.
The crab lives inside the phone
Daniel rooted a Xiaomi Mi 8, dropped OpenCrabs into an Ubuntu chroot on the device, and pointed a Flutter app at it over ACP. Then the crab wrote an Android app, built the APK on the phone with aapt2, javac, d8 and apksigner, and installed it. No PC, no cloud, no Gradle, no SDK.
Some say that Flutter sucks… yeah (ironic) @opencrabs inside the phone linked to a2a on a custom flutter app. It can change the OS. It can code android app, compile and open it… all inside the freakin’ phone
First app fully built inside the phone using @opencrabs yes, code made inside the phone, apk built and open. No need for a pc ;)
The device: a Xiaomi Mi 8 (dipper), Android 10 / API 29, MIUI 12, aarch64, kernel 4.9.186, 5.6 GB of RAM. Root came from the boot image itself: Magisk patches it on the phone, fastboot flashes it, and a verifier unpacks the result to inspect the ramdisk instead of trusting the patch log. Live now: magisk -c reports 30.7:MAGISK:R.
Getting a Linux userland onto Android took two attempts. Generation one shipped the aarch64-linux-android binary as a Magisk module with a supervisor script, which meant a 59-file cfg port and a glibc-versus-musl fight. Generation two, the one that runs today, is an Ubuntu 24.04.5 chroot at glibc 2.39, which is what the released linux-arm64 binary actually wants. The trap that cost the most time: /apex is a tmpfs of per-apex bind mounts, so a single bind of /apex copies an empty directory and every Android binary dies with “required file not found”, which reads like a permission error but is a missing interpreter. The cure is binding each /apex/* entry on its own.
Then the app. Daniel wanted the conversation UI he likes in the web, built natively in Flutter, not a WebView. So the app speaks ACP (JSON-RPC 2.0 over stdio) to opencrabs acp running in the chroot, the same protocol the TUI uses: live reasoning chunks, tool cards, permission prompts, token usage. No browser, no server, no open port.
- Survives a reboot with nobody touching the phone: a JobScheduler job that re-arms itself unconditionally, a service hook that waits for
sys.boot_completedand re-establishes the seven mounts, and a loop that reapplies MIUI’s idle and autostart appops because the powerkeeper clears the battery exemption about 20 s after boot - Proof, from logcat after a real reboot: handshake ok at 12 s, service up, battery exemption settled, then a headless self test of 12 pass / 0 fail, GREEN in 3.7 s covering the binary version, shell, sessions, boot wiring, service state, battery exemption, voice recognizer, mic permission, widget binding, ACP ready and a real prompt
- The APK built on the phone: MIUI ships its screen-recorder tile with only a 20 KB stub behind it, so tapping it opens the app store and records nothing. The crab wrote a real Quick Settings tile, built it in six steps with no Gradle and no SDK manager, and put it in the panel next to WiFi. 12,784 bytes.
- The build chain:
aapt2 compile→aapt2 link→javac --release 8againstandroid.jar→d8from R8 → zip the dex in →zipalign→apksigner signandverify - Installed from inside the chroot, reaching Android’s package manager through
nsenter -t 1 -m, then granted root by writing a Magisk policy row and added to the shade withcmd statusbar add-tile - One body, two brains: ACP is stdio and
ssh -Tis also stdio, so the phone can point at a Mac on the LAN with no bridge and no open port. Measured:initializein 1.2 s, remote session list of 40, self test 9/9 GREEN against the remote brain
The part that matters: the tile does not record anything itself. It shells out, through Magisk’s su, to the same recorder binary in the chroot that the /rec chat command uses, so there is one recorder, one state file, one output folder. The crab wrote an Android app that is a handle for a Linux tool inside the same phone. The app is the thumb, the crab is the brain. That is the whole architecture of this project, in 13 KB.
The reasoning log from that session is the detail worth keeping: the crab stopped to check whether it was really on a phone, and confirmed it from the runtime instead of assuming.
Fired the accounting operator
Alexey replaced his accounting operator with an AI accountant running on OpenCrabs. Faster, more transparent, cheaper, and it doesn’t take feedback personally. The whole thing runs at ₽3,000/month on a lean Docker stack.
I fired my accounting operator because I realized that an AI accountant would do his job faster, more transparently, and cheaper.
And without any Gen Z hurt feelings over my feedback.
See for yourself: miidas.ru. #ai #business #accounting
MIIIDAS: accounting without an extra person. Priced at ₽3,000/month, it replaces the operator entirely:
- Replaces the operator: P&L statements generated automatically, reconciliation handled, incoming data controlled and validated
- Assists the Chief Accountant: prepares data for 1C:CounterV.S., searches for deviations, drafts contracts and reports
- Integrates with existing tools: 1C, Excel, Google Sheets, Word, Google Docs
The stack: 9 Docker containers (7 with clients, 4 active), Grafana monitoring, Telegram as the deployment platform, a template repo for central skills/brains updates, container isolation per client. Resource footprint is low enough to fit ~30 crabs on a 2GB VPS with swap.
Her accountant is a Telegram bot
Janina manages commercial and residential property in Moscow (apartments, offices, storage sections, ready-to-rent businesses) plus the books of a second company, entirely through one bot in Telegram. Meter readings in, invoices out, contracts reviewed, listings posted: a month of real client use, straight from the chat.
What drives me crazy is calculating the sums when the meter readings come in, and tracking the payments.
The accounting chain, in her own words: tenant sends meter readings → submit them to the management company and the power utility → compute the sums → issue invoices → send them → track payment. The part she hated (sum calculation and payment control) is now the bot’s job, along with scheduled reminders to tenants, tariff-change checks, and reconciliation statements.
- Contract desk: agent agreements reviewed for clauses that disadvantage her (an 85-paragraph agency contract, line by line), dispute protocols generated as Word tables («was → fixed»), three-way cross-checks of a lease + dispute protocol + sublease addendum, redline edits highlighted in color
- Legal homework: counterparty litigation checks requested (kad.arbitr), blocked because the bot’s server sits outside Russia; her company requisites pulled from a bank card and inserted into contracts
- Listings at volume: PDF sale presentations turned into marketing cards (photos, floor plans, and descriptions in her strict format (title on its own line, one sentence per line, no HTML tags her CRM can’t parse)) a six-object batch in one session, plus single-object cards on demand
- Document ops: docx → PDF conversion, rental-contract templates rebuilt with adjusted terms, and an executor-side vulnerability review of a contract she was about to sign
- The stall: full Sber API automation (payment orders, bank-side payment control) is waiting on access only the bank can grant (API keys her client can’t locate, an unverified OAuth app) so that loop stays manual for now
She doesn’t touch OpenCrabs, terminals, or configs. She just talks to a bot in Telegram, and the whole property-and-accounting job runs through it.
AI financier for small businesses
Two weeks building miidas.ru on OpenCrabs, an AI financier for SMBs. The hard part wasn’t the code. It was the three scenarios every small business client walks in with.
For 2 weeks, I’ve been implementing miidas.ru on @opencrabs, an AI financier for small businesses. Three scenarios:
(1) the client can’t describe their process
(2) doesn’t know the AI’s capabilities, what it’s suitable for and what it’s not
(3) forgets about the bot after two days#automation #smb
The agent is built to handle the messy reality of small business finance: clients who can’t articulate what they need, don’t understand what AI can do for them, and drop off after a couple of days. OpenCrabs guides each scenario autonomously instead of waiting for a perfect prompt.
Fired the assistant
Alexey fired his assistant and handed the whole job to the crab: scan Telegram for new real estate leads, cross-reference the chats, agree on follow-up vs close, and send them in five minutes. The same takeover covers the invoice loop: OCR, banking app, manual approval, management accounting.
I fired my assistant bc of @opencrabs. Today it:
· scanned my telegram for notifications about new leads for our latest #RealEstateInvestment offer
· scanned again to see my chats with those leads
· agreed with me follow up / close decisions
· sent follow ups5 mins. Boom.
The invoice loop (“the crab bow”):
The crab bow: monitors a telegram group, OCRs an invoice, puts it into the banking app, I approve manually, it downloads the notification and puts it back to the telegram group, files the transaction in the management accounting app.
One assistant replaced, two workflows automated, each with a human approval gate exactly where it matters.
No frameworks, just OpenCrabs
Alexey’s team dropped frameworks entirely. When code is this cheap, the overhead of learning and maintaining a framework isn’t worth it. They even used OpenCrabs to build evals for OpenCrabs.
We decided not to use any frameworks at all.
Not sure if in the age when code is so cheap it is worth it to learn other frameworks (especially for easier tasks) instead of just building our own.
Faster, more control, less risks.
Used @opencrabs to build evals for @opencrabs.
The meta move: an AI agent generating the evaluation suite that tests that same AI agent. No framework tax, full control, fewer dependencies to babysit.
Mobile product dev on Telegram, 24/7
Carlos Eduardo is a product guy, not a full-time dev, and app.heyiolo.com is now live, built almost entirely with OpenCrabs. He runs the whole thing from a Telegram chat around the clock: describe a feature, the crab plans, writes, tests, and ships it. Deploys to Hetzner, CI on GitHub Actions.
You describe your project in plain words: “a 2-bedroom near Lyon under €300k, balcony, good schools nearby.” The AI analyzes the market, understands your REAL criteria, and shows you the most relevant properties in real time. A buyer’s agent in your pocket, 24/7.
app.heyiolo.com is live. An AI assistant that helps you find your property just by talking to it: no endless filters, no 47 tabs open, no guessing what you actually want.
Carlos built almost all of it with OpenCrabs, with Adolfo on the technical side (infra, backend). His crab lives in a Telegram chat with him around the clock: he describes a feature, it plans, writes the code, tests, and ships it. UX, backend, the whole thing, from “what if we…” to “it’s in production” the same afternoon.
The pipeline runs on autopilot: GitHub, CI with GitHub Actions, deployed to Hetzner. He pushes an idea on Telegram, the crab handles the rest, and it’s live.
A Trello board that runs itself
opryshok’s agent owns its own Trello board. It creates tasks, tracks them, and manages the board autonomously. The human tweaks the crab daily; the crab runs the backlog.
Every day I tweak Crabs to help me do things faster. BTW Trello integration is amazing. My agent now has a board with tasks it manages on its own.
Autonomous task management over the Trello integration: the agent maintains its own board without being told what to move next.
From idea to shipped app
kaduzeras is building an app from raw ideas with CRABS, and calls it a milestone in learning. The agent takes an idea and carries it toward a working product.
I’ve been building an APP myself with CRABS from ideas and it has been such a great MILESTONE in learning stuff. SHOUT OUT TO @AdolfoUsier for keep improving this thing and it’s just the beginning 🔥🔥🔥
Idea in, app out. The agent is the build partner that turns a concept into something real, and the builder levels up along the way.
Brainstorm → research → build
Adi’s whole process runs through OpenCrabs: throw out an idea, the crab finds valid data, they research to a conclusion together, then the agent handles the actual building.
Most of the process involved brainstorming with OpenCrabs: I’d throw out an idea, Crabs would find valid data, we’d do the research and reach a conclusion, and then he’d handle the actual building.
A full ideation-to-implementation loop with the agent as research partner and builder. The human steers, the crab executes.
The butler that overturned its own hypothesis
“Check whether tomorrow’s Azimuth flight was rescheduled.” Someone’s flying tomorrow, so the family-profile butler didn’t trust one source: it scraped the airline’s own ops feed from the schedule page, reverse-engineered the airport’s live departure board API by reading the page’s JavaScript, formed a codeshare hypothesis, then disproved it with actual departure history. Honest verdict: the flight was dropped from that day’s schedule, and the airline never published a reason.
Check the Tbilisi airport website: tomorrow’s Azimuth flight to Moscow Vnukovo, around 14:00, has it been rescheduled?
A one-line question with real consequences. The butler treated it like an ops incident:
- Airline ops feed, scraped: the schedule page embeds live ops data as JSON inside the HTML; the agent extracted and parsed it (186 flights, 4-day window, planned/actual times and statuses)
- Airport live board, reverse-engineered: the departure board loads from an undocumented AJAX endpoint; the agent read the page’s own JS to find the correct parameter and got structured JSON back (scheduled/estimated/actual times, remarks, gates)
- A hypothesis, then the kill shot: the flight was missing from tomorrow’s board while a partner-coded flight held the same slot, codeshare, right? Flight history said no: both numbers departed the same day ~20 minutes apart, two separate physical aircraft
- Rotation check: the inbound positioning leg for tomorrow was missing from the ops feed too, closing the loop
- The honest verdict: not delayed, not rescheduled, dropped from that date entirely. Alternatives named, and “I don’t know the reason, the airline hasn’t published one” said plainly instead of guessed
The same profile, the same day: dose-frequency health questions answered against peer-reviewed sources with proper caveats and red-flag lists, a forwarded astronomy fun-fact corrected with dry humor (the distance ratio is ~389×, not 400×, close enough for folklore, not for a butler), and a contested science question answered citing studies on both sides.
A World Cup desk in one PDF
Adi had his crab produce a five-page World Cup 2026 tournament report as a landscape PDF. Group stage to knockout, the R32 upsets, R16 results, today’s match preview, the quarter-final picture with odds, and a running “our forecast vs reality” tracker.
now its blue… but it looks super dope… holy moly
A living sports desk, generated with the document tool and kept current as the tournament moves:
- Full arc: group stage standings into the knockout bracket
- Results with the upsets: R32 (Germany out, Paraguay through), R16 (England 3-2 Mexico, Norway 2-1 Brazil)
- Match-of-the-day preview: Portugal vs Spain, USA vs Belgium
- The picture plus the odds: quarter-final layout and tournament winners
- Accountability: a “forecast vs reality” tracker that grades its earlier calls
Landscape layout, page branding, and a scoreboard for its own predictions. The crab is the whole back page.
Payroll for 100+ staff, from one spreadsheet
Adi’s crab turns one employee spreadsheet into print-ready payslips for a plantation company. Two layouts (a PDF per person, or two per page with cut lines), empty allowance rows hidden automatically, batched through 100+ staff. It even checked the law before adding a “valid without signature” note.
Source: an employee XLSX for PT. Tulas Sakti Jaya (Pasaman Barat). Out comes a stack of ready-to-print payslips:
- V1: individual PDF payslips, one per employee (Deni, Herlima, Yodrial, Ade, Afriyanto)
- V2: two slips per A4 page with dotted cut lines, “tinggal gunting” (just cut)
- Clean output: zero-value rows hidden automatically (e.g. Tunj. BBM when empty)
- Full detail: company header plus employee data (NIK, name, status, jabatan, pekerjaan, HK), income and deductions sections
- Batch: 104 more employees queued from the same sheet
- Verified, not assumed: ran a web search (36 tool calls) on whether an Indonesian payslip is valid without a signature before adding the note
Spreadsheet in, payroll out, with the legal fine print fact-checked first.
A beat-synced film, made by two agents
Adi told his crab to stop being the global default and act as a specialized motion-graphics identity. It opened an agent-to-agent collab with a video-knowledge agent called “onno” for references and beat markers, then built a Remotion film synced to a synthwave score it composed itself in pure Python.
act strictly as your current, specialized identity running on my engine, NOT the global default opencrabs
The result was “CrabMotion”, a 30-second 720p piece built mathematically:
- Agent-to-agent: collab with “onno” (a video knowledge base) for references, pacing, beat markers and keyframe timings
- Original score: a 120 BPM synthwave track synthesized in pure Python (math.sin + wave, Am-F-C-G progression)
- On the beat: every visual locked to a 15-frames-per-beat grid via frame interpolation
- Grew to v2: 36 seconds, 9 capability cards, stats (75+ tools, 16 skills)
Two agents, one film. The crab pulls references from a peer, writes the music, and builds the animation on the beat.
The crab that QA’s OpenCrabs itself
Adi runs his crab as a QA partner that hunts bugs in OpenCrabs itself and files GitHub issues with file:line source citations. It found the Telegram ghost-button bug and handed over a phantom-tool-call telemetry report that became a merged fix.
- Real receipts: files detailed GitHub issues with file:line citations straight from the source
- Ghost buttons: found the Telegram follow-up-suggestion bug (#706) where buttons rendered as non-interactive ghost text
- Telemetry, not vibes: a phantom-tool-call report over ~69.5k events, a 0.7% phantom rate, 85.3% tool success, with a concrete artifact (reasoning text plus an XML fragment stored as a garbage tool name) and two fix suggestions
- Shipped: that report became issue #687, fixed and merged in commit dd7eab97
- The setup: @Adicrabs_bot on Adi’s own engine as a specialized identity, a small model with reasoning cranked to the max
The agent testing the agent. Adi’s crab does the maintainer’s homework before it files.
One crab runs the whole company
Adolfo runs three companies on a single OpenCrabs instance with one brain. It manages every server, debugs production live with the team, builds the product stack, runs the daily standups, and tracks the ops, all at once across dozens of isolated sessions.
Single instance, single brain. It manages the whole thing concurrently, in simultaneous dozens of isolated sessions, each its own case.
One OpenCrabs install, one accumulated brain, and the whole operation running through it at the same time:
- Every server: Truelens dev, staging, and production, plus Neura/OpenCrabs dev, staging, and prod
- Production debugging, live: in the Slack channel with the Truelens team, in real time
- The routine, handled: UI updates, database queries, the changes that don’t need the CTO, so Adolfo takes only the complex calls
- Building the product: the whole Truelens backend and frontend stack, and the infra and backend DevOps with Carlos
- The daily rhythm: a 9am morning recap, the daily standup for each team, and an analytics digest of AI usage across the whole fleet
- The ops layer: GitHub PRs and issues, cron jobs tracking certificates, and everything else that keeps it running
Not one assistant per job. One brain, many hands, all working at once.
The crab that builds itself
Every new feature and every fix in OpenCrabs is built by OpenCrabs. Adolfo’s crab develops, tests, and ships the very product it runs on, then improves itself on a schedule.
The ultimate dogfood: the agent is the engineer of its own platform.
- Every feature and fix: designed, coded, tested, and committed by the crab, now at v0.3.80 and climbing
- Self-improvement on a schedule: daily and weekly self-improvement jobs, memory consolidation, and soul evolution run as cron
- It QA’s itself: the same recursive loop that ships features also hunts its own bugs (see Adi’s QA card)
The product builds itself, and gets better every night whether Adolfo is awake or not.
Full-stack: a whole product, backend to frontend
The crab built the entire Truelens product, backend and frontend, and builds the infrastructure, backend, and DevOps for HeyIolo alongside Carlos. Full-stack delivery from a chat: schema, API, UI, deploy.
- The whole Truelens stack: the backend BSR compliance engine (structuring submissions, checking completeness, keeping the Golden Thread) and the frontend, built by the crab
- HeyIolo with Carlos: the infrastructure, backend, and DevOps, built as a pair
- A scripted deploy flow: build the images locally, push to the registry, update the tags on the target server, and let CI restart the containers. Never a manual push
- Division of labor: the CTO keeps the complex architecture calls; the crab ships the UI updates, DB queries, and features end to end
A full-stack engineer in a chat window: schema, API, UI, and deploy, across two products.
On-call in production, with the team
When something breaks on Truelens production, the crab debugs it live in the Slack channel alongside the team, in real time. It takes the routine fixes so the CTO keeps the hard calls.
A production incident is a team channel, and the crab is one of the responders:
- Real-time debugging: in the Truelens Slack with the team (Felipe, Jan, Ruhul), investigating as it happens
- The routine changes: UI tweaks, database queries, the fixes that don’t need a CTO, the crab handles with the team directly
- Escalation by design: anything touching production branches or complex architecture waits for Adolfo’s explicit sign-off
The team gets an always-on engineer in the channel. Adolfo stays the CTO, not the on-call.
Six environments, one autonomous ops layer
Two products, six environments, one crab keeping them alive: Truelens and Neura/OpenCrabs across dev, staging, and production. It deploys, watches the certificates, pings uptime, self-heals the web server, and verifies the backups, so nothing falls over quietly.
- Six environments: Truelens dev/staging/prod and Neura/OpenCrabs dev/staging/prod, each on its own server
- Certificates watched: an hourly cert check tracks every SSL certificate and alerts before anything expires
- Uptime watchdogs: the sites get pinged every five minutes, and an nginx self-heal restarts the web server if it drops
- Disk and backups: monitors catch a filling disk or a failed backup before it becomes an outage
- Deploy and release tracking: every deploy and GitHub release kept tabs on automatically
An ops layer that never sleeps: the crab watches the certs, the uptime, the disks, and the backups across all six environments, and fixes what it can before anyone notices.
Dead VPS? The crab wrote the provider ticket
A production VPS went fully network-dead: no ping, no SSH, no HTTPS, while the hosting panel kept saying “running”. Alexey’s ops-profile crab worked the incident end-to-end: confirmed the outage from two independent vantage points, drove the provider’s own API from the shell, dug their newer v2 power API out of the docs repo, and pulled the smoking gun, the provider’s panel itself couldn’t reach the Proxmox hypervisor node. Then guest-side forensics after recovery, and a paste-ready escalation ticket in the provider’s language.
Real incident, 2026-09-06. n8n, Postgres, ~20 containers on one VDS. Down at ~05:30 UTC from two independent networks while the panel claimed “running” and two panel reboots did nothing. The crab took it from there:
- Two-vantage verification: confirmed unreachable from two different networks, ruling out local routing before touching anything
- Drove the provider’s API from the shell: using a CLI script it had written and committed to the infra repo days earlier, with the API key stored outside git
- Found the provider’s v2 power API in their docs repo and switched off the legacy endpoints, which revealed the smoking gun: the provider’s own panel couldn’t reach the Proxmox hypervisor node (
connect ETIMEDOUTon the node’s management port), power state stale, and all four queued reboots (2 panel + 2 API) had never executed - Stopped firing reboots the moment evidence pointed at the host node, no blind actions once it was clear no API call could help until the provider intervened
- Post-recovery guest forensics: first failed outbound connection at 05:30:02 and recovery at 08:51:59 pinned from container health-check logs; continuous uptime, zero NIC link-down events, and unbroken syslog across the whole blackout, proof the guest was innocent
- Per-container impact table: which services logged retry storms, which were untouched, and the one container that OOM’d as a side effect
- The deliverable: a paste-ready escalation report for provider support, written in the provider’s language, with the exact error strings from their own API as evidence
Verdict: hypervisor datapath wedge, guest innocent. Second identical signature in four days, flagged as a repeat-incident pattern with a migration recommendation. All diagnosis knowledge (provider API quirks, the “check power state before firing reboots” law) persisted to the crab’s brain files, and the investigation thread survived ~5 hours and multiple context compactions without losing its place.
The repo manager
The crab runs the GitHub workflow: triage incoming issues, draft responses, track every PR and release, and keep the backlog honest. Adolfo reviews; the crab does the legwork.
- Triage: new issues in the OpenCrabs repo triaged every 30 minutes
- Drafts: responses and follow-ups on issues drafted automatically
- Tracking: PRs and releases kept tabs on continuously
- The whole bug-fix loop: open an issue, fix it, comment with the commit, close it, all through the crab
A tireless repo maintainer: triage, drafts, tracking, and release notes, with the human stepping in only for the calls that matter.
The 12-hour Airbnb product
estimertravaux.com turns renovation photos into itemized French-market estimates in seconds. OpenCrabs is the brain doing it all: vision analysis, SKU selection, pricing, planning, the whole SKU-to-budget pipeline, orchestrated as an autonomous agent.
EstimersTravaux is Gaspare Russo’s estimation app for the French renovation market: clients photograph their rooms, pick rooms and trades, and get a detailed per-room estimate based on real 2026 French market pricing in seconds.
- OpenCrabs as the brain: the Dart bridge invokes the OpenCrabs CLI (v0.3.83) as an autonomous agent (
opencrabs run --auto-approve) and delegates the entire estimation to it - SKU orchestration: the agent reads the photos, selects product ranges coherent with the property’s usage and style from a per-trade brand catalogue (Tollens, Legrand DX3, Uponor, Porcelanosa, Grohe, IKEA…), estimates quantities, and emits per-room line items with min/max ranges
- Real market smarts: regional multipliers (Côte d’Azur ×1.18, Paris ×1.25), adaptive TVA by building age, conditional purchase orientation, rental units get Leroy Merlin ranges, high-end gets Point.P premium and Villeroy & Boch
- Strict output contract: the agent returns pure JSON (rooms + line items + planning); the bridge extracts it via bracket-matching and persists everything in PostgreSQL
- Zero hardcoded fallback: if the AI fails, the user gets an explicit error and a retry, no fake numbers
The origin: built in 12 hours in a Lisbon Airbnb by Gaspare Russo with Carlos Eduardo (heyiolo.com) and Adolfo Usier, OpenCrabs’ creator. During the build, OpenCrabs also translated the team’s French↔English conversation live on a dedicated Telegram group, and worked beautifully.
Building from Source
Prerequisites
- Rust 1.94+ (stable, nightly not required)
- SQLite3 development headers
- OpenSSL development headers (vendored by default)
- pkg-config (Linux/macOS)
macOS
brew install sqlite3 pkg-config
Ubuntu / Debian
sudo apt install build-essential pkg-config libsqlite3-dev libssl-dev
Arch Linux
sudo pacman -S base-devel sqlite openssl pkg-config
Clone and Build
git clone https://github.com/opencrabs/opencrabs.git
cd opencrabs
cargo build --release
The binary is at target/release/opencrabs.
Feature Flags
OpenCrabs uses Cargo features to toggle channel support:
| Feature | Default | Description |
|---|---|---|
telegram | Yes | Telegram bot via teloxide |
discord | Yes | Discord bot via serenity |
slack | Yes | Slack bot via slack-morphism |
whatsapp | Yes | WhatsApp via whatsapp-rust |
trello | Yes | Trello integration |
browser | Yes | Headless Chrome automation via CDP |
profiling | No | pprof flamegraphs (Unix only) |
Build with specific features:
# Minimal: TUI only, no channels
cargo build --release --no-default-features
# Only Telegram
cargo build --release --no-default-features --features telegram
Release Profile
The release profile is optimized for size and speed:
[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = true
panic = "abort"
There’s also a release-small profile for minimal binary size:
cargo build --profile release-small
Running Tests
cargo test --all-features
Linting
Always use clippy with all features:
cargo clippy --all-features
Self-Update
If you build from source, use git pull && cargo build --release instead of /evolve. The /evolve command downloads pre-built binaries from GitHub Releases.
Architecture
High-Level Overview
┌─────────────────────────────────────────────────┐
│ TUI (ratatui) + Split Panes │
├────────┬────────┬──────────┬────────────────────┤
│Telegram│Discord │ Slack │ WhatsApp │
├────────┴────────┴──────────┴────────────────────┤
│ Brain (Agent Core) │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ Providers│ │ Tools │ │ Memory (3-tier) │ │
│ │ Registry │ │ +Dynamic │ │ │ │
│ └──────────┘ └──────────┘ └──────────────────┘ │
├─────────────────────────────────────────────────┤
│ Services / DB (SQLite) │ Browser (CDP) │
├─────────────────────────────────────────────────┤
│ A2A Gateway │ Cron Scheduler │ Sub-Agents │
├─────────────────────────────────────────────────┤
│ Shared Channel Commands (commands.rs, 847 lines) │
├─────────────────────────────────────────────────┤
│ Self-Healing (config recovery, provider health, │
│ ARG_MAX compaction, error surfacing) │
├─────────────────────────────────────────────────┤
│ Daemon Mode (health endpoint, auto-reconnect) │
└─────────────────────────────────────────────────┘
Source Layout
src/
├── main.rs # Entry point, CLI parsing
├── lib.rs # Library root
├── cli/ # CLI argument parsing (clap)
├── config/ # Configuration types, loading, health tracking
│ └── health.rs # Provider health persistence (120 lines)
├── db/ # SQLite database layer
│ ├── models.rs # Data models (Session, Message, etc.)
│ └── repository/ # Query functions per entity
├── migrations/ # SQL migration files
├── services/ # Business logic layer
│ └── session.rs # Session management service
├── brain/ # Agent core
│ ├── agent/ # Agent service, context, tool loop
│ │ └── service/ # Builder, context, helpers, tool_loop
│ ├── provider/ # LLM provider implementations
│ ├── tools/ # 50+ tool implementations
│ └── memory/ # 3-tier memory system
├── tui/ # Terminal UI (ratatui + crossterm)
│ ├── app/ # App state, input, messaging
│ └── render/ # UI rendering modules
├── channels/ # Messaging platform integrations
│ ├── commands.rs # Shared text command handler (847 lines)
│ ├── telegram/ # Teloxide-based bot
│ ├── discord/ # Serenity-based bot
│ ├── slack/ # Slack Socket Mode
│ └── whatsapp/ # WhatsApp Web pairing
├── a2a/ # Agent-to-Agent gateway (axum)
├── cron/ # Cron job scheduler
├── memory/ # Vector search + FTS5
├── docs/ # Embedded doc templates
├── tests/ # Integration tests
└── benches/ # Criterion benchmarks
Key Crates
| Crate | Purpose |
|---|---|
ratatui + crossterm | Terminal UI rendering and input |
rusqlite + deadpool-sqlite | SQLite database with connection pooling |
reqwest | HTTP client for LLM APIs |
axum + tower-http | A2A HTTP gateway |
crabrace | Provider registry and routing |
teloxide | Telegram Bot API |
serenity | Discord gateway |
slack-morphism | Slack API |
In-tree memory store (src/memory/) | Memory search (SQLite FTS5 + vector embeddings) |
rwhisper (candle) | Local STT: pure Rust, Metal GPU on macOS |
piper (Python venv) | Local TTS with OGG/Opus encoding |
syntect | Syntax highlighting in TUI |
tiktoken-rs | Token counting |
Data Flow
- Input arrives from TUI, channel, A2A, or cron trigger
- Channel commands (
/doctor,/help,/usage,/evolve) execute directly via the shared handler without LLM routing - Brain builds context (system prompt + brain files + memory + conversation)
- Provider streams the LLM response via the selected provider; health is tracked per-provider
- Tool Loop executes any tool calls, feeds results back to the LLM. CLI provider segments (text/tool interleaving) are tracked for correct ordering
- Response is delivered back to the originating channel
- DB persists messages, token usage, session state, and CLI tool segments
- Self-healing monitors for config corruption, context budget overflow (65% threshold), ARG_MAX limits, stuck streams (2048-byte repeat detection), idle timeouts (60s), provider failures (per-provider health tracking with auto-failover), and DB integrity. Crash recovery replays pending requests on restart. All errors surfaced – nothing swallowed silently
Database
SQLite with WAL mode. Tables:
sessions: Session metadata, provider, model, working directorymessages: Conversation history per sessionusage_ledger: Permanent token/cost trackingmemory_*: FTS5 and vector tables for semantic memory
Migrations run automatically on startup from src/migrations/.
Concurrency Model
- Tokio async runtime with multi-threaded scheduler
- Each channel runs as an independent tokio task
- Sessions are isolated: each has its own conversation state
- Tool execution uses
tokio::task::block_in_placefor sync operations - A2A gateway runs as a separate axum server task
Logging and Forensics (v0.3.82)
One daily rolling log file per profile, written synchronously on the calling thread.
Session correlation (#1078)
Every agent turn opens a tracing span carrying its session_id, so each log line emitted inside that turn is stamped with it. Cron jobs open a job span (name + id) and the RSI engine opens its own. Spawned tasks inherit the span, so work that moves onto another task still reports the turn it belongs to.
This makes a single turn greppable out of a file where every session, cron job and RSI cycle is interleaved:
grep '<session-id>' ~/.opencrabs/logs/opencrabs.YYYY-MM-DD
Before this, filtering was guesswork: thread ids get reused and outlive a turn, and timestamps only narrow the window.
Writer reliability (#1115, #1077)
The file writer is deliberately synchronous rather than using a background worker, because the worker swallows IO errors and drops events under load. Two failure modes were fixed in v0.3.82:
- Events were dropped, and log output could reach the TUI’s terminal (#1115), corrupting the display.
- A stalled write silenced everything (#1077). The writer held a mutex for the duration of a write, so if one write blocked (a hung filesystem, disk pressure), every other thread trying to log blocked behind it. One parked write could take the whole process’s logging down while the agent kept running. The writer now uses
try_lock: under contention the event is dropped rather than blocking the caller, so one stalled write can never silence another thread.
Testing Guide
Comprehensive test coverage for OpenCrabs. All tests run with:
cargo test --all-features
Quick Reference
| Category | Tests | Location |
|---|---|---|
| Tests: Streaming Active Secs | 2 | src/tests/streaming_active_secs_test.rs |
| Tests: Tool Execution Stats | 2 | src/tests/tool_execution_stats_test.rs |
| Tests: Mission Control Report | 2 | src/tests/mission_control_report_test.rs |
| Tests: Custom Provider No Models | 2 | src/tests/custom_provider_no_models_test.rs |
| Tests: Provider Context Window Override | 2 | src/tests/provider_context_window_override_test.rs |
| Tests: Slack Handler | 2 | src/tests/slack_handler_test.rs |
| Tests: Custom Provider Section Resolver | 2 | src/tests/custom_provider_section_resolver_test.rs |
| Tests: Mission Control Command | 2 | src/tests/mission_control_command_test.rs |
| Tests: Rsi Self Improve Dedup | 2 | src/tests/rsi_self_improve_dedup_test.rs |
| Tests: Clipboard Image Paste | 2 | src/tests/clipboard_image_paste_test.rs |
| Tests: Cowork Connect | 2 | src/tests/cowork_connect_test.rs |
| Tests: Discord Handler | 2 | src/tests/discord_handler_test.rs |
| Tests: Cron Tool Registry | 2 | src/tests/cron_tool_registry_test.rs |
| Tests: User Correction Metadata | 3 | src/tests/user_correction_metadata_test.rs |
| Tests: Pdf Vision | 3 | src/tests/pdf_vision_test.rs |
| Tests: Xiaomi Config Default | 3 | src/tests/xiaomi_config_default_test.rs |
| Tests: Telegram Model Callback Data | 3 | src/tests/telegram_model_callback_data_test.rs |
| Tests: Telegram Caption | 3 | src/tests/telegram_caption_test.rs |
| Tests: New Session Pane Binding | 3 | src/tests/new_session_pane_binding_test.rs |
| Tests: Mimo Tool Call Hint | 3 | src/tests/mimo_tool_call_hint_test.rs |
| Tests: Brain Project Overlay | 3 | src/tests/brain_project_overlay_test.rs |
| Tests: Systemd Unit | 3 | src/tests/systemd_unit_test.rs |
| Tests: Profile Pid Lock | 3 | src/tests/profile_pid_lock_test.rs |
| Tests: Phantom Going To | 3 | src/tests/phantom_going_to_test.rs |
| Tests: Auto Title E2E | 3 | src/tests/auto_title_e2e_test.rs |
| Tests: Glob Tool | 3 | src/tests/glob_tool_test.rs |
| Tests: Project File Archive | 3 | src/tests/project_file_archive_test.rs |
| Tests: Brain Live Rebuild | 3 | src/tests/brain_live_rebuild_test.rs |
| Tests: Build User Message Image | 3 | src/tests/build_user_message_image_test.rs |
| Tests: Read Media Redirect | 3 | src/tests/read_media_redirect_test.rs |
| Tests: Provider Picker Setup Hint | 4 | src/tests/provider_picker_setup_hint_test.rs |
| Tests: Project File Slug | 4 | src/tests/project_file_slug_test.rs |
| Tests: Browser Cdp Endpoint | 4 | src/tests/browser_cdp_endpoint_test.rs |
| Tests: Tui Drop Path | 4 | src/tests/tui_drop_path_test.rs |
| Tests: Telegram Join Detection | 4 | src/tests/telegram_join_detection_test.rs |
| Tests: Pdf To Images | 4 | src/tests/pdf_to_images_test.rs |
| Tests: Plan Reminder | 4 | src/tests/plan_reminder_test.rs |
| Tests: Xiaomi Keyed Provider Regression | 4 | src/tests/xiaomi_keyed_provider_regression_test.rs |
| Tests: Rsi Fallback Wrap | 4 | src/tests/rsi_fallback_wrap_test.rs |
| Tests: Rtk Autodownload | 4 | src/tests/rtk_autodownload_test.rs |
| Tests: Profile Preempt | 4 | src/tests/profile_preempt_test.rs |
| Tests: Lazy Tools | 4 | src/tests/lazy_tools_test.rs |
| Tests: Logging Log Files | 4 | src/tests/logging_log_files_test.rs |
| Tests: Telegram Send Input File | 5 | src/tests/telegram_send_input_file_test.rs |
| Tests: Prompt Inline Edit Directive | 5 | src/tests/prompt_inline_edit_directive_test.rs |
| Tests: Doc Parser Page Range | 5 | src/tests/doc_parser_page_range_test.rs |
| Tests: Mission Control Dedup Detail | 5 | src/tests/mission_control_dedup_detail_test.rs |
| Tests: Follow Up Intermediate Flush | 5 | src/tests/follow_up_intermediate_flush_test.rs |
| Tests: Project Skills | 5 | src/tests/project_skills_test.rs |
| Tests: Command Rich Table | 5 | src/tests/command_rich_table_test.rs |
| Tests: Custom Provider Live Fetch Regression | 5 | src/tests/custom_provider_live_fetch_regression_test.rs |
| Tests: Rtk Tracker | 5 | src/tests/rtk_tracker_test.rs |
| Tests: Pdf Smart Routing | 5 | src/tests/pdf_smart_routing_test.rs |
| Tests: Xiaomi Onboarding | 5 | src/tests/xiaomi_onboarding_test.rs |
| Tests: Self Update Path | 6 | src/tests/self_update_path_test.rs |
| Tests: Telegram Send Thread Id Override | 6 | src/tests/telegram_send_thread_id_override_test.rs |
| Tests: Active Skill Tracking | 6 | src/tests/active_skill_tracking_test.rs |
| Tests: Config Dotted Caps | 6 | src/tests/config_dotted_caps_test.rs |
| Tests: Tts Fallback Chain | 6 | src/tests/tts_fallback_chain_test.rs |
| Tests: Rtk Sysadmin Supported | 6 | src/tests/rtk_sysadmin_supported_test.rs |
| Tests: Stt Fallback Chain | 6 | src/tests/stt_fallback_chain_test.rs |
| Tests: Telegram Topic Listing | 6 | src/tests/telegram_topic_listing_test.rs |
| Tests: Bash Blocklist | 6 | src/tests/bash_blocklist_test.rs |
| Tests: Whatsapp Handler | 6 | src/tests/whatsapp_handler_test.rs |
| Tests: Cron Profile Isolation | 6 | src/tests/cron_profile_isolation_test.rs |
| Tests: Evolve Diagnose | 7 | src/tests/evolve_diagnose_test.rs |
| Tests: Channel Session Resolve | 7 | src/tests/channel_session_resolve_test.rs |
| Tests: Phantom Cleanup Intent | 7 | src/tests/phantom_cleanup_intent_test.rs |
| Tests: Qwen Tool Marker Strip | 7 | src/tests/qwen_tool_marker_strip_test.rs |
| Tests: Telegram Impersonation | 7 | src/tests/telegram_impersonation_test.rs |
| Tests: Subagent Tool Description | 7 | src/tests/subagent_tool_description_test.rs |
| Tests: Fallback Streak | 7 | src/tests/fallback_streak_test.rs |
| Tests: Phantom Work Announcement | 7 | src/tests/phantom_work_announcement_test.rs |
| Tests: Word Delete Keybinding | 7 | src/tests/word_delete_keybinding_test.rs |
| Tests: Telegram Thread Id Lookup | 8 | src/tests/telegram_thread_id_lookup_test.rs |
| Tests: Telegram Reply Context Recovery | 8 | src/tests/telegram_reply_context_recovery_test.rs |
| Tests: Onboarding User Scroll | 8 | src/tests/onboarding_user_scroll_test.rs |
| Tests: Prompt Known Paths | 8 | src/tests/prompt_known_paths_test.rs |
| Tests: Cli Supported Models | 8 | src/tests/cli_supported_models_test.rs |
| Tests: Custom Provider Rename Keys Toml | 8 | src/tests/custom_provider_rename_keys_toml_test.rs |
| Tests: Phantom Pronoun Drop | 8 | src/tests/phantom_pronoun_drop_test.rs |
| Tests: Provider Registry | 8 | src/tests/provider_registry_test.rs |
| Tests: Telegram Photo Batching | 8 | src/tests/telegram_photo_batching_test.rs |
| Tests: Mission Control Skill Inbox | 8 | src/tests/mission_control_skill_inbox_test.rs |
| Tests: Plan Tool Description | 8 | src/tests/plan_tool_description_test.rs |
| Tests: Onboarding No Silent Commit | 8 | src/tests/onboarding_no_silent_commit_test.rs |
| Tests: Telegram Handler | 9 | src/tests/telegram_handler_test.rs |
| Tests: Orphan Close Tag Strip | 9 | src/tests/orphan_close_tag_strip_test.rs |
| Tests: Onboarding Custom Model Input | 9 | src/tests/onboarding_custom_model_input_test.rs |
| Tests: Telegram Rich | 9 | src/tests/telegram_rich_test.rs |
| Tests: Rsi Sync Cap Bail | 9 | src/tests/rsi_sync_cap_bail_test.rs |
| Tests: Integration | 9 | src/tests/integration_test.rs |
| Tests: Format User Error | 9 | src/tests/format_user_error_test.rs |
| Tests: Telegram Plan Render | 9 | src/tests/telegram_plan_render_test.rs |
| Tests: Plan Mode Integration | 9 | src/tests/plan_mode_integration_test.rs |
| Tests: Error Scenarios | 9 | src/tests/error_scenarios_test.rs |
| Tests: Web Browser Routing | 9 | src/tests/web_browser_routing_test.rs |
| Tests: Rsi Skill Proposals | 9 | src/tests/rsi_skill_proposals_test.rs |
| Tests: Baseline Merge | 10 | src/tests/baseline_merge_test.rs |
| Tests: Sanitize Code Edit Block | 10 | src/tests/sanitize_code_edit_block_test.rs |
| Tests: Markdown Render | 10 | src/tests/markdown_render_test.rs |
| Tests: Tool Arg Unescape | 10 | src/tests/tool_arg_unescape_test.rs |
| Tests: Custom Provider Cache Autoenable | 10 | src/tests/custom_provider_cache_autoenable_test.rs |
| Tests: Streaming | 10 | src/tests/streaming_test.rs |
| Tests: Incident Log Dedup | 10 | src/tests/incident_log_dedup_test.rs |
| Tests: Phantom Deferment | 11 | src/tests/phantom_deferment_test.rs |
| Tests: Analysis Intent Nudge | 11 | src/tests/analysis_intent_nudge_test.rs |
| Tests: Phantom Post Success Exemption | 11 | src/tests/phantom_post_success_exemption_test.rs |
| Tests: Goal Command | 11 | src/tests/goal_command_test.rs |
| Tests: Whatsapp Photo Batching | 11 | src/tests/whatsapp_photo_batching_test.rs |
| Tests: Prompt Compiled Features | 11 | src/tests/prompt_compiled_features_test.rs |
| Tests: Telegram Pre Tool Rolling | 11 | src/tests/telegram_pre_tool_rolling_test.rs |
| Tests: Service Scope | 11 | src/tests/service_scope_test.rs |
| Tests: Telegram Quote Reply | 11 | src/tests/telegram_quote_reply_test.rs |
| Tests: Dynamic Tool Parse Error | 12 | src/tests/dynamic_tool_parse_error_test.rs |
| Tests: Onboard Channel | 12 | src/tests/onboard_channel_test.rs |
| Tests: Streaming Tps Accumulator | 12 | src/tests/streaming_tps_accumulator_test.rs |
| Tests: Compaction Prompts | 12 | src/tests/compaction_prompts_test.rs |
| Tests: Cron Schedule Util | 12 | src/tests/cron_schedule_util_test.rs |
| Tests: Orphan Think Close Tag | 13 | src/tests/orphan_think_close_tag_test.rs |
| Tests: Usage Cosmetic Alias | 13 | src/tests/usage_cosmetic_alias_test.rs |
| Tests: Voice Service | 14 | src/tests/voice_service_test.rs |
| Tests: Evolve Systemd Restart | 14 | src/tests/evolve_systemd_restart_test.rs |
| Tests: Background Session | 14 | src/tests/background_session_test.rs |
| Tests: Bash Feedback Enrichment | 14 | src/tests/bash_feedback_enrichment_test.rs |
| Tests: Voice Voicebox | 15 | src/tests/voice_voicebox_test.rs |
| Tests: Brain Filter Strip Empty Sections | 15 | src/tests/brain_filter_strip_empty_sections_test.rs |
| Tests: Voice Local Tts | 15 | src/tests/voice_local_tts_test.rs |
| Tests: Template Governance | 15 | src/tests/template_governance_test.rs |
| Tests: Telegram Status Message | 15 | src/tests/telegram_status_message_test.rs |
| Tests: Rtk Rewrite | 15 | src/tests/rtk_rewrite_test.rs |
| Tests: Channel Commands | 16 | src/tests/channel_commands_test.rs |
| Tests: Telegram Session Resolve | 18 | src/tests/telegram_session_resolve_test.rs |
| Tests: Qwen Detect | 18 | src/tests/qwen_detect_test.rs |
| Tests: Bundled Plans | 20 | src/tests/bundled_plans_test.rs |
| Tests: Text Complete | 21 | src/tests/text_complete_test.rs |
| Tests: Plan Window | 21 | src/tests/plan_window_test.rs |
| Tests: Rsi Pruned | 23 | src/tests/rsi_pruned_test.rs |
| Tests: Rsi Subsystem | 23 | src/tests/rsi_subsystem_test.rs |
| Tests: Pdf Page Range Parser | 25 | src/tests/pdf_page_range_parser_test.rs |
| Tests: Project | 25 | src/tests/project_test.rs |
| Tests: Voice Local Whisper | 25 | src/tests/voice_local_whisper_test.rs |
| Tests: Rsi Brain Dedup | 27 | src/tests/rsi_brain_dedup_test.rs |
| Tests: Telegram Rich Parse | 28 | src/tests/telegram_rich_parse_test.rs |
| Tests: Plan Tool | 31 | src/tests/plan_tool_test.rs |
| Tests: Profiles Dialog | 49 | src/tests/profiles_dialog_test.rs |
| Brain: Agent Service | 26 | src/brain/agent/service/ |
| Brain: Prompt Builder | 20 | src/brain/prompt_builder.rs |
| Brain: Agent Context | 12 | src/brain/agent/context.rs |
| Brain: Provider (Anthropic) | 9 | src/brain/provider/anthropic.rs |
| Provider Retry (consolidated) | 19 | src/utils/retry.rs (8 inline) + src/tests/provider_retry_consolidation_test.rs (11): brain/provider/retry.rs was deleted and folded onto utils::retry; covers patient backoff schedule, hard-down fast-fail, Retry-After clamp, and retry-notify surfacing |
| Brain: Provider (Custom OpenAI) | 9 | src/brain/provider/custom_openai_compatible.rs |
| Brain: Provider (Copilot) | 8 | src/brain/provider/copilot.rs |
| Brain: Provider (Factory) | 4 | src/brain/provider/factory.rs |
| Brain: Provider (Claude CLI) | 4 | src/brain/provider/claude_cli.rs |
| Brain: Provider (Types/Error/Trait) | 7 | src/brain/provider/ |
| Brain: Provider (Qwen) | 13 | src/brain/provider/qwen.rs |
| Brain: Provider (JSON Repair) | 10 | src/brain/provider/json_repair.rs |
| Brain: Provider (Codex OAuth) | 6 | src/brain/provider/codex_oauth.rs |
| Brain: Tokenizer | 8 | src/brain/tokenizer.rs |
| Brain: Commands | 6 | src/brain/commands.rs |
| Brain: Self-Update | 1 | src/brain/self_update.rs |
| Brain Tools: Bash | 21 | src/brain/tools/bash.rs |
| Brain Tools: Plan Security | 20 | src/brain/tools/plan_tool.rs |
| Brain Tools: Exa Search | 18 | src/brain/tools/exa_search.rs |
| Brain Tools: Write File | 17 | src/brain/tools/write_opencrabs_file.rs |
| Brain Tools: A2A Send | 16 | src/brain/tools/a2a_send.rs |
| Brain Tools: Load Brain File | 15 | src/brain/tools/load_brain_file.rs |
| Brain Tools: Brave Search | 12 | src/brain/tools/brave_search.rs |
| Brain Tools: Browser Manager | 12 | src/brain/tools/browser/manager.rs |
| Brain Tools: Tool Manage | 11 | src/brain/tools/tool_manage.rs |
| Brain Tools: Dynamic Tools | 17 | src/brain/tools/dynamic/ |
| Brain Tools: Doc Parser | 10 | src/brain/tools/doc_parser.rs |
| Brain Tools: Registry | 7 | src/brain/tools/registry.rs |
| Brain Tools: Slash Command | 6 | src/brain/tools/slash_command.rs |
| Brain Tools: Write/Read/Config/Memory/Error | 20 | src/brain/tools/ |
| Brain Tools: Subagent | 9 | src/brain/tools/subagent.rs |
| Brain Tools: Error | 6 | src/brain/tools/error.rs |
| Brain Tools: Config Tool | 5 | src/brain/tools/config_tool.rs |
| Brain Tools: Write | 5 | src/brain/tools/write.rs |
| Brain Tools: Read | 4 | src/brain/tools/read.rs |
| Brain Tools: Memory Search | 2 | src/brain/tools/memory_search.rs |
| Brain Tools: Trait | 3 | src/brain/tools/trait.rs |
| Channels: Voice Local Whisper | 25 | src/channels/voice/local_whisper.rs |
| Channels: Voice Service | 14 | src/channels/voice/service.rs |
| Channels: Voice Local TTS | 14 | src/channels/voice/local_tts.rs |
| Channels: Commands | 15 | src/channels/commands.rs |
| Channels: WhatsApp Store | 15 | src/channels/whatsapp/store.rs |
| Channels: Telegram Handler | 8 | src/channels/telegram/handler.rs |
| Channels: WhatsApp Handler | 5 | src/channels/whatsapp/handler.rs |
| Channels: General | 5 | src/channels/ |
| Channels: Slack Handler | 2 | src/channels/slack/handler.rs |
| Channels: Discord Handler | 2 | src/channels/discord/handler.rs |
| Config: Types | 19 | src/config/types.rs |
| Config: Secrets | 5 | src/config/secrets.rs |
| Config: Update | 4 | src/config/update.rs |
| Config: Crabrace | 3 | src/config/crabrace.rs |
| DB: Repository (Plan) | 15 | src/db/repository/plan.rs |
| DB: Retry | 8 | src/db/retry.rs |
| DB: Repository (Other) | 9 | src/db/repository/ |
| DB: Database | 5 | src/db/database.rs |
| DB: Models | 4 | src/db/models.rs |
| Services: Plan | 11 | src/services/plan.rs |
| Services: File | 11 | src/services/file.rs |
| Services: Message | 10 | src/services/message.rs |
| Services: Session | 10 | src/services/session.rs |
| Services: Context | 2 | src/services/context.rs |
| TUI: Onboarding | 67 | src/tui/onboarding/ |
| TUI: Plan | 25 | src/tui/plan.rs |
| TUI: Render Utils | 12 | src/tui/render/utils.rs |
| TUI: Prompt Analyzer | 8 | src/tui/prompt_analyzer.rs |
| TUI: Highlight | 8 | src/tui/highlight.rs |
| TUI: Markdown | 7 | src/tui/markdown.rs |
| TUI: Error | 5 | src/tui/error.rs |
| TUI: Events | 4 | src/tui/events.rs |
| TUI: Components | 2 | src/tui/components/ |
| TUI: App State | 1 | src/tui/app/state.rs |
| A2A: Debate | 8 | src/a2a/debate.rs |
| A2A: Types | 6 | src/a2a/types.rs |
| A2A: Server/Handler/Agent Card | 7 | src/a2a/ |
| Memory: Store | 6 | src/memory/store.rs |
| Memory: Search | 3 | src/memory/search.rs |
| Pricing | 17 | src/pricing.rs |
| Utils: Sanitize | 41 | src/utils/sanitize.rs + src/tests/sanitize_redaction_test.rs |
| Utils: Retry | 8 | src/utils/retry.rs |
| Utils: String | 6 | src/utils/string.rs |
| Utils: Install | 6 | src/utils/install.rs |
| Utils: Config Watcher | 2 | src/utils/config_watcher.rs |
| Logging | 4 | src/logging/logger.rs |
| Tests: RSI Template Sync | 15 | src/tests/rsi_sync_test.rs |
| Tests: Model Fetching | 11 | src/tests/model_fetch_test.rs |
| Tests: Provider Factory Regression | 31 | src/tests/provider_factory_regression_test.rs |
| Tests: Onboarding Welcome | 9 | src/tests/onboarding_welcome_test.rs |
| Tests: Voice STT Dispatch | 21 | src/tests/voice_stt_dispatch_test.rs |
| Tests: Voice Onboarding | 65 | src/tests/voice_onboarding_test.rs |
| Tests: Voice OpenAI Compatible | 12 | src/tests/voice_openai_compatible_test.rs |
| Tests: Cron Jobs & Scheduling | 58 | src/tests/cron_test.rs |
| Tests: Onboarding Field Nav | 49 | src/tests/onboarding_field_nav_test.rs |
| Tests: GitHub Copilot Provider | 38 | src/tests/github_provider_test.rs |
| Tests: File Extract | 37 | src/tests/file_extract_test.rs |
| Tests: Fallback Vision | 40 | src/tests/fallback_vision_test.rs |
| Tests: CLI Parsing | 28 | src/tests/cli_test.rs |
| Tests: Custom Provider | 27 | src/tests/custom_provider_test.rs |
| Tests: Onboarding Navigation | 26 | src/tests/onboarding_navigation_test.rs |
| Tests: Message Compaction | 28 | src/tests/compaction_test.rs |
| Tests: Channel Search | 27 | src/tests/channel_search_test.rs |
| Tests: Evolve (Self-Update) | 23 | src/tests/evolve_test.rs |
| Tests: Slack Formatting | 21 | src/tests/slack_fmt_test.rs |
| Tests: Split Pane | 21 | src/tests/split_pane_test.rs |
| Tests: OpenCode CLI Provider | 21 | src/tests/opencode_provider_test.rs |
| Tests: Onboarding Brain | 23 | src/tests/onboarding_brain_test.rs |
| Tests: Onboarding Types | 17 | src/tests/onboarding_types_test.rs |
| Tests: OpenAI Provider | 16 | src/tests/openai_provider_test.rs |
| Tests: TUI Error | 16 | src/tests/tui_error_test.rs |
| Tests: Queued Messages | 15 | src/tests/queued_message_test.rs |
| Tests: Plan Document | 15 | src/tests/plan_document_test.rs |
| Tests: Session & Working Dir | 15 | src/tests/session_working_dir_test.rs |
| Tests: Stream Loop Detection | 19 | src/tests/stream_loop_test.rs |
| Tests: Context Window | 14 | src/tests/context_window_test.rs |
| Tests: HTML Comment Strip | 14 | src/tests/html_comment_strip_test.rs |
| Tests: Daemon Health & Config | 10 | src/tests/daemon_health_test.rs |
| Tests: Collapse Build Output | 9 | src/tests/collapse_build_output_test.rs |
| Tests: Image Utils | 9 | src/tests/image_util_test.rs |
| Tests: Brain Templates | 7 | src/tests/brain_templates_test.rs |
| Tests: AltGr Input | 8 | src/tests/altgr_input_test.rs |
| Tests: QR Render | 10 | src/tests/qr_render_test.rs |
| Tests: Provider Sync | 8 | src/tests/provider_sync_test.rs |
| Tests: WhatsApp State | 7 | src/tests/whatsapp_state_test.rs |
| Tests: Reasoning Lines | 7 | src/tests/reasoning_lines_test.rs |
| Tests: System Continuation | 6 | src/tests/system_continuation_test.rs |
| Tests: Candle Whisper | 6 | src/tests/candle_whisper_test.rs |
| Tests: Post-Evolve | 5 | src/tests/post_evolve_test.rs |
| Tests: Onboarding Keys | 4 | src/tests/onboarding_keys_test.rs |
| Tests: TUI Render Clear | 4 | src/tests/tui_render_clear_test.rs |
| Tests: TUI Tool Stack | 6 | src/tests/tui_tool_stack_test.rs |
| Tests: Gemini Fetch | 3 | src/tests/gemini_fetch_test.rs |
| Tests: Profiles | 61 | src/tests/profile_test.rs |
| Tests: Subagent / Swarm | 84 | src/tests/subagent_test.rs |
| Tests: Telegram Resume & Helpers | 57 | src/tests/telegram_resume_test.rs |
| Tests: Token Tracking | 29 | src/tests/token_tracking_test.rs |
| Tests: wait_agent Resolver | 12 | src/tests/wait_agent_resolver_test.rs |
| Tests: Browser Default (macOS LSHandlers parser) | 12 | src/tests/browser_default_test.rs |
| Tests: Browser Default (Linux xdg-settings parser) | 4 | src/tests/browser_default_linux_test.rs (Linux-only) |
| Tests: Browser Default (Windows reg-query parser) | 6 | src/tests/browser_default_windows_test.rs (Windows-only) |
| Tests: Browser Profile Lock Sweeper | 5 | src/tests/browser_locks_test.rs |
| Tests: Browser CDP Handler Health | 4 | src/tests/browser_health_test.rs |
| Tests: Browser Stealth JS Regression Guards | 6 | src/tests/browser_stealth_test.rs |
| Tests: Browser Manager Drop | 2 | src/tests/browser_drop_test.rs |
| Tests: Browser Session-Scoped Tabs | 4 | src/tests/browser_session_test.rs |
| Tests: Browser Profile Unlock Backoff | 4 | src/tests/browser_profile_wait_test.rs |
| Tests: Browser Eval Output Cap | 5 | src/tests/browser_eval_cap_test.rs |
| Tests: Browser Screenshot-Failure Surface | 2 | src/tests/browser_screenshot_surface_test.rs |
| Tests: Browser Find JS Builder | 9 | src/tests/browser_find_test.rs |
| Tests: exa_search MCP Handshake | 4 | src/tests/exa_search_test.rs |
| Tests: http_request User-Agent | 3 | src/tests/http_request_test.rs |
| Tests: Self-Healing (Phantom Detection + stuck-intent loop) | 88 | src/tests/self_healing_test.rs |
| Tests: Bash SSH Detection | 10 | src/tests/bash_ssh_detection_test.rs |
| Tests: Bash POSIX Quote (askpass) | 9 | src/tests/bash_posix_quote_test.rs |
| Tests: RSI Proposals Inbox | 16 | src/tests/rsi_proposals_test.rs |
| Tests: Skills Loader | 15 | src/tests/skills_test.rs |
| Tests: Skill Slash Dispatch | 7 | src/tests/skill_slash_dispatch_test.rs |
| Tests: Slash Autocomplete Dimensions | 18 | src/tests/slash_autocomplete_dimensions_test.rs |
| Tests: Mission Control Layout | 7 | src/tests/mission_control_layout_test.rs |
| Tests: Mission Control Inbox Service | 6 | src/tests/mission_control_inbox_service_test.rs |
| Tests: Mission Control Activity Service | 8 | src/tests/mission_control_activity_service_test.rs |
| Tests: Mission Control Schedule Service | 5 | src/tests/mission_control_schedule_service_test.rs |
| Tests: Mission Control Input | 23 | src/tests/mission_control_input_test.rs |
| Tests: Skills Dialog | 18 | src/tests/skills_dialog_test.rs |
| Tests: merge_provider_keys (OpenCode persistence regression) | 4 | src/tests/merge_provider_keys_test.rs |
| Tests: Onboarding Wizard | 67 | src/tests/onboarding_wizard_test.rs |
| Tests: RSI (Recursive Self-Improvement) | 83 | src/tests/rsi_test.rs |
| Tests: Dynamic Tool Coercion | 13 | src/tests/dynamic_tool_coerce_test.rs |
| Tests: Follow-Up Question Tool | 9 | src/tests/follow_up_question_test.rs |
| Tests: Gemini Schema Sanitization | 10 | src/tests/gemini_schema_sanitize_test.rs |
| Tests: Rename Session Tool | 7 | src/tests/rename_session_test.rs |
| Tests: Custom Model Paste | 5 | src/tests/custom_model_paste_test.rs |
| Tests: Brain File Generic Guard | 4 | src/tests/brain_file_generic_guard_test.rs |
| Tests: Phantom DB Persistence | 2 | src/tests/phantom_db_persistence_test.rs |
| Tests: Bash Interactive Reject | 37 | src/tests/bash_interactive_reject_test.rs |
| Tests: Qwen Tool-Call Extractor | 64 | src/tests/qwen_tool_extractor_test.rs |
| Tests: Brain File Safety (append-only enforcement, cleanup_intent) | 37 | src/tests/brain_file_safety_test.rs |
| Tests: Provider Config Regression | 28 | src/tests/provider_config_regression_test.rs |
| Tests: Tool-Loop Helpers (Linor P0 hotspot) | 30 | src/tests/tool_loop_helpers_test.rs |
| Tests: Recent Paths | 17 | src/tests/recent_paths_test.rs |
| Tests: Provider Error Proxy | 21 | src/tests/provider_error_proxy_test.rs |
| Tests: Mouse Fragment Filter | 13 | src/tests/mouse_fragment_filter_test.rs |
| Tests: Agent Basic | 12 | src/tests/agent_basic_test.rs |
| Tests: RSI Git History | 12 | src/tests/rsi_git_history_test.rs |
| Tests: Bash Retry Loop | 10 | src/tests/bash_retry_loop_test.rs |
| Tests: Agent Tool Normalization | 10 | src/tests/agent_tool_normalization_test.rs |
| Tests: Kimi Reasoning Markers | 9 | src/tests/kimi_reasoning_test.rs |
| Tests: Usage Activity Columns | 9 | src/tests/usage_activity_columns_test.rs |
| Tests: Agent Context Tracking | 8 | src/tests/agent_context_tracking_test.rs |
Tests: Collapse $HOME to ~ | 8 | src/tests/collapse_home_test.rs |
| Tests: Rate Limiter | 8 | src/tests/rate_limiter_test.rs |
| Tests: Session Chat-ID Lookup | 8 | src/tests/session_chat_id_lookup_test.rs |
| Tests: Agent Approval Policies | 7 | src/tests/agent_approval_policies_test.rs |
| Tests: Agent Model Selection | 6 | src/tests/agent_model_selection_test.rs |
| Tests: Browser Close Tool | 6 | src/tests/browser_close_test.rs |
| Tests: Local-Provider Gate | 6 | src/tests/local_provider_gate_test.rs |
| Tests: Agent Parallel Sessions | 5 | src/tests/agent_parallel_sessions_test.rs |
| Tests: Agent Streaming Usage | 5 | src/tests/agent_streaming_usage_test.rs |
| Tests: Claude CLI Model Selection | 7 | src/tests/claude_cli_model_test.rs |
| Tests: Codex CLI Provider | 5 | src/tests/codex_cli_test.rs |
| Tests: Non-stream Compatibility | 5 | src/tests/nonstream_compat_test.rs |
Tests: Runtime Info $HOME Anchor | 6 | src/tests/runtime_info_home_anchor_test.rs |
| Tests: Handshake Timeout | 4 | src/tests/handshake_timeout_test.rs |
| Tests: Usage Ledger | 4 | src/tests/usage_ledger_test.rs |
Tests: Browser E2E (opt-in, #[ignore]) | 4 | src/tests/browser_e2e_test.rs |
| Tests: CLI Arg Length Cap | 2 | src/tests/cli_arg_too_long_test.rs |
| Tests: Config Watcher (integration) | 3 | src/tests/config_watcher_test.rs |
Tests: Usage Model Grouping (.gguf + provider-prefix normalization) | 18 | src/tests/usage_grouping_test.rs |
Tests: Tool-Execution Repo (empty tool_name guard) | 4 | src/tests/tool_execution_repo_test.rs |
| Tests: Generate Image Backend Dispatch (Gemini vs OpenAI-compatible) | 5 | src/tests/generate_image_backend_test.rs |
| Usage: Categorizer | 4 | src/usage/categorizer.rs |
| Usage: Dashboard | 6 | src/usage/dashboard.rs |
| Usage: Data | 7 | src/usage/data.rs |
| Hashline Edit | 53 | src/tests/hashline_test.rs (30 integration tests) + inline unit tests in hash.rs (9) and types.rs (14): hash computation, HashRef parsing, edit operations (replace/append/prepend), hash mismatch detection, overlap detection, batch edits, prefix stripping, read_file hashline mode |
| Tests: Auto-Title (channel prefix preservation) | 28 | src/tests/auto_title_test.rs |
| Tests: Self-Improve Failure Log Guard | 3 | src/tests/self_improve_failure_log_guard_test.rs |
| Tests: Provider Retry Consolidation | 9 | src/tests/provider_retry_consolidation_test.rs: patient backoff, hard-down/DNS fast-fail, Retry-After clamp, retry-notify surfacing |
| Tests: Tool-Name Self-Heal (#176) | 11 | src/tests/tool_name_heal_test.rs: maps a model’s near-miss tool name (tg_send_message → telegram_send) to the registered tool |
| Tests: Secret Redaction (tool summary) | 6 | src/tests/tool_description_redaction_test.rs: redacts Bearer/api_key/URL-password from the one-line tool display |
| Tests: Secret Redaction (RSI notifications) | 5 | src/tests/rsi_notification_redaction_test.rs: redacts secrets from RSI TUI alerts |
| Tests: Provider Error / HTML-page retry | (in proxy test) | src/tests/provider_error_proxy_test.rs: 4xx HTML infra error pages classified retryable (modelscope 405) |
| Tests: Cross-Provider Model Leak Guard | 6 | src/tests/cross_provider_model_leak_guard_test.rs |
| Tests: Session Provider Wrap / model pairing | - | src/tests/session_provider_wrap_test.rs: swap wraps in FallbackProvider; provider+model set atomically, never invents a default |
| Tests: Streaming tok/s Guard | 10 | src/tests/streaming_tok_per_sec_guard_test.rs: floors/ceilings burst-delivery tok/s artifacts |
| Tests: Telegram Last-Intermediate Footer | 7 | src/tests/telegram_last_intermediate_footer_test.rs: ctx/tok-s footer appended to the last completion message |
| Tests: analyze_video Frame-Extraction Fallback | 6 | src/tests/analyze_video_fallback_test.rs |
| Tests: Git Branch Footer | 8 | src/tests/git_branch_test.rs |
| Tests: TOOLS.md Slim Regression | 9 | src/tests/tools_md_regression_test.rs |
| Tests: Telegram Command Sanitize | 12 | src/tests/telegram_command_sanitize_test.rs |
| Tests: Usage Cache | 15 | src/tests/usage_cache_test.rs |
| Tests: Config Auto-Repair | 7 | src/tests/config_repair_test.rs: closes unterminated arrays/inline tables in a broken config.toml, gated on the result re-parsing; leaves valid/nested/string cases and unfixable errors alone |
| Tests: Config Last-Good Recovery | 3 | src/tests/config_last_good_recovery_test.rs: a broken config never poisons the last-good snapshot; fixable configs auto-repair in place; unfixable ones recover from last-good (preserves auto-always so yolo mode survives a typo) |
| Total | 7,290 | Authoritative count from cargo test --all-features (lib test binary): 7,261 run by default + 29 #[ignore]d. The per-category rows above are a maintained snapshot. Re-run cargo test for the live number. |
Feature-Gated Tests
Some tests only compile/run with specific feature flags:
| Feature | Tests |
|---|---|
local-stt | Local whisper inline tests, candle whisper tests, STT dispatch local-mode tests, codec tests, availability cycling tests |
local-tts | TTS voice cycling, Piper voice Up/Down |
All feature-gated tests use #[cfg(feature = "...")] and are automatically included when running with --all-features.
Running Tests
# Run all tests (recommended)
cargo test --all-features
# Run a specific test module
cargo test --all-features -- voice_onboarding_test
# Run a single test
cargo test --all-features -- is_newer_major_bump
# Run with output (for debugging)
cargo test --all-features -- --nocapture
# Run only local-stt tests
cargo test --features local-stt -- local_whisper
Profile Tests
Profile tests live in src/tests/profile_test.rs and cover multi-instance isolation:
| Area | What’s tested |
|---|---|
| Name validation | Reserved names, length bounds, special characters |
| Token hashing | Determinism, uniqueness, fixed length, hex output |
| Registry (in-memory) | CRUD, serde roundtrip, touch timestamps |
| Path resolution | Base dir, env var override, default vs named profiles |
| Filesystem CRUD | Create/delete lifecycle, duplicate detection, registry sync |
| Export/Import | Roundtrip with config files, nested memory directories |
| Migration | Copy .md/.toml files, skip/force behavior, default source |
| Token locks | Acquire/release, stale PID cleanup, cross-profile conflict |
| Profile isolation | Separate directories, concurrent writes, default vs named |
| Concurrent writes | Tokio tasks creating 5 profiles simultaneously |
# Run profile tests only
cargo test --all-features -p opencrabs -- profile_test
Note: All filesystem-touching tests acquire a global fs_lock() mutex to prevent concurrent write corruption of ~/.opencrabs/profiles.toml. The mutex uses unwrap_or_else(|p| p.into_inner()) to recover from poison (a prior test panic won’t cascade-fail every subsequent test). In-memory tests run in parallel without the lock. The test_set_and_get_active_profile test accounts for OnceLock semantics (can only be set once per process).
Disabled Test Modules
These modules exist but are commented out in src/tests/mod.rs (require network or external services):
| Module | Reason |
|---|---|
error_scenarios_test | Requires mock API server |
integration_test | End-to-end with LLM provider |
plan_mode_integration_test | End-to-end plan workflow |
streaming_test | Requires streaming API endpoint |
Phantom Detection Tests
The self-healing phantom detector prevents the agent from dropping requests mid-stream when it says it will investigate something but never calls tools.
Coverage
Tests in src/tests/self_healing_test.rs verify detection of investigative intent phrases:
| Phrase Pattern | Examples |
|---|---|
let me hunt/trace/track | “let me hunt down the bug”, “let me trace the request” |
let me look into/check into | “let me look into that”, “let me check into the logs” |
let me find out/dig into | “let me find out why”, “let me dig into the code” |
i'll hunt/trace/track | “i’ll hunt that down”, “i’ll trace the flow” |
i'll look into/check into | “i’ll look into it”, “i’ll check into the error” |
i'll find out/dig into | “i’ll find out what’s wrong”, “i’ll dig into the issue” |
Behavior
When the agent outputs one of these phrases with zero tool calls, the phantom detector:
- Catches the mismatch between intent and action
- Injects a correction forcing tool invocation
- Prevents the response from ending with unexecuted promises
Test Count
88 tests covering phrase detection, edge cases, and integration with the tool loop.
Contributing
Getting Started
- Fork the repository on GitHub
- Clone your fork and create a branch:
git clone https://github.com/YOUR_USERNAME/opencrabs.git cd opencrabs git checkout -b my-feature - Build and test:
cargo clippy --all-features cargo test --all-features
Code Style
- Run
cargo clippy --all-featuresbefore committing: nevercargo check - Follow existing patterns in the codebase
- Keep changes focused: one feature or fix per PR
- Add tests for new functionality in
src/tests/
Pull Requests
- Write a clear title and description
- Reference any related issues
- Ensure all tests pass
- Keep PRs small and reviewable
Adding a New Tool
- Create a new file in
src/brain/tools/ - Implement the tool handler function
- Register it in the tool registry
- Add the tool description to
src/docs/reference/templates/TOOLS.md - Add tests in
src/tests/
Adding a New Provider
- Implement the provider in
src/brain/provider/ - Register it in the provider registry via
crabrace - Add configuration docs to
src/docs/reference/templates/ - Document setup in
docs/src/brain/providers.md
Reporting Issues
Open an issue at github.com/opencrabs/opencrabs/issues with:
- OpenCrabs version (
opencrabs --version) - OS and architecture
- Steps to reproduce
- Expected vs actual behavior
- Relevant log output (from
~/.opencrabs/logs/)
License
OpenCrabs is MIT licensed. By contributing, you agree that your contributions will be licensed under the same terms.
Security
Threat Model
OpenCrabs runs locally on your machine with access to your filesystem and shell. Security focuses on:
- API key protection: Keys never leave your machine except to their respective providers
- Network exposure: Minimal attack surface by default
- Tool execution: Sandboxed with user approval
API Key Storage
Keys are stored in ~/.opencrabs/keys.toml:
- File permissions:
600(owner read/write only) - Keys are loaded into memory with
zeroize: zeroed on drop - Keys are never logged or included in conversation history
- Keys are never sent to any provider other than their own
Network Security
A2A Gateway
- Binds to
127.0.0.1(loopback) by default - CORS disabled unless explicitly configured
- A bearer token (
[a2a] api_key) is the only authorization boundary in front of the agent’s tool surface, and since v0.5.1 the gateway refuses to start as an open gate: with no key configured, a non-loopback bind is rejected at boot. With a key set, every request must present it, compared in constant time. For public exposure still use a reverse proxy + TLS
Channel Connections
- All channel APIs use TLS (HTTPS/WSS)
- Telegram: long polling over HTTPS
- Discord: WebSocket with TLS
- Slack: Socket Mode (WebSocket)
- WhatsApp: Noise protocol encryption
Config Files & Logs (v0.5.1)
- Home files (
config.toml,keys.toml, brain files) are written with owner-only permissions from every write path: the mode is derived from theConfigstruct itself, so a new writer cannot forget it - The daemon log moved off world-readable
/tmpinto~/.opencrabs/logs/ - Secret scrubbing covers all delivery paths, not only chat output
Tool Approval
Tools that modify your system require approval:
- File writes: Shows the file path and diff
- Shell commands: Shows the exact command before execution
- Git operations: Push, commit, branch operations
Auto-approve mode (--auto-approve) bypasses this for automation use cases like cron jobs.
Channel approvals are owner-only since v0.5.1: the Yes / Always / YOLO buttons and text
replies on Telegram, Discord, Slack, and WhatsApp resolve only for the bot owner (canonical
resolver), never for an allowlisted non-owner who happened to trigger the tool. The default
approval_policy is auto-always by design (you are not meant to babysit prompts) because
the channel allowlists (below) are the actual access boundary. To confirm every tool call
instead, set approval_policy = "ask" in [agent].
Data Storage
- All data stored locally in
~/.opencrabs/opencrabs.db(SQLite) - No telemetry or analytics
- No data sent to OpenCrabs servers (there are none)
- Conversation history stays on your machine
Reporting Vulnerabilities
If you discover a security vulnerability, please report it responsibly:
- Email: adolfo@meetneura.ai
- Do not open a public issue for security vulnerabilities
- We will acknowledge receipt within 48 hours
Safety Gates (v0.3.78)
OpenCrabs v0.3.78 introduced a layered safety-gate system:
TOML Bash Blocklist
Shell commands are checked against a TOML-defined blocklist before execution. Dangerous patterns (recursive deletes on root, raw disk writes, fork bombs) are rejected with a clear error. The blocklist is user-extensible and hot-reloads on file change. See Configuration for details.
Secret Redaction
Quoted secrets in agent output are now redacted before delivery. This covers:
- Bearer tokens
- API key patterns
- Colon-token shapes (key: value in YAML-like output)
- Query-param keys
- URL passwords
Redaction fires on all delivery paths (TUI, Telegram, Discord, Slack, WhatsApp), so a secret accidentally echoed by the agent never reaches the chat.
Brain File Verification
Post-write verification (via brain_verify.toml) ensures brain files maintain their structural integrity after RSI writes. Required anchors (H1 title, Owns header) are checked, and writes that break structure are flagged.
Harness-Level Denials (v0.5.1)
Prompt instructions are a request; the harness is a wall. The v0.5.1 hardening batch moved the load-bearing safety rules out of brain-file prose and into code paths that run even when the model is jailbroken or an RSI pass weakens a prompt file:
- Confidential-path deny on
read_file: resolved paths matching the agent’s ownkeys.toml, anything under a.ssh/directory, SSH private-key names,.envfiles,.pem/.key/.pfxmaterial,/etc/shadow, or files that name themselves a credential are refused before a byte is read. Public keys and ordinary files are unaffected, and../~spelling does not change the verdict. - One SSRF guard for every fetch tool:
web_scrapeandhttp_requestsharebrain::tools::ssrf: cloud metadata endpoints (by name as well as IP), RFC1918/LAN, IPv6 link-local, the unspecified addresses, CGNAT100.64.0.0/10, and IPv4-mapped IPv6 forms are blocked; domains are DNS-resolved and every answer checked before the request, and each redirect hop is re-validated, so a public-looking name or a 302 cannot smuggle an internal target. Loopback stays deliberately allowed: a local-first agent legitimately reaches the operator’s own machine. - The bash blocklist floor everywhere:
execute_codeand dynamic shell tools now pass through the same blocklist asbash(hardcoded plus the user TOML list), checked before writing or running, for every language, sinceos.system/subprocesscan carry the same command. Dynamic tools also cannot be named like core tools:add_toolrefuses to create an unguarded stand-in forbash,read_file,evolve, and friends. - Deny-by-default channel allowlists: an unconfigured Discord or Slack channel now
refuses everyone (matching Telegram): empty
allowed_users/allowed_rolesis no longer “accept all”. On WhatsApp an emptyallowed_phonesno longer elevates strangers to owner. Details per channel in Channels overview. - Verified self-update:
/evolvechecks the releaseSHA256SUMSagainst the download before swapping the binary, and the download host is pinned, so a redirected release asset cannot hot-swap an unverified binary.
These complement the v0.3.78 safety gates above; together they mean a stranger who reaches a channel, or a prompt injection that reaches a tool, meets code that refuses, not prose that asks politely.