@coder envelope.
Atomic tools coexist with
@coder — @coder read/search/tree keeps working. The difference is that the LLM can now pick the narrow tool (more precise) when it wants to execute a single read-only operation.The four tools
@read — file read
Equivalent to Claude Code’s Read. Flat schema:
path, filepath. Line range, head/tail, and base64 encoding supported. Output cap: 80 000 chars (versus the 30k global) — large files (~1500 lines) fit whole.
@search — regex search
Equivalent to Claude Code’s Grep. Flat schema:
pattern, query, regex. Include glob and configurable result cap. Output cap: 60 000 chars.
@tree — directory tree
Flat schema (all optional — {} lists the cwd):
@todo — task plan management
Parity with Claude Code’s TodoWrite. Three subcommands:
pending | in_progress | completed | failed. The @todo adapter routes into the active AgentMode’s cli/agent/task_tracker.go.
Why narrow tools matter
@coder (fat) | @read / @search / @tree (narrow) | |
|---|---|---|
| LLM accuracy | Single schema, model picks wrong subcommand | Dedicated schema, ~10pp more accurate |
| Parallelization | No (mixes read and write) | Yes (IsConcurrencySafe=true) |
| Permission gate | Falls through to policy regex | Auto-allow via capability |
| Streaming UX | Generic “@coder read" | "Reading: main.go” |
| Truncation | Global 30k | Per-tool 50k/60k/80k |
Transactional multipatch
New in@coder:
JSON Schema validation
Every atomic plugin ships a draft-2020-12 JSON Schema. The agent loop validates LLM args before callingExecute. Failures return ToolResult{IsError:true, ErrorCode:"InvalidArgs"} with the offending JSON path named — the model gets clear feedback instead of a panic/empty result.
Legacy plugins without JSONSchemaAware bypass validation (purely additive change).
Capability-aware permission gate
Thepolicy_manager now consults the capability resolver before falling through to the default ActionAsk:
- Deny rules (strictest)
- Safety-immune (always asks)
- Explicit allow/ask (longest pattern wins)
- Read-only exec heuristic
- NEW: capability gate — auto-allow plugins with
IsReadOnly=true - Default: Ask
@read, @search, @tree, @websearch, @webfetch (GET), @scheduler query/list run without a security prompt while write/exec stay gated.