Wiki / Use
Tools#
Everything PortCode can do is a tool. The app, the agent and the command line share one list, so anything the agent can do you can also run yourself:
portcode tool read '{"path": "src/main.rs", "limit": 40}'
portcode tool venv '{"action": "status"}'
Tools never panic, never prompt on stdin and never hang: they have deadlines, capped output, and errors that tell the model how to fix the call. Each agent sees only the tools its role needs; /tools in the app prints the groups.
Reference#
The table is generated from the tool definitions (first sentence of each description).
| Tool | What it does |
|---|---|
read | Read a text file (numbered lines) or list a directory. |
ls | List a directory (directories end with /). |
glob | Find files by glob pattern, newest first. |
grep | Search file contents with a regular expression. |
write | Create a file or fully replace one. |
edit | Replace exact text in a file. |
todowrite | Keep the task list for multi-step work. |
webfetch | Fetch a http(s) URL and return readable text (HTML tags removed). |
skill | Load a skill's instructions, or one of its reference files. |
task | Delegate a self-contained job to a sub-agent with a fresh context and get its final answer. |
blocked | Stop because you need a decision or input only the user can give (licence, missing file, ambiguous requirement, permission refused). |
survey | Inventory a source tree before porting: languages/LOC, build files, engine and graphics-API hints, assets, tests/CI, risk hotspots (globals, raw pointers, threads, RNG). |
pin | Pin the exact original build (sha256, size, format, version) to .portcode/reference.lock.json and verify it later. |
evidence_add | Record one fact about the original in the evidence ledger. |
evidence_list | List ledger records, optionally by subject prefix or only open unknowns. |
parity | Compare golden outputs recorded from the ORIGINAL with the port's outputs (numbers within tolerance, PNG per-channel). |
screenshot | Run a command and save its real output as a terminal screenshot (SVG) in docs/screenshots/, then record it as an observation in the ledger with the output's sha256. |
site_build | Generate the GitHub Pages site (docs/site/) from docs/PORT.md, the evidence ledger and docs/screenshots/. |
scaffold | Create a Rust workspace for a port: <name>-core (headless) + <name> (binary), docs/PORT.md, tests/golden, docs/screenshots. |
re_status | List the reverse-engineering engines (Capstone, Unicorn, Ghidra, ImHex, rizin…), whether each is installed, and the current mode (clean-room or deep). |
re_install | Install a reverse-engineering engine into PortCode's engines folder (pip packages into a private venv; Ghidra and ImHex from their official releases, sha256-verified). |
disasm | Deep mode. |
emulate | Deep mode. |
decompile | Deep mode. |
functions | Deep mode. |
unity | Deep mode. |
dotnet | Deep mode. |
unity_assets | Deep mode. |
hexdump | Deep mode. |
team | Run team members at the same time and get every answer back. |
venv | Python virtual environment in .venv. |
Groups#
| Group | Tools |
|---|---|
| Files | read, ls, glob, grep, write, edit |
| Run | bash, venv, todowrite, webfetch, skill, task, team, blocked |
| Proof | survey, pin, evidence_add, evidence_list, parity, screenshot, scaffold, site_build |
| Deep | re_status, re_install, disasm, emulate, decompile, functions, hexdump, unity, dotnet, unity_assets |
| More | tools from MCP servers listed in portcode.json |
The deep tools look inside the original and are available only in deep mode.
MCP#
Add MCP servers under "mcp" in portcode.json and their tools join the list for agents that allow MCP tools:
{ "mcp": { "rea": { "command": ["npx", "-y", "rea-agents@latest", "mcp"] } } }
PortCode can also be an MCP server itself: portcode mcp serves its tools to Claude Code or Codex. See Claude Code and Codex.
Skills#
A skill is a folder of instructions the agent loads on demand with the skill tool. PortCode ships rustport, the porting method. portcode skill list, portcode skill show rustport and portcode skill export <dir> manage them.