Install
openclaw skills install precc-token-saverBefore running any shell command, pipe it through the PRECC hook to fix wrong-directory errors, compress CLI output, and apply learned heuristics — saving 34...
openclaw skills install precc-token-saverPRECC (Predictive Error Correction) intercepts every shell command before it runs. In under 3ms it:
cd /correct/path &&git add)Measured results (29 real sessions, 5,384 bash calls):
Note: OpenClaw does not yet have a native
PreToolUsehook (unlike Claude Code). This skill works via prompt-level instruction: the SKILL.md is loaded into the agent's context and the agent is instructed to manually pipe every shell command throughprecc-hookbefore executing it. Interception is LLM-enforced, not OS-level. A native hook equivalent is tracked in openclaw/openclaw#7597.
When PRECC Token Saver is active, the agent follows this pattern for every shell command it wants to run:
precc-hookprecc-hook on stdinAgent wants to run: cargo build
↓
precc-hook receives: {"tool_input": {"command": "cargo build"}}
precc-hook outputs: {"hookSpecificOutput": {"updatedInput": {"command": "cd /path/to/project && rtk cargo build"}}}
↓
Agent executes: cd /path/to/project && rtk cargo build
# Install PRECC
curl -fsSL https://raw.githubusercontent.com/yijunyu/precc-cc/main/scripts/install.sh | bash
# Initialise (one-time)
precc init
# Mine existing session history (optional)
precc ingest --all
Once the skill is loaded, you can address the agent directly:
@precc report — show token savings and command statistics@precc skills list — list active correction skills@precc update — update PRECC binaries to the latest release@precc savings — show dollar-value savings estimateThis skill is loaded as a system-level instruction into the agent's context. The agent (not the platform) is responsible for enforcing the hook pattern.
The agent is instructed to:
precc-hook by constructing the
hook JSON payload and parsing the response before execution.precc init if the databases are absent.precc report and summarise savings.# Wrap any command through precc-hook:
echo '{"tool_input":{"command":"YOUR_COMMAND_HERE"}}' | precc-hook
Parse the JSON response:
.hookSpecificOutput.updatedInput.command is non-empty → use itprecc report # full analytics dashboard
precc savings # dollar-value breakdown
precc skills list # active skills
precc skills show <name> # detail for one skill
brew install yijunyu/tap/precc