I have a tool wrapper that captures the output of anything and allows the LLM to query it later, to save on tokens. It “smartly” truncates the output (basically like Node’s util.inspect) and allows the LLM to expand truncated content.
It basically is called like “capture some-cli” and it… captures the CLI output, outputting a subset of it + a handle to continue querying.
This for me solves the danger of a tool returning tons of content.
I’ve been trying headroom-ai for this reason. That project also reduces tokens in other clever ways. Have you looked into it?
Don't most harnesses already do that for bash commands?
> captures the output of anything and allows the LLM to query it later
Otherwise known as a “file”. ;)