@diegopetrucci/pi-diff-summarizer0.1.0
A standalone pi extension that adds a read-only diff_summarizer subagent tool that summarizes a diff and highlights review risk in an isolated child agent.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
diff-summarizer
Adds a diff_summarizer subagent tool that adapts The Last Harness diff-summarizer prompt into a standalone pi extension.
Use it to get a terse, high-signal summary of a change set before review. The subagent uses read-only built-in tools plus any configured MCP tools, summarizes what changed, flags risky areas with evidence, and reports which requirements appear satisfied, violated, or unclear. Blockers are reported in the final result; the subagent cannot ask follow-up questions.
Install
Standalone npm package
pi install npm:@diegopetrucci/pi-diff-summarizer
Collection package
pi install npm:@diegopetrucci/pi-extensions
GitHub package
pi install git:github.com/diegopetrucci/pi-extensions
Then reload pi:
/reload
diff_summarizer tool behavior
The tool accepts:
diff— optional diff or patch to summarize; when omitted, the subagent collectsgit diff,git diff --cached, andgit status --short --untracked-files=allin the checkout and inspects relevant untracked filesrequirements— optional requirements or ticket text to check the change against; when omitted, inferred intent is labeled low confidencecwd— optional working directory (checkout); defaults to the current session directory
The subagent runs in-process in an isolated child session with:
- the current session model (no automatic model selection and no persisted
/configcommands); mediumthinking, clamped to the model's supported levels;- read-only built-in tools:
read,grep,find,ls, and guardedbash; - configured MCP tools (run without confirmation in the subagent; may have side effects; use for evidence gathering only; requires host Pi >=1.0.4; older hosts degrade to no MCP, no error); the global
mcp.jsonalways applies; a project.pi/mcp.jsonis loaded only when the host session has already trusted the project; - a local-checkout path guard for file inspection;
- a bash guard that allows only direct read-only
git,gh, orpwdinvocations.
The output is short: diff source, files touched, what changed, risky areas touched, and requirement status. The tool appends a run-details suffix with the model, effective thinking level, turn count, tool calls, duration, working directory, and tools used.
Read-only guarantees
- The subagent is explicitly instructed not to modify anything.
- 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. - Runtime guards apply to built-in tools only; configured MCP tools pass the guard, run without confirmation, and are limited only by prompt guidance.
- Built-in file-inspection tools are preferred over shell commands for local files.
Example
Use diff_summarizer to summarize my current changes against these requirements:
{
"requirements": "Add a --json flag to the status command and cover it with a test."
}
Limitations
- The subagent has an 8-turn and 8-minute budget and a default 30-second timeout per
bashcall (applied when the model does not set one); tool use is disabled on the final turn so it can answer. - With no
diff, the summary depends on the checkout containing the change set. gh-based inspection is available only when GitHub CLI is installed and authenticated; the tool works on local changes without it.