Introduction
What is PRECC?
PRECC (Claude Code အတွက် ကြိုတင်ခန့်မှန်းအမှားပြင်ဆင်ခြင်း) is a Rust tool that intercepts Claude Code bash commands via the official PreToolUse hook mechanism. It fixes errors before they happen, saving tokens and eliminating retry loops.
အသိုင်းအဝိုင်းသုံးစွဲသူများအတွက် အခမဲ့။
The Problem
Claude Code wastes significant tokens on preventable mistakes:
- Wrong-directory errors – Running
cargo buildin a parent directory that has noCargo.toml, then retrying after reading the error. - Retry loops – A failed command produces verbose output, Claude reads it, reasons about it, and retries. Each cycle burns hundreds of tokens.
- Verbose output – Commands like
findorls -Rdump thousands of lines that Claude must process.
The Four Pillars
Context ပြင်ဆင်ခြင်း (cd-prepend)
cargo build သို့မဟုတ် npm test ကဲ့သို့ command များ directory မှားတွင် run နေကြောင်း ရှာဖွေပြီး execution မတိုင်မီ cd /မှန်ကန်သော/path && ကို ထည့်ပေးသည်။
GDB Debugging
Detects opportunities to attach GDB for deeper debugging of segfaults and crashes, providing structured debug information instead of raw core dumps.
Session Mining
Mines Claude Code session logs for failure-fix pairs. When the same mistake recurs, PRECC already knows the fix and applies it automatically.
Automation Skills
A library of built-in and mined skills that match command patterns and rewrite them. Skills are defined as TOML files or SQLite rows, making them easy to inspect, edit, and share.
How It Works (30-Second Version)
- Claude Code is about to run a bash command.
- The PreToolUse hook sends the command to
precc-hookas JSON on stdin. precc-hookruns the command through the pipeline (skills, directory correction, compression) in under 3 milliseconds.- The corrected command is returned as JSON on stdout.
- Claude Code executes the corrected command instead.
Claude never sees the error. No tokens wasted.
Adaptive Compression
command တစ်ခု compression ပြီးနောက် fail ဖြစ်ပါက PRECC သည် နောက်တစ်ကြိမ် retry တွင် compression ကို အလိုအလျောက် ကျော်ပစ်ပြီး Claude အတွက် debug ရန် output အပြည့်အစုံကို ပေးသည်။
Live Usage Statistics
| Metric | Value |
|---|---|
| Hook invocations | – |
| Tokens saved | – |
| Saving ratio | –% |
| RTK rewrites | – |
| CD corrections | – |
| Hook latency | – ms (p50) |
ကိန်းဂဏန်းများသည် ခန့်မှန်းချက်များဖြစ်သည်။ ကာကွယ်ထားသော failure တိုင်းသည် retry cycle တစ်ခုလုံးကို ရှောင်ရှားပေးသည်။ These numbers update automatically from anonymized telemetry.
Links
- GitHub: https://github.com/peria-ai/precc-cc
- Website: https://peria.ai
- Documentation: https://precc.cc