Toggle Codemode in Pi.
Codemode lets Pi handle several tool steps together instead of one at a time. Type
/codemode to switch it on or off at runtime. Requires Pi 0.99.0+. Once this
extension is loaded, no restart or settings edits are needed.
$ pi install npm:pi-codemode-toggle
Reference
What is Pi Codemode?
Codemode is Pi's built-in mode in which the model emits a small JavaScript program
that calls your tools, rather than issuing one tool call per step. Pi ships it as the
builtin:codemode extension; this package gives you runtime control over
it.
How to enable codemode in Pi
- Use Pi
0.99.0or newer - Install the extension:
pi install npm:pi-codemode-toggle - If Pi is already running, run
/reloadonce after installation - Type
/codemodeor/codemode onin a session - Type
/codemode offto switch it back - The footer indicator reads
codemode:onorcodemode:off
Commands
| Command | Effect |
|---|---|
/codemode | Toggle Codemode on or off |
/codemode on | Enable Codemode |
/codemode off | Disable Codemode |
/codemode status | Report the current state |
Argument completions are provided for on, off,
status and toggle.
Troubleshooting
If /codemode is missing, first confirm you are using Pi
0.99.0 or newer. If you installed while Pi was already running, run
/reload once. For project-local installs,
pi install npm:pi-codemode-toggle -l writes the declaration to the
project's .pi/settings.json, which Pi only reads once that folder is
trusted. Install without -l to add the package to
~/.pi/agent/settings.json, or grant trust to the directory. Confirm with
pi list.
Demo: the /codemode command inside a Pi session
args: on off status toggle