Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

คำถามที่พบบ่อย

PRECC ปลอดภัยไหม?

ใช่ PRECC ใช้กลไก hook PreToolUse อย่างเป็นทางการของ Claude Code – จุดขยายเดียวกันที่ Anthropic ออกแบบมาเพื่อจุดประสงค์นี้โดยเฉพาะ Hook:

  • ทำงานแบบออฟไลน์ทั้งหมด (ไม่มีการเรียกเครือข่ายในเส้นทางหลัก)
  • เสร็จสิ้นในเวลาน้อยกว่า 5 มิลลิวินาที
  • เป็น fail-open: หากมีข้อผิดพลาด คำสั่งเดิมจะทำงานโดยไม่เปลี่ยนแปลง
  • แก้ไขคำสั่งเท่านั้น ไม่เคยเรียกใช้เอง
  • จัดเก็บข้อมูลในฐานข้อมูล SQLite ภายในเครื่อง

PRECC ทำงานกับเครื่องมือเขียนโค้ด AI อื่นได้ไหม?

PRECC ออกแบบมาสำหรับ Claude Code โดยเฉพาะ มันอาศัยโปรโตคอล hook PreToolUse ที่ Claude Code มีให้ ไม่ทำงานกับ Cursor, Copilot, Windsurf หรือเครื่องมือเขียนโค้ด AI อื่น

การวัดระยะไกลส่งข้อมูลอะไร?

การวัดระยะไกลเป็นแบบเลือกเข้าร่วมเท่านั้น เมื่อเปิดใช้งานจะส่ง:

  • เวอร์ชัน PRECC ระบบปฏิบัติการ และสถาปัตยกรรม
  • จำนวนรวม (คำสั่งที่สกัด ทักษะที่เปิดใช้งาน)
  • ความหน่วงเฉลี่ยของ hook

ไม่ส่งข้อความคำสั่ง เส้นทางไฟล์ ชื่อโปรเจกต์ หรือข้อมูลส่วนบุคคล คุณสามารถดูตัวอย่างข้อมูลที่แน่นอนด้วย precc telemetry preview ก่อนเลือกเข้าร่วม ดูการวัดระยะไกลสำหรับรายละเอียด

ฉันจะถอนการติดตั้ง PRECC ได้อย่างไร?

PRECC is fully reversible — remove it in three steps:

  1. ลบการลงทะเบียน hook:

    # Delete the hook entry from Claude Code's settings
    # (precc init added it; removing it disables PRECC)
    
  2. ลบไฟล์ไบนารี:

    rm ~/.local/bin/precc ~/.local/bin/precc-hook ~/.local/bin/precc-learner
    
  3. ลบข้อมูล (ไม่บังคับ):

    rm -rf ~/.local/share/precc/
    rm -rf ~/.config/precc/
    

ใบอนุญาตของฉันหมดอายุ เกิดอะไรขึ้น?

PRECC กลับไปยังระดับ Community ฟังก์ชันหลักทั้งหมดยังคงทำงาน:

  • ทักษะในตัวยังคงใช้งานได้
  • Pipeline hook ทำงานปกติ
  • precc savings แสดงมุมมองสรุป
  • precc ingest และการขุดเซสชันทำงาน

ฟีเจอร์ Pro จะไม่สามารถใช้งานได้จนกว่าจะต่ออายุ:

  • precc savings --all (รายละเอียดการแยกย่อย)
  • precc compress
  • precc gif
  • precc gha
  • precc geofence
  • รายงานทางอีเมล

Hook ดูเหมือนไม่ทำงาน ฉันจะแก้ไขจุดบกพร่องอย่างไร?

Run precc doctor first — it automates every check below. To diagnose by hand:

  1. ตรวจสอบว่า hook ได้ลงทะเบียนแล้ว:

    precc init
    
  2. ทดสอบ hook ด้วยตนเอง:

    echo '{"tool_input":{"command":"cargo build"}}' | precc-hook
    
  3. ตรวจสอบว่าไฟล์ไบนารีอยู่ใน PATH:

    which precc-hook
    
  4. ตรวจสอบการกำหนดค่า hook ของ Claude Code ใน ~/.claude/settings.json

PRECC ทำให้ Claude Code ช้าลงไหม?

ไม่ Hook เสร็จสิ้นในเวลาน้อยกว่า 5 มิลลิวินาที (p99) ซึ่งแทบไม่รู้สึกเมื่อเทียบกับเวลาที่ Claude ใช้ในการคิดและสร้างคำตอบ

ฉันใช้ PRECC ใน CI/CD ได้ไหม?

PRECC ออกแบบมาสำหรับเซสชัน Claude Code แบบโต้ตอบ ใน CI/CD ไม่มีอินสแตนซ์ Claude Code ให้ hook เข้า อย่างไรก็ตาม precc gha สามารถวิเคราะห์การรัน GitHub Actions ที่ล้มเหลวจากสภาพแวดล้อมใดก็ได้

ทักษะที่ขุดมาแตกต่างจากทักษะในตัวอย่างไร?

ทักษะในตัวมาพร้อมกับ PRECC และครอบคลุมรูปแบบไดเรกทอรีผิดทั่วไป ทักษะที่ขุดมาเรียนรู้จากบันทึกเซสชันเฉพาะของคุณ ทั้งสองถูกจัดเก็บใน SQLite และถูกประเมินเหมือนกันโดย pipeline hook

ฉันแชร์ทักษะกับทีมได้ไหม?

ได้ ส่งออกทักษะเป็น TOML ด้วย precc skills export NAME และแชร์ไฟล์ สมาชิกในทีมสามารถวางไว้ในไดเรกทอรี skills/ หรือนำเข้าสู่ฐานข้อมูลได้

Why do I see zero tokens saved?

If precc savings reports 0 tokens despite an active Claude Code session burning input/output tokens, the hook is not firing. Three causes account for almost every reported instance:

  1. You are on v0.3.42 or v0.3.43. These releases shipped a data-path regression where the hook wrote metrics to a directory that the CLI then read from a different directory — both ran, but the savings number stayed at 0. Fixed in v0.3.44 (data paths routed through db::data_dir()). Upgrade with:

    precc update
    
  2. Your settings.json is missing the hook entry. Run precc doctor (available in v0.3.53+). It checks each precondition of the hot path — settings file, hook entry, binary on $PATH, heuristics DB, recent invocations — and reports the first one that fails:

    precc doctor
    

    If doctor is not available because you are on an older release, run precc init to (re)register the hook.

  3. Your session has not yet hit a skill trigger. PRECC only intercepts Bash commands matching one of the active skills. If your session has been pure file editing or pure web fetching against domains not covered by webfetch-opencli, you have not yet given the hook anything to compress or rewrite. This is normal. Run precc skills list to see what triggers exist.

If after upgrading and running precc doctor you still see zero savings, file an issue at https://github.com/peri-a-i/precc-cc/issues with the output of precc doctor.

My MCP server (e.g. lean-ctx) is pegging CPU. How do I kill it safely without taking Claude Code down with it?

PRECC does not ship or supervise MCP servers — but this is a recurring trap because some MCP binaries (notably lean-ctx) are also invoked as per-Bash-tool-call wrappers by the Claude Code harness, not just as long-running servers. A naive pkill <name> then matches many short-lived wrappers in addition to the server.

Identify the runaway PID, do not kill by name:

pgrep -f "^lean-ctx$" \
  | xargs -I{} ps -o pid,%cpu,etime,args -p {} \
  | sort -k2 -nr | head -3

The top row is the long-running server (large etime, high %cpu). Send SIGTERM to only that PID:

kill -TERM <pid>

Avoid these forms, all of which can also kill Claude Code or break in-flight tool calls:

  • pkill lean-ctx — matches transient lean-ctx -c <cmd> wrappers spawned per Bash tool call.
  • pkill -9 -f lean-ctx — same broad match, plus ungraceful exit leaves the MCP stdio half-open.
  • pkill -g <pgid> / kill -- -<pgid> — kills the whole process group, which includes claude itself when the MCP server shares a session with it.

If after a clean SIGTERM the server does not exit within a few seconds, escalate with kill -KILL <pid> on the same single PID (still not by name). Claude Code will lose those MCP tools until you restart it; it should not exit on its own.

This advice is independent of PRECC — but PRECC users frequently run lean-ctx, so it is worth documenting here.

What is OpenCLI and do I need it?

OpenCLI is a third-party Node.js tool that turns ~148 websites into structured-output CLI commands (opencli hackernews top, opencli reddit search <q>, opencli arxiv search <q>, …). PRECC ships two built-in skills that work with it:

  • webfetch-opencli-hint — fires on curl/wget/http/fetch against any of 11 OpenCLI-supported domains and suggest_fix-es the equivalent opencli <site> … command. Suggestion only; never modifies the command.
  • webfetch-opencli-hackernews — auto-rewrites curl|wget news.ycombinator.com to opencli hackernews top with an inline command -v opencli fallback to the original command if OpenCLI isn’t installed.

You don’t need OpenCLI for PRECC to work. The hint skill costs nothing; the auto-rewrite skill is safe to ship default-on because of the fallback.

If you want OpenCLI’s WebFetch token savings, install it with:

precc init --opencli

That runs npm install -g @jackwener/opencli (Node.js 20+ required). For cookie-reuse on logged-in pages, also install OpenCLI’s Chrome extension separately — see the project README. The extension requests broad permissions (debugger, <all_urls>, cookies); review them before installing.

precc doctor reports OpenCLI’s presence on $PATH as an informational line:

i opencli: installed (webfetch-opencli skills will auto-rewrite)

or

i opencli: not installed (run `precc init --opencli` if you want WebFetch token savings)

Never marks doctor as failing — the integration is fully opt-in.