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).

ToolWhat it does
readRead a text file (numbered lines) or list a directory.
lsList a directory (directories end with /).
globFind files by glob pattern, newest first.
grepSearch file contents with a regular expression.
writeCreate a file or fully replace one.
editReplace exact text in a file.
todowriteKeep the task list for multi-step work.
webfetchFetch a http(s) URL and return readable text (HTML tags removed).
skillLoad a skill's instructions, or one of its reference files.
taskDelegate a self-contained job to a sub-agent with a fresh context and get its final answer.
blockedStop because you need a decision or input only the user can give (licence, missing file, ambiguous requirement, permission refused).
surveyInventory a source tree before porting: languages/LOC, build files, engine and graphics-API hints, assets, tests/CI, risk hotspots (globals, raw pointers, threads, RNG).
pinPin the exact original build (sha256, size, format, version) to .portcode/reference.lock.json and verify it later.
evidence_addRecord one fact about the original in the evidence ledger.
evidence_listList ledger records, optionally by subject prefix or only open unknowns.
parityCompare golden outputs recorded from the ORIGINAL with the port's outputs (numbers within tolerance, PNG per-channel).
screenshotRun 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_buildGenerate the GitHub Pages site (docs/site/) from docs/PORT.md, the evidence ledger and docs/screenshots/.
scaffoldCreate a Rust workspace for a port: <name>-core (headless) + <name> (binary), docs/PORT.md, tests/golden, docs/screenshots.
re_statusList the reverse-engineering engines (Capstone, Unicorn, Ghidra, ImHex, rizin…), whether each is installed, and the current mode (clean-room or deep).
re_installInstall a reverse-engineering engine into PortCode's engines folder (pip packages into a private venv; Ghidra and ImHex from their official releases, sha256-verified).
disasmDeep mode.
emulateDeep mode.
decompileDeep mode.
functionsDeep mode.
unityDeep mode.
dotnetDeep mode.
unity_assetsDeep mode.
hexdumpDeep mode.
teamRun team members at the same time and get every answer back.
venvPython virtual environment in .venv.

Groups#

GroupTools
Filesread, ls, glob, grep, write, edit
Runbash, venv, todowrite, webfetch, skill, task, team, blocked
Proofsurvey, pin, evidence_add, evidence_list, parity, screenshot, scaffold, site_build
Deepre_status, re_install, disasm, emulate, decompile, functions, hexdump, unity, dotnet, unity_assets
Moretools 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.

Edit this page on GitHub