crabcode

OpenCode Compatibility

What OpenCode configuration works in crabcode and what is crabcode-specific.

Treat it like OpenCode

Don't think CrabCode as another agent config to manage, just treat it like configuring OpenCode.

Most OpenCode docs apply directly: config is JSON/JSONC, project assets live under .opencode/, and command files use the OpenCode markdown command format. crabcode adds a small terminal-specific layer for notifications and theme selection.

Compatibility map

Blank cells mean that runtime behavior is not supported by that project today. ❌ means crabcode intentionally ignores the OpenCode setting.

Area / settingOpenCodecrabcodeNotes
model✅✅Default model when no persisted active model is set.
small_model / smallModel✅✅Not enabled by default. When configured, crabcode uses it for lightweight tasks such as session title generation.
default_agent✅✅Startup agent when no persisted agent is set. Shift-tab remembers the last primary agent.
command config✅✅JSON-defined slash commands with template, description, agent, model, and subtask.
.opencode/commands/*.md✅✅Markdown command files, including nested names.
.crabcode/commands/*.md✅crabcode-specific command overrides.
$ARGUMENTS, $1, $2✅✅The final positional placeholder consumes the rest of the arguments.
!`command` in command files✅✅Runs from the project root and injects command output.
@path file references in commands✅✅File or directory content is appended to the rendered prompt.
AGENTS.md project instructions✅✅crabcode walks up from the working directory and prefers AGENTS.md over CLAUDE.md in the same directory.
~/.config/crabcode/AGENTS.md✅crabcode global instructions.
Claude Code fallback rules✅✅CLAUDE.md and ~/.claude/CLAUDE.md are read unless disabled by crabcode environment flags.
Skills✅✅Reads SKILL.md files from OpenCode, crabcode, Claude, and .agents skill roots.
agent.<name>.tools✅✅Tool allowlists feed the runtime agent registry.
agent.<name>.permission✅✅Agent-specific permission rules override global rules.
agent.<name>.task_permissions✅✅Controls which subagents an agent may invoke through Task.
agent.<name>.steps / maxSteps / max_steps✅✅Registry max-step values apply to primary agents and subagents.
agent.<name>.mode / hidden✅✅Modes control primary/subagent use; hidden agents are omitted from prompt and autocomplete listings.
agent.<name>.model / temperature / top_p✅partialSubagent model overrides are applied for Task/@agent; sampling settings are parsed but not yet applied.
Markdown agent files✅✅.opencode/agents/*.md frontmatter is parsed; body content becomes agent instructions.
provider.<id>.options.timeout✅partialInteger milliseconds or false to disable timeout.
provider.<id> using @ai-sdk/openai-compatible✅✅When options.baseURL is configured, crabcode requests its OpenAI-compatible /v1/models endpoint for /models. Discovered models are added alongside manually configured models; manually configured model metadata takes precedence; unsupported endpoints leave manual models unchanged.
theme✅✅In crabcode config files only. OpenCode config theme is ignored by crabcode.
notifications✅crabcode-specific sounds, desktop notifications, and terminal alert signals such as Zed tab dots.
fileActions.open✅crabcode-specific Open action with shell templates and ordered filename/text overrides. See File Actions.
editor✅Legacy opener configuration remains supported; fileActions.open replaces it when supplied. See migration.
mcp✅✅Uses the OpenCode MCP config shape. Enabled servers are connected at runtime and their tools are exposed as crabcode tools.
permission✅✅Global tool permission rules are enforced during AI SDK tool execution.
instructions✅✅Loads the listed files relative to the project root (or from absolute and ~/ paths) and appends their contents to the system prompt. Unreadable files produce a config warning.
tools✅✅Global tool enable/disable map. Disabled tools are removed before agent-specific tool policies are applied.
compaction✅✅Applies auto and reserved to persisted TUI/ACP sessions; prune also applies to print and subagent requests. Manual /compact remains available when auto-compaction is disabled.
watcher✅✅Controls file suggestions in command autocomplete. Use false to disable them or { "ignore": ["path"] } to exclude paths.
formatter✅Accepted and parsed by file extension, but configured formatter commands are not run yet.
disabled_providers✅✅Removes the listed provider IDs from model discovery and selection.
enabled_providers✅✅Restricts model discovery and selection to the listed provider IDs. disabled_providers takes precedence when both are set.
keybinds✅❌Ignored because crabcode does not use OpenCode keybind config.
share✅❌Ignored.
tui✅❌Ignored. crabcode owns its terminal UI.
server✅❌Ignored.
plugin✅❌Ignored.
custom tools (tool, custom_tools, customTools)✅❌Ignored.

MCP notes

Use the OpenCode MCP docs for the config shape. crabcode reads OpenCode v2 mcp.servers.<name> and still accepts the older mcp.<name> map. Local stdio servers and remote HTTP servers are supported, and discovered MCP tools are registered into the normal tool list. Only enabled servers are exposed to the model. disabled: true (OpenCode v2) and enabled: false both keep a server configured without connecting it. The /mcp toggle drops those schemas from the next request.

In /mcp, space toggles a server. Enter opens that server: status, auth, URL or command, the config file that won (project or global, crabcode or OpenCode), capabilities, and tool count, then reauthenticate, clear authentication, or enable/disable. Reauthenticate opens another page. Enter opens the default browser; the link row copies it. crabcode mcp auth <name> does the same from the shell. Tokens are stored in ~/.local/state/crabcode/mcp-auth.json.

crabcode mcp add writes mcp.servers.<name> into the crabcode config layer: the project file (.crabcode/crabcode.jsonc when none exists yet) or, with --global, the global crabcode file. Adding to a file that already uses mcp.<name> keeps that legacy entry and writes new servers under mcp.servers. Updating a legacy name replaces it in place.

crabcode mcp add context7 --url https://mcp.context7.com/mcp
crabcode mcp add everything --env LOG_LEVEL=debug -- npx -y @modelcontextprotocol/server-everything
crabcode mcp add context7 --url https://mcp.context7.com/mcp --header 'CONTEXT7_API_KEY={env:CONTEXT7_API_KEY}'

MCP server enabled flags are respected. The remote UI can toggle configured servers, and those overrides are persisted in crabcode preferences. MCP resources are not exposed as separate resource-list/read tools yet; tool calls are supported.

Use the OpenCode docs