You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: reduce token consumption in search tool outputs
- Add truncateContent helper to cap code blocks at 30 lines
- Apply truncation to codebase_search and find_similar outputs
- Reduce default limit for codebase_search from 10 to 5 results
- Estimated 80% token reduction for queries hitting large functions
"Search codebase by MEANING, not keywords. Returns full code content. Use when you need to see actual implementation. For just finding WHERE code is (saves ~90% tokens), use codebase_peek instead. For known identifiers like 'validateToken', use grep - it's faster.",
26
37
args: {
27
38
query: z.string().describe("Natural language description of what code you're looking for. Describe behavior, not syntax."),
28
-
limit: z.number().optional().default(10).describe("Maximum number of results to return"),
39
+
limit: z.number().optional().default(5).describe("Maximum number of results to return"),
29
40
fileType: z.string().optional().describe("Filter by file extension (e.g., 'ts', 'py', 'rs')"),
30
41
directory: z.string().optional().describe("Filter by directory path (e.g., 'src/utils', 'lib')"),
31
42
chunkType: z.enum(["function","class","method","interface","type","enum","struct","impl","trait","module","other"]).optional().describe("Filter by code chunk type"),
32
43
contextLines: z.number().optional().describe("Number of extra lines to include before/after each match (default: 0)"),
0 commit comments