Contents (10)

moha gives Claude 16 tools. Each one declares its side effects as an EffectSet — the permission system uses these to decide whether to auto-approve or prompt you before execution.

All filesystem tools are scoped to the directory where you launched moha. Paths that resolve outside the workspace are refused.


Tool Catalog

ToolEffectsTimeoutStreaming
readReadFs20s
editReadFs + WriteFs20s
writeWriteFs20s
bashExecsubprocess
grepReadFs45s
globReadFs30s
list_dirReadFs20s
todoPure5s
web_fetchNet30s
web_searchNet20s
find_definitionReadFs30s
diagnosticsExecsubprocess
git_statusReadFs20s
git_diffReadFs20s
git_logReadFs20s
git_commitWriteFs30s

Command Execution

bash executes inside bwrap (Linux) / sandbox-exec (macOS) — workspace + system libs + network are reachable; ~/.ssh, /etc, other projects are read-only.

File Editing

edit applies a targeted string replacement to an existing file. Shows you a diff before applying. Preferred over write for modifications — the model is nudged toward surgical edits rather than full-file rewrites.

All file writes are atomic: writefsyncrename. A crash mid-write never leaves a half-written file.

MCP Tools

moha supports the Model Context Protocol. Add servers globally in ~/.config/moha/mcp.json or per-project in .moha/mcp.json. moha launches them at startup and adds their tools to the catalog.


Permission Profiles

moha uses an effect-based permission system. Tools declare what they do (read files, write files, hit the network, run subprocesses), and a single policy function decides whether to auto-approve or prompt you — based on your active profile.

Three profiles control how much autonomy Claude gets. Cycle between them with S-Tab during a session.

Ask (default)

Read-only inspection is trusted (otherwise every read/grep/glob would prompt and the agent loop becomes unusable). Everything that mutates state, runs code, or touches the network requires your approval.

moha --profile ask

Write (autonomous)

Everything auto-approves. Claude reads, writes, runs commands, and hits the network without asking. Use this when you trust the model and want maximum speed.

moha --profile write

Minimal (locked down)

Prompts for everything that touches the outside world — including file reads. Only pure in-memory operations (todo) auto-approve.

moha --profile minimal

Trust Matrix

The complete permission table. The policy is a constexpr function verified by static_assert at compile time.

EffectWriteAskMinimal
Pure✓ auto✓ auto✓ auto
ReadFs✓ auto✓ auto⚠ prompt
WriteFs✓ auto⚠ prompt⚠ prompt
Net✓ auto⚠ prompt⚠ prompt
Exec✓ auto⚠ prompt⚠ prompt

Key properties:

  1. Write is fully autonomous. Every effect is allowed, no prompt is ever shown.
  2. Ask trusts reads. ReadFs and Pure auto-approve. Exec/WriteFs/Net prompt.
  3. Minimal prompts for everything except Pure. Even file reads require approval.
  4. Exec dominates. Any tool with Exec prompts under every non-Write profile, regardless of other effects.

Parallel Safety

When Claude dispatches multiple tool calls, the scheduler checks effect compatibility:

  • ReadFs + ReadFs: safe — read-read never races
  • ReadFs + Net: safe — no shared state
  • WriteFs + anything: serialized — filesystem mutations need exclusive access
  • Exec + anything: serialized — model controls what the subprocess does

This rule is derived from the capability model and verified at compile time, not sprinkled through the runtime.