Relationships
#2072 repo upgrade/init hardcode absolute swamp binary path in hook commands, breaking cross-machine portability
Opened by webframp · 9/9/2026· Shipped 9/9/2026
Summary
swamp repo init and swamp repo upgrade write the audit hook command with the operator's absolute path to the swamp binary, e.g.:
"command": "\"/Users/[REDACTED]/.nix-profile/bin/swamp\" audit record --from-hook --tool kiro"This appears in both:
.kiro/agents/swamp.json(postToolUse hook).kiro/hooks/swamp-audit.kiro.hook
(and presumably the equivalent hook files for other enrolled tools).
Impact
The absolute path is not portable across machines:
- I develop on both macOS (
/Users/[REDACTED]/.nix-profile/bin/swamp) and NixOS (/home/[REDACTED]/.nix-profile/bin/swamp). The committed hook path only works on whichever machine last ran init/upgrade. - On the other machine the hook silently fails (wrong path), so audit records stop being written with no obvious signal.
- I fix it manually by using a bare
swamp(relies on PATH, works on both machines), but everyswamp repo upgradere-applies the absolute path, silently reverting the fix. This is a recurring papercut in any repo shared across machines or committed to git.
Expected
Hook commands should be portable by default. Options, roughly in order of preference:
- Emit a bare
swampand rely on PATH (simplest; works anywhere swamp is on PATH). - Emit an env-var-based path like
${SWAMP_BIN:-swamp}so operators can override without editing generated files. - Make the path configurable in repo settings and only fall back to an absolute path when swamp is not on PATH.
- At minimum: preserve a manually-edited hook command across
repo upgradeinstead of overwriting it.
Reproduction
swamp repo init --tool kiro(orrepo upgrade) on a machine where swamp is at an absolute path- Inspect
.kiro/hooks/swamp-audit.kiro.hook— command contains the absolute path - Commit, clone on a second machine with a different $HOME, run any tool op — the audit hook silently no-ops
Environment
- swamp 20260909.001808.0
- Machines: macOS (darwin) and NixOS, swamp installed via nix profile in both (
~/.nix-profile/bin/swamp, different $HOME roots) - Tools enrolled: claude, kiro, codex, pi
Shipped
Click a lifecycle step above to view its details.
stack72 commented 9/9/2026, 5:14:56 AM
Thanks @webframp for reporting this! We shipped: Switch Kiro hook commands from absolute swamp binary path to bare "swamp" (matching all other tools), remove resolveSwampBinaryPath(), and simplify the doctor check to treat Kiro like every other tool with PATH-only validation.. The fix has been merged and a release is on its way. We appreciate your contribution to swamp.
Sign in to post a ripple.