Troubleshooting
Quick diagnostic: rafter agent verify
Before diving into individual issues, run the built-in health check:
--probe to confirm Claude Code’s PreToolUse hook actually fires (not just that the file is on disk).
Runtime requirements
Symptom: installation fails, or the CLI behaves unpredictably on an older language runtime. Cause: the minimum supported runtimes are:
Node 18 and 20 reached end of life on 2025-04-30 and 2026-04-30, and Python 3.10 on 2026-10-01.
Fix — check your runtime version and upgrade if needed:
nvm, pyenv, asdf), switch to a supported version before reinstalling rafter.
Python environment issues on Linux
Symptom:pip install rafter-cli fails with errors about missing ensurepip, venv, or pip.
Cause: Minimal Linux installations (Ubuntu, Debian, containers) often ship with a bare Python that lacks pip and venv.
Fix — install the missing system packages:
Betterleaks not found after rafter agent init
Symptom: rafter secrets runs without complaint, but the scan is annotated (patterns) rather than (both: betterleaks + patterns), and rafter agent verify / rafter agent status report Betterleaks as missing.
Cause: Betterleaks (the gitleaks successor maintained by the same authors, adopted in v0.8.0) is an optional enhancement. When the binary isn’t on your PATH or at ~/.rafter/bin/betterleaks, Rafter falls back to its built-in pattern engine (28 secret patterns covering API keys, tokens, and private keys) — silently, on every scan. All core functionality still works; rafter secrets does not print a warning banner for this, by design (it isn’t an error).
If you ran
rafter agent init --with-betterleaks (or --all) on a platform/architecture with no prebuilt Betterleaks binary, init itself prints Betterleaks not available for <platform>/<arch> and falls back to pattern-based scanning — that message, not a per-scan warning, is where you’d see it.~/.rafter/bin/betterleaks.
Or install it system-wide:
--with-gitleaks, you’ll have a leftover ~/.rafter/bin/gitleaks. rafter agent verify and rafter agent status detect this and tell you to run rafter agent update-betterleaks — they no longer error out on the legacy binary. The CLI flags --with-gitleaks, --engine gitleaks, and rafter agent update-gitleaks were removed in v0.8.0; use the -betterleaks equivalents.
If you prefer pattern-only scanning (no Betterleaks), simply omit --with-betterleaks during init, or pass --engine patterns when scanning:
OpenClaw skill not installed after rafter agent init
Symptom: After running rafter agent init, OpenClaw does not receive the Rafter skill. The init output does not mention OpenClaw.
Cause: rafter agent init detects OpenClaw by checking for the ~/.openclaw directory. If OpenClaw is installed but that directory does not exist yet (e.g., OpenClaw has never been run), detection fails silently.
Fix — run OpenClaw at least once first, then re-initialize:
--force flag on rafter agent init; re-running with --with-openclaw reinstalls the skill unconditionally (and migrates a pre-0.8.0 legacy skill file to the current ClawHub-shaped path). Avoid rafter agent enable openclaw.skills for this — as of v0.11.0 it installs to the legacy pre-0.8.0 path instead of the current one, so rafter agent init --with-openclaw is the reliable path.
Then restart OpenClaw to load the skill:
false, enable it manually:
A command “needs approval” but nothing prompts me
Symptom: inside Claude Code (or another hooked platform), a command likecurl ... | sh or git push --force is denied outright, even though it’s documented as “requires approval” rather than “blocked.”
Cause: the PreToolUse hook has no way to display an interactive prompt to the person — it can only return an allow/deny decision to the platform. A command that requires approval is therefore denied, the same as a blocked one; the hook never returns an “ask.” The deny reason names the command and the rule it matched, and tells you that a person must approve it from a terminal.
Fix — approve the command yourself, at an interactive terminal, outside the agent:
agent exec prompts [y/N] only when stdin is an interactive TTY. There is no flag that approves on an agent’s behalf — not --force (it’s a no-op as of v0.10.1) and not a piped yes. Widen policy instead, in the global config, if a command should stop requiring approval for your workflow:
The hook denies everything after an unrelated change
Symptom: everyBash/Write/Edit call starts getting denied, with a reason like rafter hook error: TypeError: ...; denying to be safe.
Cause: the hook fails closed on any unexpected error while evaluating a call — an unhandled exception is never treated as evidence the call is safe. This is deliberate and distinct from a malformed .rafter.yml, which is a handled condition: a policy file that can’t be read, decoded, or parsed prints a warning naming the file and falls back to default settings, and the current call proceeds normally rather than being denied.
Fix:
- Check stderr for the
rafter hook error: <type>: <message>line — the<message>usually names the real cause (a corrupt binary, an unreadable file, a permissions problem). - If you also see
Warning: Failed to parse policy file ..., that’s the separate, non-fatal.rafter.ymlcase — fix the YAML, but know that it was never the reason for a denial. rafter agent verifyandrafter agent audit --last 5help narrow down whether the error is config-related or a one-off.
.rafter.yml sets audit.log_path, but the log still writes to ~/.rafter/audit.jsonl
Symptom: a project-level .rafter.yml with an audit.log_path entry has no effect — events still land in the default location, and any command that reads the policy file (hooks, rafter secrets, rafter agent scan, …) prints:
.rafter.yml can’t redirect it. This is intentional: a cloned repository shouldn’t be able to point your audit trail somewhere else.
Fix — set it in the global config instead:
audit.log_path line from .rafter.yml; it will keep being ignored (with the warning above) if you leave it in.
rafter agent config get reports “Key not found”, or set has no effect
Symptom: rafter agent config get agent.riskLevel (or agent.commandPolicy.mode, etc.) fails with Key not found: agent.riskLevel, even on a freshly initialized config.
Cause: the Node and Python CLIs use different dot-path casing for agent config get/set. get rejects the other runtime’s casing with Key not found (exit 1); set doesn’t validate the key, so the wrong casing prints success and changes nothing.
- Node (
@rafter-security/cli): camelCase —agent.riskLevel,agent.commandPolicy.mode - Python (
rafter-cli): snake_case —agent.risk_level,agent.command_policy.mode
get/set subcommands’ path argument.)
Fix: use the casing that matches your installed CLI. Check which one you have with rafter --version plus which rafter / pip show rafter-cli / npm ls -g @rafter-security/cli.
Still stuck?
Get Help
- Documentation: docs.rafter.so
- GitHub Issues: rafter-cli/issues
- Support: rafter.so/help

