You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/settings/repo-rules.mdx
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,12 +47,14 @@ Codegen automatically searches for the following types of rule files in your rep
47
47
-**`.windsurfrules`** - Windsurf AI editor rules
48
48
-**`**/*.mdc`** - Markdown files with `.mdc` extension anywhere in the repository
49
49
-**`.cursor/rules/**/*.mdc`** - Markdown files in the `.cursor/rules/` directory structure
50
+
-**`CLAUDE.md`**, **`AGENTS.md`**, **`AGENT.md`** - top-level docs commonly used to instruct AI agents
50
51
51
52
### How Automatic Detection Works
52
53
53
54
1.**File Discovery**: When you switch to a repository, Codegen uses `ripgrep` to search for files matching the supported patterns
54
55
2.**Content Extraction**: The content of discovered files is read and processed
55
-
3.**Size Limitation**: All rule files combined are truncated to fit within 3,000 characters total to ensure optimal performance
56
+
-**New**: The content is encoded to preserve formatting during transport, then decoded before being presented to the agent
57
+
3.**Size Limitation (25k global budget)**: All rule files combined are truncated to fit within a 25,000 character global budget to ensure optimal performance
56
58
4.**Context Integration**: The rule content is automatically included in the agent's context alongside any manual repository rules
57
59
58
60
### Example Rule Files
@@ -82,6 +84,10 @@ Prefer functional components over class components in React
82
84
- Include request/response validation
83
85
```
84
86
87
+
### Visibility in UI
88
+
89
+
When rules are discovered, they are displayed in the AgentTrace under the `SetActiveCodebase` tool card as "Repository Rules (Filesystem)". You can expand each entry to preview the content and open the source file on GitHub.
90
+
85
91
### Benefits of Automatic Rule Files
86
92
87
93
-**Version Control**: Rule files are committed with your code, ensuring consistency across team members
@@ -94,7 +100,7 @@ Prefer functional components over class components in React
94
100
</Tip>
95
101
96
102
<Warning>
97
-
If your rule files exceed 3,000 characters combined, they will be automatically truncated. Consider keeping rule files concise or splitting them into multiple focused files.
103
+
If your rule files exceed the global 25,000 character budget, they will be truncated per-file and/or at the aggregate level. Keep rule files concise or split them into focused files.
Copy file name to clipboardExpand all lines: docs/settings/repo-rules.tsx
+34Lines changed: 34 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,40 @@ When an agent is assigned a task on a repository with defined rules, those rules
14
14
15
15
Forexample,ifyouhavearulelike"Always use tabs for indentation,"theagentwillberemindedofthispreferencebeforeitstartswritingormodifyingcodeinthatrepository.
0 commit comments