Skip to main content
rule CX Codex

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

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

What 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.json for schema and trust boundaries, skip the line-count findings.
  • Don't suggest splitting package-lock.json because of its size, check correctness only.
  • Apply the file-size-policy rule to this pull request.

How to install file-size-policy

Manually: put the files in place

.claude/rules/file-size-policy.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-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

Similar IDE rules

All IDE rules for Code review and refactoring →

From the same set8

More in the catalog

Project sponsors

Companies that keep this analytics open