Skip to main content

Troubleshooting

Quick diagnostic: rafter agent verify

Before diving into individual issues, run the built-in health check:
This validates your config, Betterleaks binary, and all 10 supported agent integrations in one pass (12 checks total). If something is broken, the output tells you exactly what failed and how to fix it. Add --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:
If you’re on a managed install (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:
Verify your Python version (3.11+ for Rafter 0.11.1 and later, 3.10+ for 0.11.0; see Runtime requirements above):
If you see python3: command not found after installing, check that /usr/bin/python3 exists. Some distros require python3.x (e.g., python3.12) — create a symlink or use the full path.

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.
If you want full Betterleaks coverage, the easiest path is to let Rafter manage the binary for you:
That downloads the pinned, hash-verified binary to ~/.rafter/bin/betterleaks. Or install it system-wide:
After installing, verify with:
Upgrading from a pre-0.8.0 install? If you previously ran --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.
rafter agent init prints detailed diagnostics when the Betterleaks binary fails to load — including binary architecture, system platform, and libc type (glibc vs musl). This helps diagnose binary incompatibilities on Linux.
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:
Verify the skill was installed:
If the directory exists but skill is still missing, reinstall it:
There is no --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:
Check that the integration is enabled in config:
If it returns false, enable it manually:
As of v0.5.2, rafter agent init surfaces detailed error context when OpenClaw skill installation fails—including source path, destination path, and the underlying exception. Check the init output for actionable guidance.

A command “needs approval” but nothing prompts me

Symptom: inside Claude Code (or another hooked platform), a command like curl ... | 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: every Bash/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:
  1. 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).
  2. If you also see Warning: Failed to parse policy file ..., that’s the separate, non-fatal .rafter.yml case — fix the YAML, but know that it was never the reason for a denial.
  3. rafter agent verify and rafter agent audit --last 5 help 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:
Cause: the audit log location is a machine-owner setting, not a project one — a project .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:
Remove the 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
(The config file on disk accepts either casing when loaded — this only affects the 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