Back to all rules / Format and vendor rules
broken-import
@import names a file that does not exist.
Source: Claude Code docs: How Claude remembers your project (code.claude.com), read 14 October 2026.
On GitHub: the rule doc and the tests.
Jump to another rule89
What it catches#
@import names a file that does not exist.
An @path import in a CLAUDE.md, a .claude/rules/ file, a GEMINI.md, or an AGENTS.md that Claude Code reads directly, where the file does not exist. The import is silent: Claude Code and Gemini CLI load what they can find and say nothing about the rest. A token that looks like an npm package (@scope/name, one slash, no extension) is a note with a hint, because it is far more often a package name than a file, and in a heading (# @scope/name) it is not reported at all. An @name inside double quotes ("Thanks @user") is a mention, not an import.
Also reported:
- An import whose file exists but which still loads nothing. Claude Code and Gemini CLI take the whole word after
@, punctuation included, soSee @guide.md: for detailsasks for a file namedguide.md:. The same goes for@guide.md.at the end of a sentence,(see @guide.md), and(@guide.md), where the@does not follow a space. Bold (**@guide.md**) and a#sectionanchor are fine in Claude Code. - An import Claude Code leaves as plain text because it sits in an HTML block: the line above it holds only a tag such as
<role>or</role>(or a block tag such as<div>), with no blank line in between. CommonMark runs such a block to the next blank line, and Claude Code does not expand an@pathinside it (anthropics/claude-code#110857, checked with Claude Code 2.1.328).asitis loadsleaves those files out too. Gemini CLI is not affected. - A broken import inside an imported file, reported on the import that starts the chain (
"@docs/a.md -> @b.md -> @missing.md"). Claude Code follows imports 4 hops deep and Gemini CLI 5, so a file further down is reported as not loaded unless a shorter chain reaches it.
Why it matters#
Claude Code and Gemini CLI load imported files with the instructions. A missing file means the instructions are silently incomplete.
Bad example#
@AGENTS.md
@docs/conventions.md
@docs/missing-guide.md
docs/missing-guide.md was renamed to docs/contributing.md last quarter. The team believes the contributing rules are loaded in every session; they have not been since the rename.
Good example#
@AGENTS.md
@docs/conventions.md
@docs/contributing.md
We use `@tanstack/query` for data fetching.
The package name is in backticks, so it is not read as an import.
How to fix#
Correct the path (relative to the file that contains the import) or remove the line. Wrap package names and handles in backticks when they start a line.
Suppress or configure#
For one finding, put a comment on the line above it. The reason after -- is optional but worth writing:
<!-- asitis-disable-next-line broken-import -- why this one is fine -->
For a whole file:
<!-- asitis-disable-file broken-import -- why this file is an exception -->
For every file, turn it off or change its severity in .asitisrc.json:
{ "rules": { "broken-import": "off" } }
A .asitisrc.json overrides entry limits a change to some paths, and a baseline (asitis lint --format json --write-baseline) accepts today's findings so only new ones fail the build.
Source#
Claude Code docs: How Claude remembers your project, read on 14 October 2026.
See what an agent changed in your CLAUDE.md. Keep or revert each change.
The linter is free and needs no signup. I'm also building a desktop editor for the markdown your agents write and read. It shows what an agent changed since you last looked, lets you keep or revert each change, and never touches a line you didn't edit. No release date yet. One email to confirm, one when the paid beta opens, one when 1.0 ships. $29 once for a founding licence, with 24 months of updates.
Or add the linter to CI, no email needed.
Your address is stored with Cloudflare, which hosts this site. No IP address is kept. See the privacy policy.
Related guides
Run the rule
- In your browser, on one file
- In Claude Code, on the project
- In CI, on every pull request
This page is generated from the plugin's rule registry. Edit it on GitHub. False positive? Open an issue with the line it fired on.