/keepout:keepoutfrom keepout
Protect files from AI agents at the OS level. Use when the user wants to stop an agent from reading secrets (.env, keys, credentials), make files or folders read-only or append-only for agents, asks why a file read/write failed with "Operation not permitted" or "Permission denied", or when a .keepout file exists in the project. Rules are enforced by the kernel for every tool and subprocess, not just tool hooks.
Ships in keepout. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
keepout enforces file rules from a .keepout file (gitignore syntax) using the OS
kernel (macOS Seatbelt, Linux bubblewrap). Everything the agent runs is covered: its file tools, cat,
python, scripts, and subprocesses.
Install: uv tool install keepout or pipx install keepout (Linux also needs bubblewrap).
keepout init --json in the project root. This writes .keepout with safe defaults
(.env*, keys, ~/.ssh/id_*, ~/.aws/credentials, ...), adds a short rules note
to AGENTS.md / CLAUDE.md, and installs Claude Code hooks for clear error messages..keepout:
[no-read]: can't read, copy, move or edit (secrets)[read-only]: can read, can't modify or delete (migrations, lockfiles, vendored code)[append-only]: can only add to the end (logs, journals, decision records)!pattern adds an exception, e.g. !.env.examplekeepout claude (or
keepout codex, keepout <any command>). The rules only apply to processes started
this way. You can't sandbox the session you're already in.KEEPOUT=1 in env)Operation not permitted (Linux: Permission denied). Don't retry through other
tools. Every path to the file is blocked, and retrying wastes the user's time.keepout why <path> --json, which returns
allowed per op plus the deciding rule.keepout status --json>>, open(p, "a")). Rewrites fail,
and so do editors that save by writing a temp file and renaming it.keepout propose add|remove <section> <pattern> --reason "..."
then ask the user to run keepout apply and restart the session.
Prefer alternatives first. For example, have the program load .env itself rather
than reading the secret yourself.keepout test --json runs an attack matrix (cat, python, symlink, hardlink, rename,
case tricks, truncate, and so on) in a temp dir and reports pass/fail for each check.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (sahasrarjn/keepout) — no native marketplace selected
npx claudepluginhub p/sahasrarjn-keepout