@jnsahaj/pi-lumen-diff
Pi extension that opens lumen on the diff after each agent turn and feeds annotations back as the next user message
Package details
Install @jnsahaj/pi-lumen-diff from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@jnsahaj/pi-lumen-diff- Package
@jnsahaj/pi-lumen-diff- Version
0.3.0- Published
- May 31, 2026
- Downloads
- not available
- Author
- jnsahaj
- License
- MIT OR Apache-2.0
- Types
- extension
- Size
- 6.1 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@jnsahaj/pi-lumen-diff
A Pi coding agent extension that hooks lumen into the review loop:
agent finishes turn → lumen opens on the diff → annotate inline
→ press `s` → annotations injected as next user message → agent fixes them
The agent never invokes lumen. Pi runs it from the agent_end event,
suspends its own TUI while lumen owns the terminal, then injects the
annotations via pi.sendUserMessage() so they appear as if the user
typed them.
Install
Requires lumen ≥ 2.25 on $PATH (or set LUMEN_BIN).
From source (recommended while iterating):
git clone https://github.com/jnsahaj/lumen.git
mkdir -p ~/.pi/agent/extensions
ln -s "$(pwd)/lumen/integrations/pi/extension" ~/.pi/agent/extensions/lumen
Once-off try without installing:
pi -e $(pwd)/lumen/integrations/pi/extension/index.ts
From npm (post-publish):
pi install npm:@jnsahaj/pi-lumen-diff
Usage
Run /lumen-diff whenever you want to review the working-tree diff.
Annotate, press s → Enter. The agent gets your feedback as its next
prompt.
/lumen-diff
/lumen-diff HEAD~1
/lumen-diff main..-
/lumen-diff --file src/auth.rs
To also pop lumen up automatically after every agent turn, set
LUMEN_AUTO_REVIEW=1.
Config
| Env var | Default | Meaning |
|---|---|---|
LUMEN_BIN |
lumen |
Path to the lumen binary (use absolute if not on $PATH). |
LUMEN_AUTO_REVIEW |
0 |
Set to 1 to pop lumen up after every agent_end. |