diff --git a/packages/core/src/tools/grep.ts b/packages/core/src/tools/grep.ts index e802b0279d..6099b3c23c 100644 --- a/packages/core/src/tools/grep.ts +++ b/packages/core/src/tools/grep.ts @@ -332,10 +332,10 @@ class GrepToolInvocation extends BaseToolInvocation< for (const match of fileMatches) { if (fileLines) { - const startLine = Math.max(0, match.lineNumber - 1 - 50); + const startLine = Math.max(0, match.lineNumber - 1 - 15); const endLine = Math.min( fileLines.length, - match.lineNumber - 1 + 50 + 1, + match.lineNumber - 1 + 15 + 1, ); const contextLines = fileLines.slice(startLine, endLine); diff --git a/packages/core/src/tools/ripGrep.ts b/packages/core/src/tools/ripGrep.ts index 2b9c3b9f0b..b991467ae0 100644 --- a/packages/core/src/tools/ripGrep.ts +++ b/packages/core/src/tools/ripGrep.ts @@ -340,10 +340,10 @@ class GrepToolInvocation extends BaseToolInvocation< const newFileMatches: GrepMatch[] = []; const seenLines = new Set(); for (const match of fileMatches) { - const startLine = Math.max(0, match.lineNumber - 1 - 50); + const startLine = Math.max(0, match.lineNumber - 1 - 15); const endLine = Math.min( fileLines.length, - match.lineNumber - 1 + 50 + 1, + match.lineNumber - 1 + 15 + 1, ); for (let i = startLine; i < endLine; i++) { if (!seenLines.has(i + 1)) {