Zhat
A coding agent that lives in a VS Code terminal tab. The agent engine is pi (MIT), run in a separate process with VS Code's own Node runtime, so nothing is installed besides the extension.
This is an early build. It runs the agent in a terminal tab, copies an existing Gira setup, and probes what a locked-down machine allows.
Commands
| Command |
What it does |
| Zhat: Run Capability Probe |
Runs a fixed set of checks and opens a log file. |
| Zhat: Open Agent Terminal |
Opens the agent in an editor-area terminal tab. |
| Zhat: Migrate from Gira |
Opens the agent terminal and starts /migrategira. |
| Zhat: Open Agent Config Folder |
Opens the folder that holds models.json and settings.json for the agent. |
Capability probe
Run Zhat: Run Capability Probe from the Command Palette. It takes under a minute, opens the log in an editor and offers Save a copy….
The probe makes no external network request. The only network use is a scripted model endpoint it starts itself on 127.0.0.1.
What it checks:
- VS Code, Electron and Node versions, OS, relevant terminal and proxy settings (set or unset, never values).
- File write/read/delete in the extension's storage folder and the temp folder.
cmd.exe, Windows PowerShell 5.1 and PowerShell 7 (pwsh): version, language mode, execution policy, and whether a static method call, New-Object and a native program run.
- Git Bash: where it is, start time, the core Unix tools, which developer tools are on its
PATH.
- Whether a script file in the temp folder runs from Git Bash,
cmd and each PowerShell.
- VS Code's bundled ripgrep.
- A VS Code extension terminal: opens, reports its size, answers standard terminal queries. A terminal tab flashes open for a second.
- The agent process: starts with VS Code's Node, loads the engine and its two WebAssembly modules, then runs one scripted turn (read a file, run a shell command, answer) against the loopback endpoint.
- The agent's interface, without a visible terminal: it starts, draws, takes a typed prompt and shows a scripted answer.
Every line is PASS, FAIL or INFO. INFO lines report a fact that is not a fault (for example, PowerShell 7 not installed, or the language mode).
What the log contains: versions, paths (home folder and user name replaced), exit codes and the output of the fixed probe commands. It contains no keys, prompts or file contents. Read it before sharing it.
Using the agent terminal
The agent needs a model. If you used Gira, run Zhat: Migrate from Gira (or type /migrategira in the agent terminal). It walks through three steps, each of which asks first and writes nothing when skipped:
- Models. Copies the endpoints and models from your Gira settings. Gira's keys cannot be read by another extension, so VS Code asks you to paste each endpoint's key once; Zhat keeps it in VS Code's secret storage, not in a file. You can then send one test request to the default model.
- Instructions. Adds Gira's global instructions file after Zhat's own instructions.
- Agent settings. Offers Gira's retry count and idle timeout. Skipping is the recommended choice.
Without Gira, put a models.json in the agent config folder, for example:
{
"providers": {
"my-endpoint": {
"baseUrl": "https://example.org/v1",
"api": "openai-completions",
"apiKey": "$MY_ENDPOINT_KEY",
"authHeader": true,
"models": [{ "id": "my-model", "contextWindow": 32768, "maxTokens": 2048 }]
}
}
}
Zhat asks before the agent runs a shell command or changes a file (Allow once, an Always choice that lasts for the session, or Deny). Reading and searching files is not asked about. Approved commands run with your account's access; Zhat is not a sandbox.
Changes to pi
pi 1.7.0 is shipped as published, with small source changes applied by scripts/patch-pi.mjs at build time (the build fails if pi changes underneath them):
- File completion uses VS Code's ripgrep when
fd is not installed.
- Markdown code blocks, lists, headings and emphasis are drawn differently, and the built-in tool rows can be redrawn.
- The interface and the system prompt carry Zhat's name, and the project folder is
.zhat.
- The commands that report bugs to, sign in to or upload sessions to pi's makers are not offered, and the prompt section about pi's own documentation is left out.
See THIRD_PARTY_NOTICES.md.
Development
npm ci --ignore-scripts
npm run build
npm run typecheck
npm run test:host # probe, one scripted terminal turn and a Gira migration inside VS Code 1.129.0
npm run package
test:host uses the VS Code 1.129.0 build under ../Gira/.vscode-test; set ZHAT_VSCODE to another Code.exe to override.