Expand description
Per-agent reinjection surface installation.
install-hooks --claude|--codex|--pi installs truth-mirror reinject --agent <agent>
into each selected agent’s repo-local configuration surface. Installs are
non-clobbering (existing config is merged, not overwritten), idempotent, and
reversible: uninstall removes only truth-mirror’s own entries.
Structs§
Constants§
- ENFORCE_
COMMAND - The enforcement subcommand marker. Matched only when the command’s program
token is also
truth-mirror(seeis_own_enforcement_command), so preserved--config/--state-dirvariants match but foreign hooks never do. - FILE_
SURFACE_ AGENTS - Agents whose reinjection surface is a JSON hook file this module manages.
- PI_
EXTENSION_ RELATIVE - Repo-relative path of the project-local Pi extension file.
- PI_
EXTENSION_ SOURCE - The project-local Pi extension. Default-exports a factory
(pi) => {}that registers acontexthandler (fires before every LLM call) and appends the output oftruth-mirror reinject --agent pias a user message, with a dedup guard so findings inject once per change, not once per tool round-trip.
Functions§
- agent_
slug - install_
enforcement - Install a
PreToolUseenforcement hook into a nested (Claude/Codex) surface. The hook exits non-zero to block a mutating tool while the ledger has unresolved rejections beyond the configured threshold.global_argspreserves the install-time--config/--state-dirso the hook uses the same config. - install_
pi_ extension - Write the project-local Pi reinjection extension into
<repo>/.pi/extensions/. - pi_
extension_ path - Absolute path of the project-local Pi extension file.
- reinject_
command - The exact command truth-mirror installs into each surface.
- surface_
contains - Whether the surface JSON already carries the reinject command for an agent.
- surface_
relative_ path - Repo-relative path of a file-surface agent’s reinjection hook file.
Only meaningful for
FILE_SURFACE_AGENTS. - uninstall_
enforcement - Remove the
PreToolUseenforcement hook from a nested surface. - uninstall_
pi_ extension - Remove the project-local Pi reinjection extension.