Skip to content

feat(pi-extension): blocklist-only bash safety + interactive plan file path#222

Merged
backnotprop merged 3 commits intomainfrom
feat/pi-extension-enhancements
Mar 4, 2026
Merged

feat(pi-extension): blocklist-only bash safety + interactive plan file path#222
backnotprop merged 3 commits intomainfrom
feat/pi-extension-enhancements

Conversation

@backnotprop
Copy link
Owner

Summary

Addresses Pi user feedback about two pain points:

  • Tool gating too aggressive: Switched bash safety from allowlist+blocklist to blocklist-only. Commands are now allowed unless they match a destructive pattern (rm, git push, npm install, etc.), fixing false positives that blocked curl/wget for web content fetching. Also preserves tools from other extensions during planning instead of clobbering with a hardcoded list.

  • Plan file path inflexible: /plannotator now accepts an optional path argument (/plannotator plans/auth.md) or prompts interactively via input dialog. New /plannotator-set-file command allows changing the plan file mid-session. Enables monorepo workflows with per-feature plan files.

Test plan

  • /plannotator shows file path input dialog, Enter confirms, Escape cancels
  • /plannotator plans/auth.md enters planning with that path directly
  • /plannotator-set-file docs/design.md changes path mid-session
  • Ctrl+Alt+P toggles without dialog
  • curl https://example.com 2>/dev/null allowed during planning
  • rm -rf /, npm install, git push blocked during planning
  • Other extensions' tools remain visible during planning
  • Session restore from planning phase works correctly

🤖 Generated with Claude Code

backnotprop and others added 3 commits March 4, 2026 13:39
…e path

Switch from allowlist+blocklist to blocklist-only for bash command gating
during planning. Commands are now allowed unless they match a destructive
pattern, fixing false positives that blocked web fetching (curl, wget).

Preserve tools from other extensions during planning instead of clobbering
with a hardcoded tool list. Capture active tools on enter, restore on exit.

Add interactive plan file path selection: /plannotator accepts optional path
arg or shows input dialog. New /plannotator-set-file command for mid-session
path changes. Enables monorepo workflows with per-feature plan files.

Closes #221

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…idance

Delete DESTRUCTIVE_PATTERNS and isDestructiveCommand() from utils.ts.
Remove bash interception from tool_call handler. Bash is now unrestricted
during planning — the system prompt guides the agent not to run destructive
commands. Write/edit file restrictions to the plan file remain enforced.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@backnotprop
Copy link
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@backnotprop backnotprop merged commit a790473 into main Mar 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant