file-size-policy — Claude Code rule: 500-line limit skips JSON
file-size-policy — a review rule that keeps the 500-line guideline on source files only. Your agent stops telling you to split a large JSON file.
Apache-2.0 ★ 1,118 updated 2026-10-24
.claude/rules/file-size-policy.mdWhat file-size-policy does
Review agents often carry a line-count threshold. This rule pins down where the 500-line mark belongs: source code. JSON is out of scope, so no finding about its length shows up and no split is suggested just because a config passed the limit.
Only that one class of comment goes away. Correctness, security, schema, trust-boundary, duplication and generated-churn checks still run on JSON, as the rule states plainly.
For Claude it lands in the project as .claude/rules/file-size-policy.md. JSON review is not switched off wholesale, since schema and trust boundaries keep being checked. What changes is the reflex to treat a big config as a refactoring job.
What it helps with
- stop review comments about JSON file length
- keep the 500-line threshold off config files
- preserve schema and trust-boundary checks on JSON
- cut noise in diffs of large generated configs
- state which files the line limit covers
Example prompts for the agent
- Review
config.jsonfor schema and trust boundaries, skip the line-count findings. - Don't suggest splitting
package-lock.jsonbecause of its size, check correctness only. - Apply the
file-size-policyrule to this pull request.
How to install file-size-policy
Manually: put the files in place
.claude/rules/file-size-policy.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/file-size-policy.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/file-size-policy.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/file-size-policy.mdManually: put the files in place
.clinerules/file-size-policy.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about file-size-policy
How do I install file-size-policy in Claude Code?
Place the rule in your project as .claude/rules/file-size-policy.md, with the rule text inside.
What does file-size-policy do?
It limits the 500-line maintainability guideline to source-code files and blocks size findings on *.json.
Does it turn off JSON review entirely?
No. Correctness, security, schema, trust-boundary, duplication and generated-churn checks stay on.
Source text
file-size-policy.md · Apache-2.0
# File-size policy The 500-line maintainability guideline applies to source-code files, not `*.json`. Do not raise file-size or line-count findings for JSON and do not recommend splitting JSON solely because it exceeds 500 lines. Keep correctness, security, schema, trust-boundary, duplication, and generated-churn review enabled for JSON.
© hashgraph-online · Apache-2.0 · hashgraph-online/hol-guard