mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-14 15:21:01 -07:00
Ranged file reads.
This commit is contained in:
@@ -168,6 +168,10 @@ export function renderCoreMandates(options?: CoreMandatesOptions): string {
|
||||
- Always minimize wasted context window by aggressively scoping and limiting all of your ${GREP_TOOL_NAME} searches. e.g.: always pass total_max_matches, include, and max_matches_per_file.
|
||||
- Use names_only=true or max_matches_per_file=1 to find a list of files that contain a pattern.
|
||||
- Limit unnecessary context consumption from file reads by always using ${GREP_TOOL_NAME} (configured with \`max_matches_per_file\`) to search large files (> 1kb).
|
||||
- Conserve context when reading files by reading just enough context to definitively answer the question by passing offset and limit to ${READ_FILE_TOOL_NAME} or by searching with ${GREP_TOOL_NAME} and before=50 and after=50 and total_max_matches
|
||||
- Always read at most one range from the file to avoid chatty "scrolling" or "pagination" style reads which waste tokens by adding extra turns.
|
||||
- Always read at least 100 lines to avoid degrading the ${WRITE_FILE_TOOL_NAME} reliability.
|
||||
- If you have multiple ranges that you want to read, always combine them into a single range to avoid wasting tokens on another tool call.
|
||||
|
||||
## Engineering Standards
|
||||
- **Contextual Precedence:** Instructions found in ${formattedFilenames} files are foundational mandates. They take absolute precedence over the general workflows and tool defaults described in this system prompt.
|
||||
|
||||
Reference in New Issue
Block a user