Problem
Current --json output includes full match breakdowns per result:
[
{
"path": "src/auth.go",
"type": "file",
"score": 85,
"matches": ["basename:auth", "path:auth", "syn:authentication", "sym:AuthMiddleware"],
"breakdown": ["basename contains +7", "path contains +4", "..."]
}
]
For LLM agent consumption, this is hundreds of tokens per query when just paths and scores would suffice for most use cases. --dir-summary already exists for directory-level summaries but nothing for file-level.
Proposed Solution
Add --summary flag that outputs minimal JSON:
[
{"path": "src/auth.go", "type": "file", "score": 85},
{"path": "src/login.go", "type": "file", "score": 62}
]
No matches, no breakdown. Just path, type, score.
Implementation Notes
- New
--summary flag in command_search.go
- When
--summary && --json, strip matches and breakdown from output
- Could also work with non-JSON output: just paths and scores, one per line
--summary and --dir-summary are orthogonal (both could be true)
--summary and --explain conflict — error or --explain wins
Acceptance Criteria
Problem
Current
--jsonoutput includes full match breakdowns per result:[ { "path": "src/auth.go", "type": "file", "score": 85, "matches": ["basename:auth", "path:auth", "syn:authentication", "sym:AuthMiddleware"], "breakdown": ["basename contains +7", "path contains +4", "..."] } ]For LLM agent consumption, this is hundreds of tokens per query when just paths and scores would suffice for most use cases.
--dir-summaryalready exists for directory-level summaries but nothing for file-level.Proposed Solution
Add
--summaryflag that outputs minimal JSON:[ {"path": "src/auth.go", "type": "file", "score": 85}, {"path": "src/login.go", "type": "file", "score": 62} ]No
matches, nobreakdown. Just path, type, score.Implementation Notes
--summaryflag incommand_search.go--summary && --json, stripmatchesandbreakdownfrom output--summaryand--dir-summaryare orthogonal (both could be true)--summaryand--explainconflict — error or--explainwinsAcceptance Criteria
--summary --jsonoutputs[{path, type, score}]only--summarywithout--jsonoutputs compact text format--summaryand--explaintogether produce an error or--explainwins