Skip to main content
rule CX Codex

file-headers — Claude Code rule: a header in every source file

file-headers makes each source file open with a short, honest overview plus the exact line @author Son Nguyen <[email protected]>.

MIT ★ 1,198 updated 2026-10-23

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/file-headers.md
Open on GitHub

What file-headers does

The rule covers .js, .ts, .tsx, .cjs, .mjs, .py, .sh and .css. Each of those files starts with a comment saying what the file actually does, then the exact author line. Dependencies, build output, data dumps, worktrees, minified or vendored code, the generated wiki/i18n-content.js and snapshots stay out of scope.

It binds the agent, not the developer. A new file gets its header before any code, and in shell scripts after the shebang. Touch a file with no header and the same change adds one. If your edit shifts what the file is for, the overview gets rewritten too.

The check is a script: bash .claude/skills/file-headers/scripts/check-headers.sh has to exit 0. Formats and the script both sit under .claude/skills/file-headers/, so the rule only polices a project where that skill is present. Installation is one file at .claude/rules/file-headers.md.

What it helps with

  • add a header to a new file before the first commit
  • restore the header a refactor stripped out
  • rewrite the overview when a file's job changes
  • audit author lines across the repo in one run
  • fail the build when a source file ships without a header

Example prompts for the agent

  • Create src/metrics.ts and put the @author Son Nguyen <[email protected]> header on top before writing any code.
  • scripts/deploy.sh has no header. Add one after the shebang and leave the logic alone.
  • Run bash .claude/skills/file-headers/scripts/check-headers.sh and fix every file it flags.

How to install file-headers

Manually: put the files in place

.claude/rules/file-headers.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about file-headers

How do I install file-headers in Claude Code?

Place the rule file at .claude/rules/file-headers.md. Claude loads rules from that directory.

What does file-headers do?

It makes every applicable source file start with a short overview and the exact @author Son Nguyen <[email protected]> line. Files you merely edit get the header too.

How do I check that the whole repo complies?

Run bash .claude/skills/file-headers/scripts/check-headers.sh; it must exit 0. The script and the header formats live in .claude/skills/file-headers/.

Source text

file-headers.md · MIT
# File Header Rules (binding for every coding agent)

- Every applicable source file (`.js/.ts/.tsx/.cjs/.mjs/.py/.sh/.css` — excluding `node_modules/`, `dist/`, `data/`, `.worktrees/`, minified/vendored, generated `wiki/i18n-content.js`, snapshots) MUST start with the header comment: a truthful file overview plus the exact line `@author Son Nguyen <[email protected]>`.
- Creating a new applicable file → write the header before any code (after the shebang in scripts).
- Editing a file that lacks the header → add it in the same change; if the edit changes the file's purpose, update the overview.
- Formats and the repo-wide audit script live in `.claude/skills/file-headers/` (`bash .claude/skills/file-headers/scripts/check-headers.sh` must exit 0).

© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

From the same set155

The whole set →
report report is a Claude Code command that creates CCAM executive, cost, reliability, or workflow reports. Specify a report type and data scope in the request. CX Codex +1 ★ 1,198repo stars release-guard release-guard is a Claude Code skill that checks a repository before merge or release, comparing documented commands with package.json and architecture notes with current code paths. CX Codex +1 ★ 1,198repo stars repo-onboarding repo-onboarding guides AI coding agents through codebase architecture, layer selection, and test command discovery before editing. CX Codex +1 ★ 1,198repo stars mcp-maintainer The mcp-maintainer skill guides maintenance of the repository’s local MCP server, from checking its API to validating tool changes. Use it when updating MCP tools or investigating runtime issues. CX Codex +1 ★ 1,198repo stars status Polls the local Claude Code Agent Monitor dashboard to print health status and session counts in a single line. CX Codex +1 ★ 1,198repo stars open-dashboard open-dashboard prints the Agent Monitor address and the commands to start or open it. Use it when you need the local dashboard instructions. CX Codex +1 ★ 1,198repo stars report-analyst report-analyst builds executive, cost, reliability and workflow reports from a local CCAM API, keeping units, scope and data freshness intact. Handy when a stakeholder summary has to hold up to scrutiny. CX Codex ★ 1,198repo stars ping ping is a Claude Code command that checks the local Agent Monitor dashboard API and reports its reachability. CX Codex +1 ★ 1,198repo stars

Project sponsors

Companies that keep this analytics open