codegraph_explore: a character or symbol-only budget beside maxFiles
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- tooling
Research direction
Start with src/mcp/tools.ts and the section-first documentation tier in #1699, which the issue says already spends a per-file cap in rank order. Compare the two proposed approaches—maxChars or symbols-only output—and confirm the maintainer's preference before choosing scope. Done means codegraph_explore can return a smaller answer in the agreed shape; the issue does not name a test, so locate the relevant tool tests before making changes.
Written by the indexing model from the issue text.
Description
Summary
maxFiles is the only size knob on codegraph_explore, and it counts files, not characters. Each file that makes the cut contributes whole symbol bodies plus its share of the blast-radius and relationships sections, so a small maxFiles does not give a small answer. Ask: a maxChars budget, or a mode that returns only the named symbols' source with caller names and no bodies for the neighbours.
Measured (1.6.0, Windows, ~500-file TypeScript/Vue repo)
One symbol query, the same every time, varying only maxFiles:
maxFiles |
answer size |
|---|---|
| 1 | 5.4k |
| 3 | 8.1k |
| 6 | 20.5k |
| 12 | 20.7k |
| unset | 7.7k |
Natural-language queries are worse: at maxFiles: 3 the answer was still 13–24k characters in 7 of 8 calls, because a file that matches on a prose term renders its matched sections whole.
Why it matters on the client side
Every later turn re-reads the whole context, so answer size is the cost that compounds. On a paired A/B (headless Claude Code, Opus, n = 12) the tool cut a discovery task from 5.67 to 3.33 calls and still raised cost per task by a median $0.13, and the ~21.7k-character mean answer is the reason (a bounded Read averages ~4.6k on the same repo). Telling the model about maxFiles in the repo rules did not help: a rule naming the cap changed calls +0.67 and cost −$0.14 per task, neither under p .3 at n = 9.
What did shrink answers was a shape change, not a count: the section-first doc tier in #1699 renders a markdown hit's top sections under a per-file source cap and drops the graph sections when no code file rendered, and the doc-question chain went from a median 4 calls to 1 with cost per cell $0.30 against $0.54. A code-side equivalent would be the ask here: a character budget the tool spends in rank order, or a symbols-only mode where neighbours appear as name (file:line) rather than as source.
Happy to send a PR for either if the maintainer has a preference; #1699's doc tier in src/mcp/tools.ts already spends a per-file cap in rank order, so maxChars is mostly plumbing a value from the input schema into the same place.
- Dominant language
- C
- Stars
- 73.2k
- Forks
- 4.7k
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 418
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from colbymchenry/codegraph
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
colbymchenry/codegraph#2634 ·
Maintainers usually reply within 1 day
-
Windows: bundled Node v24.16.0 can abort at exit (nodejs/node#56645); please bundle Node >= 24.20.0Possibly taken @Ancienttwo claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
colbymchenry/codegraph#2617 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Under an hour Newbie friendliness 72/100
colbymchenry/codegraph#2482 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
colbymchenry/codegraph#1900 · 2 comments · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
colbymchenry/codegraph#1700 ·
Maintainers usually reply within 1 day
All issues in colbymchenry/codegraph
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenPrinting/cups#1772 ·
Maintainers usually reply within 1 day
-
tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
antoxa2584x/nfsu2-sw#44 · 1 reaction ·
Maintainers usually reply within 1 day