header

A command that creates or updates a structured header comment at the top of a source file. It examines the file's role, related files, important rules, and available verification commands.

In plain words
What is it for?
Use it when adding documentation to an existing Python, TypeScript, JavaScript, Go, or Rust source file.
Why use it?
It makes a file's purpose, dependencies, constraints, and ways to test it easier for future developers and coding agents to understand.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/tk-logl/sentinel/header
Clone the repo
git clone --depth 1 https://github.com/tk-logl/sentinel
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 652 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.00652
Opus 5 $0.00006 $0.00326
Sonnet 5 $0.00003 $0.00130
Haiku 4.5 $0.00001 $0.00065

Measured yesterday against content hash a02791be265e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

header scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/header.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/sentinel:header [file_path]

Generate a structured file header for the specified source file.

What to Do

  1. Read the target file — understand its role, imports, exports
  2. Analyze co-modify relationships:
    # Find files that change together (git log analysis)
    git log --oneline --name-only -- [file_path] | grep -E '\.(py|ts|tsx|js|jsx|go|rs)$' | sort | uniq -c | sort -rn | head -5
    
    # Find files that import from this file
    grep -rn "from.*$(basename [file_path] .py) import\|import.*$(basename [file_path] .py)" . --include="*.py" | head -5
    
    # Find files this file imports from
    grep -n "^import\|^from" [file_path] | head -10
    
  3. Identify invariants — what must NEVER break in this file:
    • Security constraints (auth, sanitization, encryption)
    • Data integrity rules (validation, consistency)
    • Architectural contracts (API shapes, interfaces)
  4. Find verify commands — how to test this file:
    • Look for test files: test_$(basename).py, $(basename).test.ts
    • Check package.json/pyproject.toml for test commands
  5. Generate the header in the appropriate format for the file type
  6. Add it to the file — insert at the very top (after shebang/encoding lines if present)

Header Template

Python

"""
{filename} — {one-sentence role description}.

Co-modify: {2-4 related files}
Invariants:
  - {critical rule 1}
  - {critical rule 2}
  - {critical rule 3}
Verify: {test command}
"""

TypeScript/JavaScript

/**
 * {filename} — {one-sentence role description}.
 *
 * Co-modify: {2-4 related files}
 * Invariants:
 *   - {critical rule 1}
 *   - {critical rule 2}
 *   - {critical rule 3}
 * Verify: {test command}
 */

Go

// {filename} — {one-sentence role description}.
//
// Co-modify: {2-4 related files}
// Invariants:
//   - {critical rule 1}
//   - {critical rule 2}
// Verify: {test command}

Rules

  • Keep headers 5-12 lines (not longer)
  • Role description must be specific, not generic
  • Co-modify files must be real files that exist in the project
  • Invariants must be behavioral (not style rules)
  • Verify command must be copy-pasteable and runnable
  • If file already has a header, UPDATE it — don't add a second one

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 84 lines · 13 tokens per session scan A a02791be265e

Subscribe to this mod's changes

header is a command published in the GitHub repository tk-logl/sentinel (4 stars, last pushed 5mo ago), licensed MIT. It adds 13 tokens to every session and 652 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.