@4fu/pi-bin-hints

Detect installed modern Unix-tool replacements (rg, fd, sd, ...) once per session and inject a single stable line into pi's system prompt

Packages

Package details

extension

Install @4fu/pi-bin-hints from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@4fu/pi-bin-hints
Package
@4fu/pi-bin-hints
Version
0.1.3
Published
Jul 20, 2026
Downloads
592/mo · 32/wk
Author
4fu
License
MIT
Types
extension
Size
7.3 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-bin-hints

Detect installed modern Unix-tool replacement binaries (rg, fd, sd, bat, …) once per session and inject a single stable line into pi's system prompt:

Modern Unix-tool replacement binaries available on this machine: rg/fd/sd/bat/...

Why

Models default to grep/find/sed/cat even when faster modern replacements are installed. Telling the model exactly which of these binaries exist steers it to the better tool — without the model having to probe PATH itself.

What it does

  • On session_start, scans PATH directly (no subprocess spawning — a few milliseconds) for a curated list of ~30 candidates: rg, fd/fdfind, sd, bat/batcat, eza/exa/lsd, delta, jq, yq, fzf, xh, hyperfine, dust, duf, procs, btm, zoxide, doggo, gping, hexyl, choose, sad, ast-grep, broot, tokei, watchexec, glow.
  • Caches the result and appends the same constant line to every turn's system prompt via before_agent_start.
  • Injects nothing at all when no candidate binary is found.

Prompt stability

Detection runs exactly once per session. The injected line is constant, so the rendered system prompt is byte-identical across turns — no prompt-cache invalidation, no per-turn probing, no prompt churn. Binaries installed mid-session are picked up on the next session start.

Cross-platform

  • Windows: PATHEXT-aware name matching (rg.exe, fd.cmd, …).
  • macOS / Linux: exact name match plus executable-bit check.

Installation

With pi:

pi install npm:@4fu/pi-bin-hints

Or link locally for development:

pi config set extensions./path/to/bin-hints

Development

npm install
npm run typecheck

No build step — pi loads src/index.ts directly.

License

MIT