ClaudeCodeMod

All shelves / Mods / Safety

subagent-fence

By erikdarlingdata

subagent-fence is a Claude Code safety mod by erikdarlingdata.

Refuses a force-push, a push to a protected branch, a git command that skips hooks, and killing a process by name.

Holds a command

Install

The marketplace name is erikdarling.

In Claude Code
/plugin marketplace add erikdarlingdata/claude-plugins
/plugin install subagent-fence@erikdarling
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
1.0.0
License
MIT
Repo stars
25
Last change
2026-10-14

What it can reach

  • Holds a command
  • Sees tool calls

Needs a Claude Code version that loads plugin hook modules. It covers the main session and every subagent. A kill by name is refused because a name match can kill another session's processes. Protected branches default to main, master, and dev. Three more guards are off until you set them: one bans folders so nothing reads, writes, or enters them, one keeps a subagent out of a plain git checkout so it works in its own worktree, and one stops a subagent from reading a big text file whole.

The install name is subagent-fence. This page adds the author's name. The marketplace name is erikdarling. The marketplace also holds open-asks, subagent-wall, and other mods. This one installs on its own. The marketplace source is ./plugins/subagent-fence. The refused commands are why this page files it under safety. guardrails-lite holds a read of a secret .env file, a git force-push, and a recursive rm on /, ~, or $HOME. bash-guard holds every Bash call, blocks rm -rf on a home or system directory, and asks before a force-push, a hard reset, or a pipe into sh. This one refuses a force-push, a protected-branch push, a git command that skips hooks, and a kill by process name, for the main session and every subagent. The source lets the call through if the check itself fails.

Demo

The subagent-fence section of the README: its install line, the four things it refuses for the main session and every subagent, and three more guards that stay off until you set them.
Screenshot of the author's GitHub page.

What it hooks into

  • tool.callAround a tool call, where it can hold one

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Files

The author's source, 3 files. They load when you open them.

Facts

Author
erikdarlingdata
Category
Safety
Marketplace
erikdarling
Repo
erikdarlingdata/claude-plugins
Folder
plugins/subagent-fence
Version
1.0.0
License
MIT
Repo stars
25
Last change
2026-10-14
Language
TypeScript
Files
4

Other mods in Safety

launch-codesOneWave-AIHolds a commandHolds a dangerous shell command until you type a one-time code and press LAUNCH, and denies it otherwise.dogmaMarcel-BichHolds a commandRuns, asks about, or blocks git commands and deletes by your DOGMA-PERMISSIONS.md, always denies deleting a protected path, and draws the restricting rules.guard-packatretyak1985Holds a commandHolds file tools and shell moves that leave the project's roots, asks before a production deploy, and redacts secrets in a tool result before Claude reads it.supabase-guardSzotaszHolds a commandAsks before a Supabase write aimed at another project, or a destructive call, and stops the call when you refuse.secret-panebengousHolds a commandOpens a masked box beside the transcript when Claude needs a secret, gives Claude a placeholder, and puts the real value back only inside a Bash command.ultramodmertkayacsHolds a commandPacks ten mods: limits and context above the prompt, a guard with undo for rm -rf and git reset --hard, .env reads refused, and a receipt under each answer.envdavekissHolds a commandOpens a card when Claude needs a key, so you paste the value into a pane Claude can't read, and holds Claude's reads of .env files and commands that print them.model-allowlisterikdarlingdataHolds a commandRefuses a subagent spawn that pins a model id instead of a tier alias such as opus or sonnet, and holds spawns to model rules you write per agent type.ruflo-browserruvnetHolds a commandRefuses ruflo browser opens of file, javascript, data, or chrome URLs, credentialed or cloud-metadata hosts, unsafe Chrome flags, and cookie-reading scripts.ruflo-intelligenceruvnetHolds a commandRefuses a key, token, or password in what ruflo learns from, an email address in a public transfer, and a reset of ruflo's intelligence without confirm.ruflo-jujutsuruvnetHolds a commandRefuses a pull request ruflo creates or reviews when its title or body holds a key, token, or password, and a merge or close that does not carry confirm.ruflo-neural-traderruvnetHolds a commandRefuses a live order from ruflo's neural-trader tools unless it is confirmed, paper, or a dry run, and any trader call or memory write that holds a broker key.
All 73 in Safety