install_precommit_guard
Installs a Git pre-commit hook that blocks commits staging files reserved by another agent, preventing conflicts in Agent Mail projects.
Instructions
Install the Agent Mail pre-commit guard into a git repository.
The guard blocks a commit that stages files another agent holds an
exclusive file reservation on (set AGENT_MAIL_GUARD_MODE=warn to only
warn). Commits must run with AGENT_NAME set to the committing agent.
Any existing pre-commit hook is kept and still runs. Does nothing when
worktree features are disabled (WORKTREES_ENABLED=0).
Parameters
project_key : str Project whose file reservations the guard enforces. code_repo_path : str Path to the git repository to install the hook into. format : str, optional Output format.
Returns
dict
{"hook": "<path to the installed pre-commit hook>"}; empty string
when skipped.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | ||
| project_key | Yes | ||
| code_repo_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||