pi-codemode-toggle
Toggle Pi's native Codemode tool at runtime.
Package details
Install pi-codemode-toggle from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-codemode-toggle- Package
pi-codemode-toggle- Version
1.1.1- Published
- Oct 26, 2026
- Downloads
- 826/mo · 497/wk
- Author
- iamaamir
- License
- MIT
- Types
- extension
- Size
- 15.9 KB
- Dependencies
- 1 dependency · 1 peer
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-codemode-toggle
A tiny Pi extension to toggle Pi's native codemode tool at runtime
pi install npm:pi-codemode-toggle
/codemode # toggle (this session only, nothing is saved)
/codemode on
/codemode off
/codemode status
Persisting across sessions
Toggling only changes the current session — Pi resets active tools on every
startup, which keeps things minimal by default. If you want your choice to
survive new sessions, persist it explicitly with -l (local to project) or -g
(all projects):
/codemode on -l # enable now + persist for this project (.pi/settings.json)
/codemode off -l # disable now + clear the project's saved default
/codemode on -g # enable now + persist globally (agent settings.json)
/codemode off -g # disable now + clear the global saved default
Demo
https://github.com/user-attachments/assets/b4861e7c-d3ed-4bdc-a663-2461c196fb5a
Why
Pi ships a native Codemode tool (builtin:codemode) that lets the model emit a small Javascript
program instead of one tool call per step.
Enabling or disabling it previously meant editing config and restarting the session.
Related work
Other Pi extensions by the same author:
pi-bifrost — configuration-first model router. Routes each prompt to a model by task tier, cost, speed, or context length.
pi install npm:pi-bifrostsystem-one — provider-neutral System One runtime for TypeScript and Pi. Calibrated
choice,noul, andscoredecisions via Jev, Reflex, or your own provider.pi install npm:pi-system-one