Installation
PRECC installs with a single command. It requires bash or zsh and Claude Code ≥ 1.0.
Then register the hook with Claude Code:
~/.claude/hooks/. If the directory doesn't exist, PRECC init creates it automatically.
Quickstart
After installation, PRECC is active immediately. No further config is needed. Start a new Claude Code session and the hook runs on every bash command Claude issues.
Install via curl (above) — downloads the binary and verifies the SHA256 checksum.
Run PRECC init — registers the hook and validates your Claude Code installation.
Start Claude Code as normal — PRECC is transparent. You'll see savings in your API usage dashboard within hours.
Verifying the hook
Run PRECC status to confirm the hook is registered and active:
Config file
PRECC reads ~/.PRECC/config.toml. A default config is created on first run. You rarely need to edit it.
CLI reference
| Command | Description |
|---|---|
| PRECC init | Register the hook with Claude Code |
| PRECC status | Show current hook status and config |
| PRECC update | Update PRECC binary and RTK rules |
| PRECC skills list | List all installed skills |
| PRECC skills install <name> | Install a community skill |
| PRECC skills remove <name> | Remove a skill |
| PRECC logs | Show recent hook execution logs |
| PRECC uninstall | Remove hook and clean up |
Pipeline stages
Every command passes through up to 6 stages. Stages run in priority order and are skipped if not applicable.
| Stage | Skill | What it does |
|---|---|---|
| S1 | prepend_cd | Injects missing cd /path/to/project && prefix when Claude issues a command from the wrong directory |
| S2 | warn_identify | Identifies commands likely to produce verbose warning output and suppresses noise tokens |
| S3 | jj_translate | Detects .jj/ repo and rewrites git commands to their Jujutsu equivalents |
| S4 | rtk_compress | Applies RTK rewrite rules to reduce token-verbose command patterns |
| S5 | token_budget | Truncates known noisy output flags when token budget is tight |
| S6 | rtk_final | Second-pass RTK compression on the rewritten command |
Custom skills
A skill is a small executable (any language) that reads a command from stdin and writes the rewritten command to stdout. Exit 0 to apply the rewrite; exit 1 to pass the command through unchanged.
Install your skill: PRECC skills install ./my-skill.sh --name my-skill --priority 3