Repository navigation
feat(repo): repo budget counts .claude/rules #326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
napetrov
wants to merge
17
commits into
intel:main
Choose a base branch
from
napetrov:feat/budget-claude-rules
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ab3f5fb
feat(repo): repo budget counts .claude/rules
napetrov d4d63e8
fix(repo): rules: paths that names no pattern starts, warn on a linke…
napetrov 1b7ccad
fix(repo): warn on a rules link out of the tree; read paths as YAML f…
napetrov 82fd9bf
fix(repo): a rule frontmatter too deep for YAML no longer crashes budget
napetrov f1718b7
fix(repo): budget counts a rule linked to guidance once, at its loadi…
napetrov 21e287c
Merge branch 'main' of https://github.com/intel/dokimi into pq-326-fix
napetrov cc17f0d
fix(repo): budget reads rule frontmatter, links and promoted files as…
napetrov f2da52f
fix(repo): budget reads a paths key on its own, keeps rules out of th…
napetrov 6cc0717
fix(repo): rule exclusions follow the harness flag; an open flow list…
napetrov b1f2624
Docs: a rule a root guidance file imports is start whatever its paths
antonwolfy cd427e9
fix(budget): comments and alias links do not change how a rule's path…
napetrov adbfd73
fix(budget): an indented field of another key ends the paths block
napetrov 6d372ac
fix(budget): a scoped rule does not cover a cut import at start
napetrov b484dc8
Recognise a quoted key after empty paths as another field
antonwolfy b852254
Merge remote-tracking branch 'intel/main' into pr326-land1031
napetrov c09d9e4
fix(repo): budget keeps a root CLAUDE.md's imports and loads rule ali…
napetrov f4b58f8
fix(budget): follow an @ path of a rule a CLAUDE.md imports; cut-warn…
napetrov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
dokimi/changelog.d/20261030_180000_napetrov_budget-claude-rules.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ### Added | ||
|
|
||
| - **`repo budget` counts `.claude/rules`** — a `.claude/rules/**/*.md` file is a `rule` entry. | ||
| A rule in the root `.claude/rules/` whose `paths` frontmatter names no pattern is `start`; one | ||
| whose `paths` does, and every rule of a subdirectory's `.claude/rules/`, is `lazy`, unless a root `CLAUDE.md` or `AGENTS.md` imports it: then it is `start` whatever its `paths`. The | ||
| frontmatter is not counted, since Claude Code removes it before loading the rule, and an `@` | ||
| path in a rule is not followed, unless a CLAUDE.md imports the rule: then the rule loads at start and its `@` imports are followed, transitively and within the hop limit. A link to a directory under `.claude/rules` is a | ||
| warning: the rules behind it are not counted. A link under `.claude/rules` that does not resolve in | ||
| the tree is named too, whatever its suffix, since the tree cannot tell a dangling file from a directory; a | ||
| `CLAUDE.md` under `.claude/rules` is a rule, not guidance. Measured on Claude Code 2.1.304: a root rule | ||
| raised the first prompt by its size, `paths: []` included; a scoped or nested one loaded only | ||
| once the agent read a file it covers; a rule's `@extra.md` was not expanded. `start` was too | ||
| low by unscoped root rules before; `repo_budget.v1` widens `kind` with `rule`. Rules are counted | ||
| for a harness profile with the new optional `guidance.claude_rules: true` (`claude-code` | ||
| only); the Codex and Copilot profiles leave it unset. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: importing a rule from a nested CLAUDE.md does not necessarily load it at start. With
sub/CLAUDE.md = "@.claude/rules/r.md\n"andsub/.claude/rules/r.md = "---\npaths: src/**\n---\nbody\n", the implementation reports the rule aslazy, even with an in-limit import. Distinguish import expansion from loading time: root guidance imports load at start; nested guidance imports load lazily. The same unconditional 'then the rule loads at start' wording appears in architecture.md and the changelog fragment and should be corrected there too.