The exact contract of clodex's Bash, Read, Edit, Write, TaskStop and SetAgentAlias tools.

The tool names, parameters and messages follow Claude Code. Differences come from claude.ai’s limits: a tool call must finish within 240 seconds, and a result can be at most about 150,000 characters.

Tool Parameters Behaviour
Bash command, timeout? (ms), description?, run_in_background? Runs in your shell: $SHELL if it is bash or zsh, otherwise bash; Git Bash on Windows. stdout and stderr are combined. The default timeout is 120 s, capped at 230 s. A command still running at its timeout moves to the background (unless it starts with sleep), as in Claude Code. Output up to 30,000 characters comes back inline. Longer successful output is saved to a file, and the result gives its path and a 2 KB preview. Failed commands get a head-and-tail excerpt and Exit code N. Exit 1 from grep, rg, find, diff, test and git diff is not a failure. A cd in a command that exits 0 carries over to the next command in the same conversation. Environment variables don’t persist.
Read file_path, offset?, limit? cat -n numbering, 2,000 lines by default, lines cut at 2,000 characters. Returns PNG, JPEG, GIF and WebP as images. Refuses directories and binary files with Claude Code’s messages. A whole-file read over about 25,000 tokens returns the first page as a PARTIAL view, which doesn’t count as having read the file. Files over 256 KB need offset and limit.
Edit file_path, old_string, new_string, replace_all? Exact string replacement. Fails with Claude Code’s errors if the file wasn’t read in this conversation, the string isn’t found, the string matches more than once without replace_all, or the two strings are identical. If the file changed on disk since it was read, the edit still applies when old_string matches exactly and uniquely, and the result says to re-read it. An empty old_string creates a new file. Handles CRLF files.
Write file_path, content Creates the file and any missing parent directories, or overwrites it. Overwriting needs a prior full Read in this conversation and fails if the file changed since then.
TaskStop task_id Stops a background command and every process it started.
SetAgentAlias alias Optional. Labels this chat’s Liveboard column (2-7 words; empty clears it). It changes nothing else and adds no timeline entry.

Background commands write to ~/.local/state/clodex/tasks/<id>.output. Claude reads that file with Read, as it reads background output in Claude Code. When the command ends, clodex appends [clodex] background command exited with code N to the file and adds a <task-notification> to the conversation’s next tool result.

Per-conversation state. claude.ai’s MCP traffic is stateless: there is no MCP session. Every tool call does carry _meta["com.anthropic/session"], which stays the same across a conversation. clodex keys each conversation’s working directory, read-before-edit tracking and task notifications on it. History and the Liveboard show a 4-character Agent ID derived from a hash of the key, never the key itself. The same chat keeps the same Agent ID after clodex restarts. Calls without the key share one anon Agent.