cost-guard init¶
Install hooks bundle into your Claude Code project.
Usage¶
cost-guard init [OPTIONS]
Options¶
| Option | Default | Description |
|---|---|---|
--target PATH |
.claude/hooks |
Where to install hook files |
--force |
false |
Overwrite existing hook files |
--dry-run |
false |
Print what would be done (no writes) |
Examples¶
Install hooks to .claude/hooks (default):
cost-guard init
Install to custom location:
cost-guard init --target ~/my-hooks
Overwrite existing hooks:
cost-guard init --force
Preview without writing:
cost-guard init --dry-run
What Gets Installed¶
5 bash hooks for automated token tracking:
| Hook | Trigger | Purpose |
|---|---|---|
parallel_agents_guard.sh |
Pre-Agent tool use | Warn when >10 parallel agents |
test_before_push_guard.sh |
Pre-commit | Block if no E2E tests in session |
large_read_warning.sh |
Pre-Read/Bash | Warn for files >100KB |
session_cost_check.sh |
SessionStart | Display session cost estimate |
token_alert.sh |
SessionStart | Alert if daily budget exceeded |
See Hooks Bundle for details.
Post-Install¶
After installation, hooks activate automatically in Claude Code sessions. No additional setup needed.