Skip to content

Commit 07ab1fd

Browse files
committed
fix(@schematics/angular): generate CLAUDE.md for Claude Code instead of AGENTS.md
Fixes #33817 Claude Code explicitly looks for a `CLAUDE.md` file in the project directory at the start of every session. In a previous update, this was unintentionally changed to generate `AGENTS.md`, which is a different community standard. This commit restores the generation of `CLAUDE.md` for Claude Code.
1 parent 45565dd commit 07ab1fd

4 files changed

Lines changed: 14 additions & 10 deletions

File tree

packages/schematics/angular/ai-config/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ const AGENTS_MD_CFG: ContextFileInfo = {
1919

2020
const AI_TOOLS: { [key in Exclude<Tool, Tool.None>]: ContextFileInfo[] } = {
2121
['claude-code']: [
22-
AGENTS_MD_CFG,
22+
{
23+
type: ContextFileType.BestPracticesMd,
24+
name: 'CLAUDE.md',
25+
directory: '.',
26+
},
2327
{
2428
type: ContextFileType.McpConfig,
2529
name: '.mcp.json',

packages/schematics/angular/ai-config/index_spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ describe('AI Config Schematic', () => {
3232
workspaceTree = await schematicRunner.runSchematic('workspace', workspaceOptions);
3333
});
3434

35-
it('should create Angular MCP server config and AGENTS.md for Claude Code', async () => {
35+
it('should create Angular MCP server config and CLAUDE.md for Claude Code', async () => {
3636
const tree = await runAiConfigSchematic([ConfigTool.ClaudeCode]);
37-
expect(tree.exists('AGENTS.md')).toBeTruthy();
37+
expect(tree.exists('CLAUDE.md')).toBeTruthy();
3838
expect(tree.exists('.mcp.json')).toBeTruthy();
3939
});
4040

@@ -89,17 +89,17 @@ describe('AI Config Schematic', () => {
8989

9090
it('should omit best practices creation, if the file already exists', async () => {
9191
const customContent = 'custom user content';
92-
workspaceTree.create('AGENTS.md', customContent);
92+
workspaceTree.create('CLAUDE.md', customContent);
9393

9494
const messages: string[] = [];
9595
const loggerSubscription = schematicRunner.logger.subscribe((x) => messages.push(x.message));
9696

9797
try {
9898
const tree = await runAiConfigSchematic([ConfigTool.ClaudeCode]);
9999

100-
expect(tree.readContent('AGENTS.md')).toBe(customContent);
100+
expect(tree.readContent('CLAUDE.md')).toBe(customContent);
101101
expect(messages).toContain(
102-
`Skipping configuration file for 'ClaudeCode' at './AGENTS.md' because it already exists.\n` +
102+
`Skipping configuration file for 'ClaudeCode' at './CLAUDE.md' because it already exists.\n` +
103103
'This is to prevent overwriting a potentially customized file. ' +
104104
'If you want to regenerate it with Angular recommended defaults, please delete the existing file and re-run the command.\n' +
105105
'You can review the latest recommendations at https://angular.dev/ai/develop-with-ai.\n',

packages/schematics/angular/ai-config/schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"title": "Angular AI Config File Options Schema",
55
"type": "object",
66
"additionalProperties": false,
7-
"description": "Generates AI configuration files for Angular projects. This schematic creates AGENTS.md file and Angular MCP server configuration, improving the quality of AI-generated code and suggestions.",
7+
"description": "Generates AI configuration files for Angular projects. This schematic creates instruction files (e.g. AGENTS.md, CLAUDE.md) and Angular MCP server configuration, improving the quality of AI-generated code and suggestions.",
88
"properties": {
99
"tool": {
1010
"type": "array",
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
"value": "claude-code",
23-
"label": "Claude Code [ `AGENTS.md` + Angular MCP server config ]"
23+
"label": "Claude Code [ `CLAUDE.md` + Angular MCP server config ]"
2424
},
2525
{
2626
"value": "cursor",
@@ -40,7 +40,7 @@
4040
}
4141
]
4242
},
43-
"description": "Specifies which AI tools to generate configuration files (AGENTS.md, MCP server config) for.",
43+
"description": "Specifies which AI tools to generate configuration files (AGENTS.md, CLAUDE.md, MCP server config) for.",
4444
"items": {
4545
"type": "string",
4646
"enum": ["none", "claude-code", "cursor", "gemini-cli", "open-ai-codex", "vscode"]

packages/schematics/angular/ng-new/index_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ describe('Ng New Schematic', () => {
109109

110110
const tree = await schematicRunner.runSchematic('ng-new', options);
111111
const files = tree.files;
112-
expect(files).toContain('/bar/AGENTS.md');
112+
expect(files).toContain('/bar/CLAUDE.md');
113113
expect(files).toContain('/bar/.mcp.json');
114114
expect(files).toContain('/bar/.gemini/GEMINI.md');
115115
expect(files).toContain('/bar/.gemini/settings.json');

0 commit comments

Comments
 (0)