Skip to content
youdede

Executable permission guard

SecurityHookv1.0.0

A deterministic Claude Code PreToolUse gate for git commit that examines bounded staged mode changes and blocks executable permission added to declarative or documentation files, or to text scripts without a recognized shebang.

Runs on

Scope
$npx @youdede/toolkit add executable-permission-guard --target claude-code

What it does

Reject suspicious staged executable-bit additions before they enter repository history.

When it fires

  • pre-commit
  • review
  • release

How it behaves

Inspect staged Git modes and bounded blob prefixes before accepting newly executable repository files.

It does not chmod, rewrite, stage, unstage, execute, sign, or approve a file.

It does not claim that a recognized shebang makes a program safe or portable.

It does not inspect filesystem permissions that are not represented in the staged Git index.

It does not provide a repository-authored extension or path bypass.

Configuration

targets/claude-code/executable-permission-guard.mjsnode · read-only

Version
1.0.0
Requires
Shell command guard
Licence
RiskThis automatic gate rejects suspicious staged executable-bit additions before they enter repository history; a false denial can interrupt legitimate work, but it does not execute the blocked action.
Medium
ModeHow it works: fixed rules, model instructions, or both.
Deterministic only
Behaviour
Enforces, blocks on violation
On failure
Denies and blocks
LatencyTo reject suspicious staged executable-bit additions before they enter repository history, the entrypoint may run a bounded local subprocess before returning.
Bounded
Data retentionWhether data remains after use and who manages its storage.
Not retained

Often used with

All in Security