bash-smart-approve:install

An installation procedure for bash-smart-approve, a tool that manages automatic approval rules for Bash commands in Claude Code. It checks required tools, finds the installation mode, configures the hook, and can import existing rules.

In plain words
What is it for?
Use it after cloning bash-smart-approve or when setting it up and connecting its hook to Claude Code.
Why use it?
It removes the manual setup work and checks prerequisites before enabling command approval.

Skill for Claude CodeCodex

Part of the bash-smart-approve plugin — 9 skills, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/pr3m/claude-code-bash-smart-approve/install
Any agent
npx skills add pr3m/claude-code-bash-smart-approve --skill install
Clone the repo
git clone --depth 1 https://github.com/pr3m/claude-code-bash-smart-approve

Made for: Claude Code, Codex.

Or install bash-smart-approve, the plugin that ships this one along with the rest of its 9 skills, 1 hook.

Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 991 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00054 $0.00991
Opus 5 $0.00027 $0.00495
Sonnet 5 $0.00011 $0.00198
Haiku 4.5 $0.00005 $0.00099

Measured 2d ago against content hash ceb16445c84a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

bash-smart-approve:install scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- Linux (Debian/Ubuntu): `sudo apt install shfmt`

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

## Step 3 — Wire the hook into ~/.claude/settings.json (manual install only)
plugins/bash-smart-approve/skills/install/SKILL.md · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Install bash-smart-approve

Wire the plugin into Claude Code settings, create an initial config, and (optionally) import existing permission rules.

Step 1 — Preflight

Run shfmt --version via Bash.

  • ✅ Installed → continue.
  • ❌ Missing → tell the user the install command for their OS and stop:
    • macOS: brew install shfmt
    • Linux (Debian/Ubuntu): sudo apt install shfmt
    • Linux (Fedora): sudo dnf install shfmt
    • Windows: scoop install shfmt or choco install shfmt

Also confirm node --version ≥ 18.

Step 2 — Locate the plugin & determine install mode

Resolve the plugin root directory and pick one of two install modes:

  • Marketplace install$CLAUDE_PLUGIN_ROOT is set (plugin came from /plugin install). The plugin's own hooks/hooks.json is auto-registered by Claude Code; skip Step 3 entirely. Verify $CLAUDE_PLUGIN_ROOT/hooks/approve.js exists, then continue at Step 4.
  • Local / manual install$CLAUDE_PLUGIN_ROOT is unset. Ask the user: "Where did you clone this repo?" Default suggestion: ~/dev/claude-code-bash-smart-approve. Verify hooks/approve.js exists. Proceed to Step 3 to wire the hook manually.

Step 3 — Wire the hook into ~/.claude/settings.json (manual install only)

Skip this step if $CLAUDE_PLUGIN_ROOT was set in Step 2 — adding a second hook registration would fire the hook twice per Bash call.

Use the update-config skill (or direct Read + Edit) to add this hook to ~/.claude/settings.json, merging with any existing hooks.PreToolUse array:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "node \"<plugin-root>/hooks/approve.js\"",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

Use the absolute plugin path resolved in Step 2. On Windows, prefer forward slashes or %USERPROFILE% — both are accepted by Node.

Check for duplicates: if a hook already points at this approve.js, skip (don't add twice).

Read the full file on GitHub · 97 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 97 lines · 54 tokens per session scan C ceb16445c84a

Subscribe to this mod's changes

bash-smart-approve:install is a skill published in the GitHub repository pr3m/claude-code-bash-smart-approve (1 stars, last pushed 4mo ago), licensed MIT. It adds 54 tokens to every session and 991 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 2 findings (asks for root, reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.