Skip to main content
CodingAgent is a ReActAgent subclass preconfigured for software-engineering tasks. It bundles a curated tool set, system prompt, and harness behavior — file I/O, search, shell, web, todos, plan mode, and subagent dispatch — so you can spin up a working coding assistant in a few lines.
The agent runs against your local shell by default. Pass an explicit sandbox= (e.g. a DockerSandbox) to run in isolation.
The same template works with any chat client Motus supports — AnthropicChatClient, OpenAIChatClient, OpenRouterChatClient, GeminiChatClient. Swap the client; the agent code stays the same.

What’s included

When you construct CodingAgent with no special flags, the agent gets the following tools: The system prompt encodes a clear working philosophy: prefer dedicated tools over bash, parallel tool calls when independent, file references as path:line, anti-overengineering, careful handling of destructive actions, and so on.

Customizing the system prompt

There are five ways to customize the prompt, ordered from least to most invasive. The first is the recommended default for project-scoped instructions. Drop a markdown file at the project root and CodingAgent picks it up automatically, wrapping it in a <system-reminder> block at the end of the system prompt. Use this for project-specific rules that should travel with the codebase.
CodingAgent walks the file at project_root/AGENTS.md (defaults to current working directory) plus a fallback CLAUDE.md. Both are included if both exist; AGENTS.md is rendered first.
The convention matches the AGENTS.md standard, so the same file is portable across any agent that follows it.
Prefer AGENTS.md over inline customization whenever the rules are about the project rather than your personal preferences. The file lives in git, so the rules apply to teammates and CI agents automatically.

2. system_prompt_extra — append your own block

For per-agent rules that don’t belong in AGENTS.md (personal preferences, agent-specific roles), append text to the end of the default prompt:
The extra block lands after the default prompt and after any AGENTS.md injection.

3. Render then patch

When you want to keep most of the default but rewrite a specific section, render the prompt explicitly and edit the string before passing it back:

4. system_prompt — full replacement

Pass any string to replace the default entirely. Use when you want a completely different agent personality but still want the CodingAgent tool wiring. Note: AGENTS.md injection is skipped when system_prompt is passed explicitly — you’d need to call build_system_prompt() and incorporate the project context yourself if you want both.

5. Subclass CodingAgent

For fundamental shape changes — different file conventions, additional auto-injected sections, custom prompt-build pipeline — subclass and override. Reach for this only when the four above don’t fit.
Rule of thumb: project rules → AGENTS.md. Personal/agent-specific rules → system_prompt_extra. Section rewrites → render+patch. Full personality change → system_prompt. Structural change → subclass.

Toggling features

All capability sets are keyword flags. Pass False to remove a tool group.

Adding extra tools

Pass extra_tools=[...] to add tools alongside the builtins:
To replace the default tools entirely, pass tools=[...] instead. (extra_tools, enable_web, enable_subagents, etc. are ignored when tools= is set.)

Sandboxing

By default CodingAgent uses a LocalShell sandbox — actions affect your real filesystem. For isolated runs:
The same agent code works against LocalShell, DockerSandbox, or CloudSandbox — only the sandbox arg changes.

Constructor reference

All keyword arguments after model_name: All other ReActAgent keyword arguments pass through unchanged.