Pi Simplify Code
Extension
Follows eligible code-changing turns with a changed-path-aware request for behavior-preserving simplification, with automatic, disabled, confirm-first, and manual modes.
What it does
Pi Simplify Code follows successful code edits with a focused request for behavior-preserving cleanup.
It combines successful file-changing tool results with dirty Git or Jujutsu paths, filters the candidate list, and asks the model to apply project-specific judgment.
When to reach for it
Invocation: Leave automatic mode enabled, choose confirm-first mode, or run /simplify-code wc for an immediate working-copy pass.
- A coding turn has left implementation changes that would benefit from a separate cleanup pass
- Let the extension send a follow-up after the current agent turn finishes.
- You want to approve each automatic cleanup pass
- Set ask mode and review the changed-path confirmation before continuing.
- You want to review all current dirty code regardless of automatic mode
- Run the manual working-copy command.
What it adds
- An agent-end hook that requests simplification only when eligible non-Markdown paths changed.
- Global and project mode controls for automatic, disabled, and confirm-first behavior.
- A manual working-copy pass that uses the same changed-path collection and filtering pipeline.
How it fits
- Pi Watcher: Pi Watcher starts focused turns from editor comments; Pi Simplify Code starts a cleanup follow-up after code-changing agent work.
Common questions
- Does the extension rewrite code by itself?
- No. It sends a follow-up to the model, which still applies repository instructions and decides which behavior-preserving improvements are appropriate.
- Which paths can appear in the follow-up?
- The list combines successful write, edit, or compatible patch results with current dirty version-control paths. Git-ignored in-worktree paths are removed when Git can evaluate ignore rules.
It’s working if
- An eligible code-changing turn produces one follow-up after Pi becomes idle.
- Markdown-only changes, pending user messages, disabled mode, and the extension's own follow-up do not start another automatic pass.
Source and setup
Provenance
- Project
- Pi Simplify Code
- Origin
- Vedang Manerikar
- Current maintainer
- Vedang Manerikar
- Relationship
- original
- Installed source
git:github.com/vedang/pi-simplify-code- Source path
- View source (
src/index.ts) - Compatibility
- Pi package APIs
- Git or Jujutsu for full working-copy discovery
- License
- WTFPL
- License publication scope
- Source link, independently written summary, attribution, and reviewed behavior claims.
- Reviewed revision
2abab5dfff3269d1ab9be199e9d0e68a27767024- Catalog revision
e0c035a297462c519315abfa1af31a1ed3bd9eef
Setup notes
- Created and maintained by Vedang Manerikar; installed directly from the original WTFPL-licensed Git project.
- Git or Jujutsu improves working-copy discovery, while confirmed file-changing tool results provide a narrower fallback.
- Behavior claims were reviewed against the installed commit rather than a moving branch.
Commands
/simplify-code wc/simplify-code yes/simplify-code no/simplify-code ask/simplify-code global yes|no|ask/simplify-code project yes|no|ask