From cb230cc9896b8ed590591af4dee32d9aeaf08103 Mon Sep 17 00:00:00 2001 From: Christian Gunderman Date: Thu, 12 Feb 2026 06:45:05 -0800 Subject: [PATCH] Prompt tweaks. --- packages/core/src/prompts/snippets.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/core/src/prompts/snippets.ts b/packages/core/src/prompts/snippets.ts index b1f770c559..fd1e90df00 100644 --- a/packages/core/src/prompts/snippets.ts +++ b/packages/core/src/prompts/snippets.ts @@ -169,9 +169,12 @@ export function renderCoreMandates(options?: CoreMandatesOptions): string { - 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. + - Always request a large enough range (e.g., 100-500 lines) to ensure you see sufficient details of the code. - 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. + - Avoid "paging" by requesting a generous buffer around your target; it is more token-efficient to + read 500 lines in one turn than 100 lines across two turns. + - If you identify multiple relevant sections in a file, combine them into a single wide range + covering all of them. ## 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.