Rules / Format and vendor rules
import-outside-root
@import reaches outside the project.
Source: Claude Code docs: How Claude remembers your project (code.claude.com), read 14 October 2026.
On GitHub: the rule doc and the tests.
All rules73
What it catches#
@import reaches outside the project.
An @path import that reaches outside the project: a home-folder path such as @~/.claude/prefs.md, or a relative path that climbs above the root.
Why it matters#
Claude Code asks for approval before loading external imports, and teammates will not have the file.
Bad example#
# CLAUDE.md
@~/.claude/my-preferences.md
Claude Code treats an import outside the working directory as external and shows an approval dialog the first time; if the person declines, the import stays off. Teammates do not have the file at all, so the project instructions differ from one machine to the next.
Good example#
# CLAUDE.md
@docs/conventions.md
Personal preferences go in ~/.claude/CLAUDE.md, which loads for every project without a dialog, or in CLAUDE.local.md, which is gitignored.
How to fix#
Move the imported content into the repository, or move the import to a user-scope file (~/.claude/CLAUDE.md, ~/.claude/rules/) where external imports are trusted as your own configuration.
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 import-outside-root -- why this one is fine -->
For a whole file:
<!-- asitis-disable-file import-outside-root -- why this file is an exception -->
For every file, turn it off or change its severity in .asitisrc.json:
{ "rules": { "import-outside-root": "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.
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.