The 11 tools available to the daemon's AI agent — capabilities, danger levels, and approval requirements
Tools
The agent has access to 11 tools for interacting with the user's machine. Each tool has a danger classification that determines whether it needs user approval before execution.
Danger levels
| Level | Approval required | Description |
|---|---|---|
safe | No | Read-only operations that can't modify state |
moderate | Yes (by default) | Operations that modify files or access sensitive data |
dangerous | Yes (always) | Operations that execute arbitrary code or make irreversible changes |
The autoApprove option in agent:start can override approval requirements for safe and moderate tools. dangerous tools always require approval unless explicitly overridden.
Tool reference
shell
Execute a shell command via bash -c.
| Property | Value |
|---|---|
| Danger | dangerous |
| Timeout | 30 seconds |
| Streams output | Yes (agent:shell_output events) |
{
"tool": "shell",
"input": { "command": "npm test -- --coverage" }
}The shell tool spawns a bash process and streams stdout/stderr in real-time via agent:shell_output events. The agent receives the full output as the tool result.
python
Execute Python code via python3 -u -c.
| Property | Value |
|---|---|
| Danger | dangerous |
| Timeout | 60 seconds |
| Streams output | Yes |
{
"tool": "python",
"input": { "code": "import json\nprint(json.dumps({'status': 'ok'}))" }
}read_file
Read the contents of a file.
| Property | Value |
|---|---|
| Danger | safe |
| Timeout | — |
| Streams output | No |
{
"tool": "read_file",
"input": { "path": "src/auth.ts", "startLine": 1, "endLine": 50 }
}Optional startLine and endLine parameters for partial reads. Paths are resolved relative to the session's cwd.
write_file
Write content to a file (creates or overwrites).
| Property | Value |
|---|---|
| Danger | moderate |
| Timeout | — |
| Streams output | No |
{
"tool": "write_file",
"input": { "path": "src/utils.ts", "content": "export function add(a: number, b: number) {\n return a + b;\n}\n" }
}list_directory
List files and directories at a given path.
| Property | Value |
|---|---|
| Danger | safe |
| Timeout | — |
| Streams output | No |
{
"tool": "list_directory",
"input": { "path": "src/components" }
}search_files
Search for files matching a pattern or containing text.
| Property | Value |
|---|---|
| Danger | safe |
| Timeout | — |
| Streams output | No |
{
"tool": "search_files",
"input": { "query": "TODO", "path": "src/", "pattern": "*.ts" }
}open_url
Open a URL in the default browser.
| Property | Value |
|---|---|
| Danger | moderate |
| Timeout | — |
| Streams output | No |
{
"tool": "open_url",
"input": { "url": "http://localhost:3000" }
}screenshot
Capture a screenshot of the current screen.
| Property | Value |
|---|---|
| Danger | safe |
| Timeout | — |
| Streams output | No |
{
"tool": "screenshot",
"input": {}
}Implementation varies by platform:
- macOS:
screencapture -x /tmp/screenshot.png - Linux:
import -window root /tmp/screenshot.png(ImageMagick)
Returns the screenshot as a base64-encoded PNG.
clipboard_read
Read the current system clipboard contents.
| Property | Value |
|---|---|
| Danger | moderate |
| Timeout | — |
| Streams output | No |
{
"tool": "clipboard_read",
"input": {}
}- macOS:
pbpaste - Linux:
xclip -selection clipboard -o
clipboard_write
Write text to the system clipboard.
| Property | Value |
|---|---|
| Danger | moderate |
| Timeout | — |
| Streams output | No |
{
"tool": "clipboard_write",
"input": { "text": "copied content" }
}- macOS: pipes to
pbcopy - Linux: pipes to
xclip -selection clipboard
notify
Send a desktop notification to the user.
| Property | Value |
|---|---|
| Danger | safe |
| Timeout | — |
| Streams output | No |
{
"tool": "notify",
"input": { "title": "Task complete", "message": "All tests passing" }
}Tool result format
Every tool returns a result in this shape:
interface AgentToolResult {
toolCallId: string; // ID of the tool call this result belongs to
tool: string; // Tool name
success: boolean; // Whether execution succeeded
output: string | null; // Tool output (file contents, command output, etc.)
error: string | null; // Error message if failed
durationMs: number; // Execution time in milliseconds
}Approval flow
When a tool requires approval:
- The daemon emits
agent:approval_requiredwith the tool call details - The session enters
waiting_approvalstate — the agentic loop pauses - The client shows an approval UI (Allow / Deny buttons)
- User decides:
- Allow → client sends
agent:approve→ daemon executes the tool → loop continues - Deny → client sends
agent:deny→ daemon returns an error result to the LLM → loop continues (agent adapts)
- Allow → client sends
The agent is designed to handle denials gracefully — it will try alternative approaches or ask the user for guidance.
Git worktree isolation
When configured, the agent can run in an isolated git worktree:
~/.codmir/worktrees/{session-id}/This creates a fresh checkout on a branch named codmir/{session-id}. The agent's file modifications are isolated from your working directory. After the session, the worktree is:
- Preserved if there are uncommitted changes (user can review and merge)
- Removed if no changes were made
This is useful for experimental or high-risk tasks where you want the agent to work without touching your main tree.