By sceat
Filesystem protection for Claude Code - lock files to prevent AI modifications
AI agents should be citizens of a system, not autonomous actors.
When you give an AI agent write access to your codebase, you're trusting it to make high-level decisions within your architecture. But agents drift. They "fix" things that aren't broken. They refactor code they don't fully understand. They modify configuration files because they think they know better.
Silent drift is the killer. You ask for a bug fix, and somewhere in the process the agent also:
frozen-gates removes the agent's ability to drift. It enforces hard boundaries at the filesystem level - boundaries the agent cannot negotiate, bypass, or "helpfully" work around.
Agents should operate at a higher level of abstraction:
The agent becomes a citizen operating within your system's constraints, not an autonomous actor rewriting the rules.
| Action | Who | Why |
|---|---|---|
| Lock | Human only | You define the boundaries |
| Unlock | Human only | Agent can NEVER unlock |
| Status | Claude + Human | Read-only awareness |
/plugin install frozen-gates --source github --repo sceat/frozen-gates-claude-plugin
chflags uchg)yq: brew install yqpyyaml: pip install pyyamlmkdir -p ~/.claude
cat > ~/.claude/frozengates.yaml << 'EOF'
version: 1
defaults:
loc:
limit: 500
extensions: [.ts, .tsx, .js, .jsx, .py, .rs]
repos:
# SDK code is foundational - agent should never touch it
my-sdk:
path: ~/dev/my-sdk
frozen_all: true
# Config files define the system - agent works within them
my-app:
path: ~/dev/my-app
frozen:
- package.json
- package-lock.json
- tsconfig.json
loc:
limit: 400
EOF
cat >> ~/.zshrc << 'EOF'
# Frozen gates - human-only lock/unlock
alias claude-lock='~/dev/sceat/frozen-gates-claude-plugin/scripts/frozengates.sh lock'
alias claude-unlock='~/dev/sceat/frozen-gates-claude-plugin/scripts/frozengates.sh unlock'
alias claude-status='~/dev/sceat/frozen-gates-claude-plugin/scripts/frozengates.sh status'
EOF
source ~/.zshrc
claude-lock # Requires sudo - this is intentional
Human (terminal):
claude-lock # Activate all boundaries
claude-unlock # Release boundaries (when YOU decide)
claude-status # View current state
Agent (plugin):
/frozen-gates:status # Agent can see boundaries, not change them
Even if the hook fails, the OS-level lock prevents modification. Belt and suspenders.
version: 1
defaults:
loc:
limit: 500 # Default max lines
extensions: [.ts, .tsx, .js, .jsx, .py, .rs] # Files to check
repos:
# Entire SDK is off-limits
my-sdk:
path: ~/dev/my-sdk
frozen_all: true
# Specific files frozen + custom LOC
my-app:
path: ~/dev/my-app
frozen:
- package.json
- tsconfig.json
loc:
limit: 400
exclude: ["*.test.ts"]
# LOC only (no frozen files)
my-scripts:
path: ~/dev/my-scripts
loc:
limit: 200
MIT
Modifies files
Hook triggers on file write and edit operations
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub Sceat/frozen-gates-claude-plugin --plugin frozen-gatesBlocks destructive commands outside the project directory. Allows file operations within the project (refactoring, cleanup) but prevents accidental damage outside it.
Safety hooks to block or require user approval for dangerous commands (rm, git operations, .env access, file size limits)
Block destructive git and filesystem commands before execution
Protect secrets and credentials from Claude Code. Blocks writes to .env files, detects API keys in shell commands, prevents hardcoded tokens, and guards service account JSON files.
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.