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: src/core/prompts/tools/read-file.ts
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ export function getReadFileDescription(args: ToolArgs): string {
4
4
return`## read_file
5
5
Description: Request to read the contents of one or more files. The tool outputs line-numbered content (e.g. "1 | const x = 1") for easy reference when creating diffs or discussing code. Use line ranges to efficiently read specific portions of large files. Supports text extraction from PDF and DOCX files, but may not handle other binary files properly.
6
6
7
+
${args.settings?.maxConcurrentFileReads ? `**IMPORTANT: You can read a maximum of ${args.settings?.maxConcurrentFileReads} files in a single request.** If you need to read more files, use multiple sequential read_file requests.` : ""}
8
+
7
9
Parameters:
8
10
- args: Contains one or more file elements, where each file contains:
9
11
- path: (required) File path (relative to workspace directory ${args.cwd})
@@ -32,7 +34,7 @@ Examples:
32
34
</args>
33
35
</read_file>
34
36
35
-
2. Reading multiple files with different line ranges:
37
+
2. Reading multiple files with different line ranges${args.settings?.maxConcurrentFileReads ? ` (within the ${args.settings?.maxConcurrentFileReads}-file limit)` : ""}:
36
38
<read_file>
37
39
<args>
38
40
<file>
@@ -57,9 +59,10 @@ Examples:
57
59
</read_file>
58
60
59
61
IMPORTANT: You MUST use this Efficient Reading Strategy:
60
-
- You MUST read all related files and implementations together in a single operation
62
+
- You MUST read all related files and implementations together in a single operation${args.settings?.maxConcurrentFileReads ? ` (up to ${args.settings?.maxConcurrentFileReads} files at once)` : ""}
61
63
- You MUST obtain all necessary context before proceeding with changes
62
64
- You MUST combine adjacent line ranges (<10 lines apart)
63
65
- You MUST use multiple ranges for content separated by >10 lines
64
-
- You MUST include sufficient line context for planned modifications while keeping ranges minimal`
66
+
- You MUST include sufficient line context for planned modifications while keeping ranges minimal
67
+
${args.settings?.maxConcurrentFileReads ? `- When you need to read more than ${args.settings?.maxConcurrentFileReads} files, prioritize the most critical files first, then use subsequent read_file requests for additional files` : ""}`
0 commit comments