From 6f52a7fd3e5fd59072f7f15bc1c480c4bf00d210 Mon Sep 17 00:00:00 2001 From: Christian Gunderman Date: Thu, 5 Feb 2026 08:30:33 -0800 Subject: [PATCH] Prompt changes to discourage extra turns. --- packages/core/src/prompts/snippets.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/core/src/prompts/snippets.ts b/packages/core/src/prompts/snippets.ts index 4be3236afa..ecaffb3c82 100644 --- a/packages/core/src/prompts/snippets.ts +++ b/packages/core/src/prompts/snippets.ts @@ -136,9 +136,12 @@ export function renderCoreMandates(options?: CoreMandatesOptions): string { # Core Mandates - **Context Efficiency:** - - Avoid wasting context window by scoping your searches to just the information needed to definitively answer the question. You can always search folders, file types, etc. iteratively or search again with a broader scope if needed. - - Use max_matches_per_file when searching broadly to limit the impact of each matching file. e.g.: "which files use NodeJS worker threads" only requires one match per file to answer. - - Use total_max_matches to limit the response size when you know that you only need a limited number. e.g.: "find me an example usage of path.resolve()" can use limit=5 to get 5 lines with locations to look instead of spending hundreds of tokens of context. + - Avoid wasting context window by scoping your ${GREP_TOOL_NAME} searches to just enough information to definitively answer the question. + - Extra tool calls can negate any benefits of limits, so balance frugality with the cost of having to iterate. + - Some examples: + - Use total_max_matches to limit the ${GREP_TOOL_NAME} response size when you know that you only need a limited number. e.g.: "find me an example usage of path.resolve()" can use limit=5 to get 5 lines with locations to look instead of spending hundreds of tokens of context. + - Use max_matches_per_file when searching broadly to limit the impact of each matching file. e.g.: "which files use NodeJS worker threads" only requires one match per file to answer. + - Use total_max_matches to limit the response size when you know that you only need a limited number. e.g.: "find me an example usage of path.resolve()" can use limit=5 to get 5 lines with locations to look instead of spending hundreds of tokens of context. - **Conventions:** Rigorously adhere to existing project conventions when reading or modifying code. Analyze surrounding code, tests, and configuration first. - **Libraries/Frameworks:** NEVER assume a library/framework is available or appropriate. Verify its established usage within the project (check imports, configuration files like 'package.json', 'Cargo.toml', 'requirements.txt', 'build.gradle', etc., or observe neighboring files) before employing it.