Effective rules
In a monorepo, rules can live at the root, in each package and in any folder below it. The Effective Rules view shows, for any file, the rules that actually apply to it, merged from the root down through its package and folders, with markers where a deeper rule overrides a higher one.
How rules stack in a monorepo
| Layer | Where | Applies to |
|---|---|---|
| Global | ~/.ingot/rules, ~/.ingot/AGENTS.md | every project on this machine |
| Root | .ingot/rules, imported rule folders, the root AGENTS.md | the whole project |
| Package | <package>/.ingot/rules, <package>/AGENTS.md | files in that package (a folder with package.json, pyproject.toml, go.mod, Cargo.toml and similar) |
| Folder | <folder>/.ingot/rules, <folder>/AGENTS.md | files under that folder |
Two rules decide what wins:
- Same name, deeper folder wins.
packages/web/.ingot/rules/style.mdreplaces the root.ingot/rules/style.mdfor files inpackages/web. - Nearest
AGENTS.md. The rootAGENTS.mdalways loads; of the nested ones, only the closest one above the file loads.
Inside one folder, .ingot rules win over legacy and imported rules with the same name.
Open the view
- Right-click a file in the project tree or in the editor › Show Effective Rules.
- Find Action (⌘⇧A / Ctrl+Shift+A) › Show Effective Rules for File, or press ⌘⌥⇧E (Ctrl+Alt+Shift+E) for the active editor.
Type or pick another path in the File box to compare files; the target button jumps back to the active editor.
Reading the view
The layer chips at the top show the path the merge took, for example Root › Package packages/web/ › Folder packages/web/src/components/. Below, every rule is listed under its layer with a status:
| Status | Meaning |
|---|---|
| applied | loads for this file (always on, glob match or nearest AGENTS.md) |
| on request | the agent loads it when its description fits the task |
| @-mention only | loads only when you @-mention it |
| no glob match | its globs don't match this file |
| overridden | a rule with the same name in a deeper folder replaces it |
| shadowed | a rule with the same name in a stronger folder (.ingot over .cursor) replaces it |
Override markers connect the two sides: ↓ overridden by packages/web/style on the replaced rule and ↑ overrides style on the one that replaces it. When a deeper rule contradicts a single line of a higher rule (named vs default exports, tabs vs spaces), the higher line is struck through and the replacing line is shown with its file and line number. Contradictions inside the same layer are flagged with ⚠ — those are real conflicts for Rules Doctor to report.
Open Merged instructions to read the final text the agent gets for this file, in load order. The token count at the top is the cost of everything that applies.
From the terminal
ingot effective packages/web/src/components/Button.tsx # layers, statuses and markers
ingot effective packages/web/src/components/Button.tsx --merged # plus the merged instructions
ingot effective packages/web/src/components/Button.tsx --json
Related
- Rules and /init & AGENTS.md
- Rule hits & provenance: what a real agent turn loaded
- Rules Doctor: overrides and conflicts across the whole project