Documentation
Tools
The registry the model can call, and each tool's risk level.
A tool is a function the model may call, with a typed schema and a risk level. The set below is the whole registry - Forge cannot reach anything that is not in it, and cannot reach a file outside the workspace root through any of them.
$ forge tools$ forge tools --jsonThat command prints the registry of the build you have installed. It is the authoritative list; this page is a description of it.
Risk levels
Every tool carries one of three levels. The level is a property of the tool, and it is what the permission policy decides on - not the tool's name and not the model's opinion of how safe a call is.
Observes only. Always runs unattended.
Creates or modifies things the agent can also inspect and fix.
Discards work or reaches outside the workspace. Needs a human.
The split is deliberate: writes are recoverable because the agent can inspect and fix them, while destructive calls throw work away. Only the third class needs a human in the default mode. See Permissions for how a call is decided.
The registry
Filesystem
Reading and changing the workspace. Every path resolves inside the workspace root.
read_filereadRead a UTF-8 text file and return its contents. Supports offset/limit for reading a slice of a large file.
list_directoryreadList directory contents (optionally recursive).
search_filesreadSearch file contents by regex, returning 'path:line: text' matches.
write_filewriteCreate or overwrite a file with the given contents.
edit_filewriteReplace an exact string in a file. Fails if old_string is missing, or matches more than once and replace_all is false.
apply_patchwriteApply unified-diff hunks to an existing file (exact context match).
Shell
One tool, and the reason Forge can prove its work instead of asserting it.
shellwriteRun a shell command in the workspace and return its stdout, stderr, and exit code. Use for tests, builds, linters, and other CLI tools.
Git
Typed operations rather than shelled-out strings. On by default.
git_statusreadShow the working-tree status: staged, unstaged, and untracked files.
git_diffreadShow changes as a unified diff. Use this to review your own edits before committing, and to confirm what a task actually changed.
git_logreadShow recent commit history.
git_showreadShow a commit's message and diff.
git_addwriteStage changes for the next commit.
git_commitwriteCreate a commit. Commits only what is staged unless paths or all_tracked are given. Never pushes.
git_branchwriteList branches, or create/switch to a new branch. Deletion is gated.
git_checkoutwriteSwitch to a branch or commit, or restore specific paths from a ref. Restoring paths discards uncommitted changes and requires approval.
git_revertdestructiveCreate a commit that undoes an earlier commit.
git_resetdestructiveMove HEAD to a ref. 'hard' mode permanently discards uncommitted work.
Boundaries
- Workspace confinement - relative paths resolve against the workspace root, and a path that escapes it is refused rather than clamped.
- Failures are data - a non-zero exit, a missing file, or a patch that does not apply comes back as a result the model must read. It does not crash the run, which is what lets the loop correct itself.
- Truncated output - long stdout is cut with a marker, so one chatty command cannot consume the whole context window.
- Exact-match edits -
edit_filefails when its target string is missing or ambiguous, andapply_patchrequires exact context. A silent partial edit is the one outcome worth ruling out.
A note on the shell tool
shell is the most capable tool in the registry and the one worth understanding. It runs a command in the workspace with a timeout, and returns stdout, stderr, and the exit code as structured data. Tests, builds, linters, and type checkers all arrive through it.
Because a shell can do anything, it is also where the deny list applies. Commands matching a deny pattern are refused in every mode, and a set of recognisably dangerous commands is escalated to destructive so they reach you even in auto. Run it in a container if you want a harder boundary than that.
Extending the registry
Tools are registered through one interface, which is where MCP servers will plug in. That work is not done - nothing outside this page's list is callable today.