@diegopetrucci/pi-code-reviewer
A standalone pi extension that adds a read-only code_reviewer subagent tool for isolated code reviews.
Package details
Install @diegopetrucci/pi-code-reviewer from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@diegopetrucci/pi-code-reviewer- Package
@diegopetrucci/pi-code-reviewer- Version
0.1.3- Published
- Jul 21, 2026
- Downloads
- 245/mo · 181/wk
- Author
- diegopetrucci
- License
- MIT
- Types
- extension
- Size
- 56.2 KB
- Dependencies
- 0 dependencies · 2 peers
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
code-reviewer
Adds a read-only code_reviewer subagent tool that adapts The Last Harness code-reviewer prompt into a standalone pi extension.
Use it when you want an isolated second-pass review of a proposed change against the local checkout. The tool stays read-only, checks ticket fit and scope first, then looks for diff mismatches, correctness bugs, security/safety issues, unnecessary complexity, and missing validation.
This package is adapted from the TLH code-reviewer workflow for use as a standalone pi extension.
Install
Standalone npm package
pi install npm:@diegopetrucci/pi-code-reviewer
Collection package
pi install npm:@diegopetrucci/pi-extensions
GitHub package
pi install git:github.com/diegopetrucci/pi-extensions
Then reload pi:
/reload
code_reviewer tool behavior
The tool accepts:
task— required review target and success criteriadiff— optional diff, patch, or change summarycontext— optional extra constraints or known risks
When called, it launches an isolated in-memory child agent with:
- no inherited extensions, skills, prompt templates, themes, context files, or agents files;
- an auto-selected review model that prefers contrarian-style opposite-provider and opposite-family candidates before same-provider fallbacks;
- requested thinking taken from the active session when available, otherwise defaulting to
highfor reasoning models andofffor non-reasoning models, then clamped to the selected model's supported level; - read-only tools only:
read,grep,find,ls, and guardedbash; - a local-checkout path guard for file inspection;
- a bash guard that allows only direct read-only
git,gh, orpwdinvocations.
The review prompt prioritizes:
- ticket fit and scope
- diff accuracy
- correctness and regressions
- security and safety
- simplicity and maintainability
- tests and validation gaps
The final output is concise and includes a verdict, findings, validation notes, a scope check, and run details that show the final selected model and effective thinking level.
Read-only guarantees
- The subagent is explicitly instructed not to implement changes.
- Runtime guards block write/edit tools, shell control operators, pipelines, redirection, path traversal outside the checkout, mutating
git/ghcommands,npm/publish commands, and other filesystem mutation. - Built-in file-inspection tools are preferred over shell commands for local files.
Example
Use code_reviewer on this task before merging:
{
"task": "Review ticket pe-7lpt implementation for scope fit and correctness.",
"context": "Focus on whether the new extension stays runtime-only and keeps tools read-only."
}
Limitations
- The subagent has an 8-turn and 8-minute budget.
- The review quality depends on the local checkout matching the change being reviewed.
gh-based inspection is available only when GitHub CLI is installed and authenticated, but the tool can still review local changes without it.