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
The default top_k=8 returns 8 full code chunks on every search_code call. For most queries, the answer is found in the top 2–3 results. The extra 5–6 results consume Claude tokens without contributing to the answer.
Users who need broader coverage can still pass top_k=8 or higher (up to 20) explicitly.
Alternatives Considered
Keeping top_k=8: current behaviour, higher token cost per search
Dynamic top_k based on score distribution: more complex, not worth the added complexity
Additional Context
Low quality risk: for simple queries (find a function, find a class) top 5 is always sufficient. For complex architectural queries the user can explicitly request more results.
Problem Statement
The default
top_k=8returns 8 full code chunks on everysearch_codecall. For most queries, the answer is found in the top 2–3 results. The extra 5–6 results consume Claude tokens without contributing to the answer.Proposed Solution
Lower the default from
top_k=8totop_k=5:Users who need broader coverage can still pass
top_k=8or higher (up to 20) explicitly.Alternatives Considered
top_k=8: current behaviour, higher token cost per searchAdditional Context
min_scorethreshold (issue [Feature]: Add minimum score threshold to filter low-relevance search results #35), the effective number of results returned will already be naturally lower without needing to reducetop_k.