Câu hỏi thường gặp
PRECC có an toàn không?
Có. PRECC sử dụng cơ chế hook PreToolUse chính thức của Claude Code – cùng điểm mở rộng mà Anthropic thiết kế cho mục đích này. Hook:
- Chạy hoàn toàn ngoại tuyến (không có lệnh gọi mạng trong đường dẫn nóng)
- Hoàn thành trong dưới 5 mili giây
- Là fail-open: nếu có lỗi, lệnh gốc chạy không thay đổi
- Chỉ sửa đổi lệnh, không bao giờ tự thực thi
- Lưu trữ dữ liệu cục bộ trong cơ sở dữ liệu SQLite
PRECC có hoạt động với các công cụ lập trình AI khác không?
PRECC được thiết kế riêng cho Claude Code. Nó phụ thuộc vào giao thức hook PreToolUse mà Claude Code cung cấp. Nó không hoạt động với Cursor, Copilot, Windsurf hoặc các công cụ lập trình AI khác.
Đo lường từ xa gửi dữ liệu gì?
Đo lường từ xa chỉ hoạt động khi bạn đồng ý. Khi được bật, nó gửi:
- Phiên bản PRECC, hệ điều hành và kiến trúc
- Số liệu tổng hợp (lệnh bị chặn, kỹ năng được kích hoạt)
- Độ trễ hook trung bình
Nó không gửi văn bản lệnh, đường dẫn tệp, tên dự án hoặc bất kỳ thông tin nhận dạng cá nhân nào. Bạn có thể xem trước dữ liệu chính xác với precc telemetry preview trước khi đồng ý. Xem Đo lường từ xa để biết chi tiết.
Làm thế nào để gỡ cài đặt PRECC?
PRECC is fully reversible — remove it in three steps:
-
Xóa đăng ký hook:
# Delete the hook entry from Claude Code's settings # (precc init added it; removing it disables PRECC) -
Xóa tệp nhị phân:
rm ~/.local/bin/precc ~/.local/bin/precc-hook ~/.local/bin/precc-learner -
Xóa dữ liệu (tùy chọn):
rm -rf ~/.local/share/precc/ rm -rf ~/.config/precc/
Giấy phép của tôi đã hết hạn. Điều gì xảy ra?
PRECC trở về tầng Community. Tất cả chức năng cốt lõi tiếp tục hoạt động:
- Các kỹ năng tích hợp vẫn hoạt động
- Pipeline hook chạy bình thường
precc savingshiển thị chế độ xem tóm tắtprecc ingestvà khai thác phiên hoạt động
Các tính năng Pro không khả dụng cho đến khi bạn gia hạn:
precc savings --all(phân tích chi tiết)precc compressprecc gifprecc ghaprecc geofence- Báo cáo qua email
Hook dường như không chạy. Làm thế nào để gỡ lỗi?
Run precc doctor first — it automates every check below. To diagnose by hand:
-
Kiểm tra xem hook đã được đăng ký chưa:
precc init -
Kiểm tra hook thủ công:
echo '{"tool_input":{"command":"cargo build"}}' | precc-hook -
Kiểm tra xem tệp nhị phân có trong PATH không:
which precc-hook -
Kiểm tra cấu hình hook của Claude Code trong
~/.claude/settings.json.
PRECC có làm chậm Claude Code không?
Không. Hook hoàn thành trong dưới 5 mili giây (p99). Điều này không thể cảm nhận được so với thời gian Claude dành cho suy luận và tạo phản hồi.
Tôi có thể sử dụng PRECC trong CI/CD không?
PRECC được thiết kế cho các phiên Claude Code tương tác. Trong CI/CD, không có phiên bản Claude Code nào để hook vào. Tuy nhiên, precc gha có thể phân tích các lần chạy GitHub Actions thất bại từ bất kỳ môi trường nào.
Các kỹ năng khai thác khác gì so với kỹ năng tích hợp?
Các kỹ năng tích hợp được cung cấp cùng PRECC và bao gồm các mẫu sai thư mục phổ biến. Các kỹ năng khai thác được học từ nhật ký phiên cụ thể của bạn – chúng nắm bắt các mẫu riêng biệt cho quy trình làm việc của bạn. Cả hai đều được lưu trữ trong SQLite và được đánh giá giống nhau bởi pipeline hook.
Tôi có thể chia sẻ kỹ năng với nhóm không?
Có. Xuất bất kỳ kỹ năng nào sang TOML với precc skills export NAME và chia sẻ tệp. Các thành viên nhóm có thể đặt nó trong thư mục skills/ hoặc nhập vào cơ sở dữ liệu heuristics.
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:
-
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 -
Your
settings.jsonis missing the hook entry. Runprecc 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 doctorIf doctor is not available because you are on an older release, run
precc initto (re)register the hook. -
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. Runprecc skills listto 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 transientlean-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 includesclaudeitself 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 oncurl/wget/http/fetchagainst any of 11 OpenCLI-supported domains andsuggest_fix-es the equivalentopencli <site> …command. Suggestion only; never modifies the command.webfetch-opencli-hackernews— auto-rewritescurl|wget news.ycombinator.comtoopencli hackernews topwith an inlinecommand -v openclifallback 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.