Skip to content
youdede

Symlink publication guard

SecurityHookv1.0.0

A deterministic Claude Code PreToolUse gate for git commit that inspects bounded staged symbolic-link blobs and rejects absolute targets, repository escapes, control characters, or targets whose normalized path cannot be proven contained.

Runs on

Scope
$npx @youdede/toolkit add symlink-publication-guard --target claude-code

What it does

Prevent commits from publishing symbolic links that escape or ambiguously traverse the repository.

When it fires

  • pre-commit
  • review
  • release

How it behaves

Inspect staged symbolic-link targets before commit and prevent repository-escaping or ambiguous publication.

It does not create, rewrite, resolve, follow, approve, or remove a symbolic link.

It does not claim that a contained symbolic-link target exists or is safe to consume.

It does not inspect links the intercepted Git commit cannot publish or links produced outside the intercepted Git commit path.

It does not expose a repository-controlled exception list or command-line bypass.

Configuration

targets/claude-code/symlink-publication-guard.mjsnode · read-only

Version
1.0.0
Requires
Shell command guard
Licence
RiskThis automatic gate prevents commits from publishing symbolic links that escape or ambiguously traverse the repository; 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 prevent commits from publishing symbolic links that escape or ambiguously traverse the repository, 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