Cutting LLM token Usage by ~80% using REPL driven document analysis

28 points by Yogthos


vhodges

This does seem interesting and is not very different from what a person would do when exploring a code base (eg, grep, TAGS files, lsp, etc). Tools to search and narrow the focus and then load/read the specific files.

I wonder if someone has made an interface between lsps and mcp?

A quick Google and it looks like SourceGraph has done this for their product.

deevus

This looks very interesting and I’ll be trying it today.

thisalex

Is it language-agnostic or does it require customisation for different programming languages?

kingmob

Really interesting! I like the idea of an agent-focused language, especially the idea of caching/storing results, which should speed up tool use.

However, I have a couple questions:

  1. First what's the token overhead of the Matryoshka MCP itself? At least in Claude, MCPs consume a lot of tokens, which could wipe out all savings (and then some).

  2. More broadly, how does this compare to using subagents and ad hoc shell scripts? I frequently use subagents to distill answers and protect the parent's context by only bubbling up the final answer. Custom extractors are interesting, but agents can do similar things already with plain bash, iiuc.