-
Notifications
You must be signed in to change notification settings - Fork 1
Tool System
Snowy edited this page Feb 15, 2026
·
1 revision
The SnCode agent has access to a set of sandboxed tools for interacting with your project files and running commands.
| Tool | Access | Description |
|---|---|---|
list_files |
Read | Lists files and directories at a given path. Returns name and type (file/dir). Filters out .git entries. |
read_file |
Read | Reads the full text content of a file. Maximum file size: 300 KB. |
write_file |
Write | Writes complete content to a file. Creates parent directories if needed. |
edit_file |
Write | Performs exact string replacement in a file. Requires a unique match unless replaceAll is set to true. |
| Tool | Access | Description |
|---|---|---|
glob |
Read | Finds files matching a glob pattern (e.g., **/*.ts). Uses picomatch. Returns up to 500 results. |
grep |
Read | Searches file contents using regular expressions. Returns up to 200 matches. Skips binary files. Lines capped at 500 characters. |
| Tool | Access | Description |
|---|---|---|
run_command |
Exec | Runs a shell command in the project root directory. 90-second timeout. Output truncated at 200 KB stdout / 80 KB stderr. |
| Tool | Access | Description |
|---|---|---|
spawn_task |
Meta | Launches a sub-agent for parallel work. See Sub-Agents & Tasks. |
load_skill |
Read | Loads a skill's SKILL.md content by ID. See Skills System. |
All file operations use resolveInsideProject() which:
- Resolves the path relative to the project root
- Verifies the resolved path is still within the project root
- Rejects any path that would escape (e.g.,
../../etc/passwd)
| Operation | Limit |
|---|---|
read_file |
300 KB |
file:read IPC |
500 KB |
| Untracked diff content | 50 KB |
The safeCommand() function automatically injects exclusion flags for common recursive search commands:
| Command | Auto-Injected Flags |
|---|---|
grep -r |
--exclude-dir={node_modules,.git,...} |
rg (ripgrep) |
--glob=!{node_modules,.git,...} |
find |
-not \( -path ...node_modules -prune \) for each heavy dir |
| Stream | Limit |
|---|---|
| stdout | 200 KB |
| stderr | 80 KB |
If output exceeds the limit, it is truncated with a ... [truncated] marker.
These directories are automatically skipped in file tree listings, glob searches, and command safety:
node_modules, .git, .next, .nuxt, dist, build, .output, __pycache__, .venv, venv, .tox, vendor, .bundle, coverage, .cache, .turbo, .parcel-cache
SnCode detects the best available shell on each platform:
| Platform | Priority |
|---|---|
| Windows |
pwsh (PowerShell 7+) > powershell (5.1) > cmd.exe
|
| macOS |
$SHELL environment variable, or /bin/zsh
|
| Linux |
$SHELL environment variable, or /bin/bash
|
- The AI model returns one or more tool calls in its response
- Sequential tools (
list_files,read_file,write_file,edit_file,glob,grep,run_command,load_skill) execute one at a time -
spawn_taskcalls are batched and run in parallel (up tomaxConcurrentTasks) - Tool results are sent back to the model as tool result messages
- The loop repeats until:
- The model responds with only text (no tool calls)
- The
maxToolStepslimit is reached - The run is cancelled by the user
SnCode Wiki
Getting Started
User Guide
Agent System
Technical
Support