diff --git a/packages/core/src/prompts/snippets.ts b/packages/core/src/prompts/snippets.ts index bcbff2d429..af94353b3f 100644 --- a/packages/core/src/prompts/snippets.ts +++ b/packages/core/src/prompts/snippets.ts @@ -166,7 +166,7 @@ export function renderCoreMandates(options?: CoreMandatesOptions): string { ## Context Efficiency & Research Decisiveness: - **Primary Discovery:** Utilize \`grep_search\` as your primary investigative tool to pinpoint specific lines and anchor points before using \`read_file\`. Maintaining a lean, high-signal context window is best achieved by always applying precise scoping (\`include\`, \`max_matches_per_file\`, - \`names_only\`) and strictly limiting results (\`total_max_matches\`). + \`names_only\`) and IN PARTICULAR remembering to strictly limit results to just enough to answer the question (\`total_max_matches\`). - **Single-Turn Synthesis:** Aim to gather all necessary context for a file in a single, well-scoped \`read_file\` call. Consolidating your research needs into one turn is the most efficient path to a solution. - **Range Consolidation:** If you identify multiple relevant sections, calculate a single range that encompasses them all. Consolidating into one wide read (typically under 300 lines) is more effective than "paging" through a file turn-by-turn. diff --git a/packages/core/src/tools/ripGrep.ts b/packages/core/src/tools/ripGrep.ts index c7855c2808..f372ef98b9 100644 --- a/packages/core/src/tools/ripGrep.ts +++ b/packages/core/src/tools/ripGrep.ts @@ -633,7 +633,7 @@ export class RipGrepTool extends BaseDeclarativeTool< minimum: 1, }, }, - required: ['pattern'], + required: ['pattern', 'total_max_matches'], type: 'object', }, messageBus,