bash-smart-approve:import

A skill for importing existing Claude Code terminal permission rules from settings files into the configuration used by bash-smart-approve. It reads allowed Bash commands and converts their patterns into the new format.

In plain words
What is it for?
Use it during setup or migration when you already have Bash command rules in Claude Code settings and want to reuse the allowed commands.
Why use it?
It avoids recreating an existing command allowlist by hand when moving to bash-smart-approve. It ignores unrelated permission types and denied or approval-request rules.

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/import
Any agent
npx skills add pr3m/claude-code-bash-smart-approve --skill import
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 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,096 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 4 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.00057 $0.01096
Opus 5 $0.00028 $0.00548
Sonnet 5 $0.00011 $0.00219
Haiku 4.5 $0.00006 $0.00110

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

Security

Grade D, and why

bash-smart-approve:import scanned grade D with 4 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.

Reads agent configuration directoriesmediumAgent snooping

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

1. `~/.claude/settings.json` (user-global)

Unrestricted tool accessmediumExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

- **Absolute path to user binary** (`/home/alice/bin/mytool:*`) → extract `mytool`, add as binary. Note to the user: the plugin uses `$PATH` resolution, so `mytool` must be in `PATH` at runtime.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- **`rm` or `rmdir`** → try to extract path arguments. If the pattern is too broad (`rm *` / `rm -rf *`), skip with a warning. If concrete paths are present (`/tmp/jira*`), add to `allowedRmPaths`.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **`curl` or `wget`** → also try to extract a domain from the pattern (regex: `[a-zA-Z0-9*.-]+\.[a-zA-Z]{2,}`). If a domain is found, add it to `allowedCurlDomains`. If no domain is extractable, skip with a note (too br
plugins/bash-smart-approve/skills/import/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.

Import Existing Allow Rules

Convert Bash(...) permission rules from Claude Code settings into bash-smart-approve config.

Step 1 — Locate settings files

Read (in order of precedence, later overrides earlier):

  1. ~/.claude/settings.json (user-global)
  2. <cwd>/.claude/settings.json (project, committed)
  3. <cwd>/.claude/settings.local.json (project, gitignored)

Also check ~/.claude/settings.local.json if it exists.

For each file, extract permissions.allow array. Ignore permissions.deny, permissions.ask, and non-Bash rules (e.g. Read(...), Edit(...), mcp__...).

Step 2 — Parse each Bash(...) rule

For every string matching Bash(<pattern>):

  1. Strip the Bash( prefix and trailing ).
  2. Normalize the pattern:
    • If it starts with $HOME/, $HOME\, ~/, or ~\ → strip that prefix.
    • If it starts with an absolute path like /Users/.../bin/X or /usr/bin/X → keep only the last segment (X).
    • Strip trailing .exe.
  3. Identify the first token (the binary name):
    • Pattern git * → binary git
    • Pattern npm view:* → binary npm
    • Pattern aws-vault exec:* → binary aws-vault
    • Pattern bin/jira:* → binary jira
  4. Classify:
    • shell interpreter (bash, sh, zsh, sudo, python, node -e, xargs, env, etc.) → skip with a warning to the user: "Rule Bash(bash:*) cannot be imported — shell interpreters are hard-denied for security."
    • curl or wget → also try to extract a domain from the pattern (regex: [a-zA-Z0-9*.-]+\.[a-zA-Z]{2,}). If a domain is found, add it to allowedCurlDomains. If no domain is extractable, skip with a note (too broad to auto-allow).
    • rm or rmdir → try to extract path arguments. If the pattern is too broad (rm * / rm -rf *), skip with a warning. If concrete paths are present (/tmp/jira*), add to allowedRmPaths.
    • anything else → add the binary to allowedBinaries.

Step 3 — Dedupe and propose diff

Merge against the existing bash-smart-approve config (don't re-add things already present).

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 · 57 tokens per session scan D 7d9bd37da863

Subscribe to this mod's changes

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