Skip to content

Commit cd38a6e

Browse files
committed
Ignore AI assistant config files in project scanning
Exclude CLAUDE.md and AGENTS.md from project input files and extension templates to prevent AI assistant configuration from being inadvertently rendered as content.
1 parent a678464 commit cd38a6e

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎news/changelog-1.9.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,4 @@ All changes included in 1.9:
130130
- ([#13656](https://github.com/quarto-dev/quarto-cli/issues/13656)): Fix R code cells with empty `lang: ""` option producing invalid markdown class attributes.
131131
- ([#13832](https://github.com/quarto-dev/quarto-cli/pull/13832)): Fix `license.text` metadata not being accessible when using an inline license (`license: "text"`), and populate it with the license name for CC licenses instead of empty string. (author: @mcanouil)
132132
- ([#13856](https://github.com/quarto-dev/quarto-cli/issues/13856)): Add code annotation support for Typst and Observable.js code blocks. (author: @mcanouil)
133+
- Ignore AI assistant configuration files (`CLAUDE.md`, `AGENTS.md`) when scanning for project input files and in extension templates, similar to how `README.md` is handled.

‎src/extension/template.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,6 @@ const kBuiltInExcludes = [
5757
"COPYRIGHT",
5858
"LICENSE",
5959
"_extensions",
60+
"CLAUDE.md",
61+
"AGENTS.md",
6062
];

‎src/project/project-context.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,9 @@ function projectHiddenIgnoreGlob(dir: string) {
873873
return projectIgnoreGlobs(dir) // standard ignores for all projects
874874
.concat(["**/_*", "**/_*/**"]) // underscore prefx
875875
.concat(["**/.*", "**/.*/**"]) // hidden (dot prefix)
876-
.concat(["**/README.?([Rrq])md"]); // README
876+
.concat(["**/README.?([Rrq])md"]) // README
877+
.concat(["**/CLAUDE.md"]) // Anthropic claude code file
878+
.concat(["**/AGENTS.md"]); // https://agents.md/
877879
}
878880

879881
export const projectInputFiles = makeTimedFunctionAsync(

0 commit comments

Comments
 (0)