← Back to context

Comment by inetknght

6 days ago

> when you run a grep command in a large codebase and end up hitting way too many files, overloading context.

On the other hand, I despise that it automatically pipes things through output-limiting things like `grep` with a filter, `head`, `tail`, etc. I would much rather it try to read a full grep and then decide to filter-down from there if the output is too large -- that's exactly what I do when I do the same workflow I told it to do.

Why? Because piping through output liming things can hide the scope of the "problem" I'm looking at. I'd rather see the scope of that first so I can decide if I need to change from a tactical view/approach to a strategic view/approach. It would be handy if the agents could do the same thing -- and I suppose they could if I'm a little more explicit about it in my tool/prompt.

In my experience this is what Claude 4.5 (and 4.6) basically does, depending on why its grepping it in the first place. It'll sample the header, do a line count, etc. This is because the agent can't backtrack mid-'try to read full file'. If you put the 50,000 lines into the context, they are now in the context.

  • > If you put the 50,000 lines into the context, they are now in the context.

    And you can't revert back to a previous context, and then add in new context summarizing to something like "the file is too large" with how to filter "there are too many unrelated lines matching '...', so use grep"?

    Using output-limiting stuff first won't tell you if you've limited too much. You should search again after changing something; and if you do search again then you need to remember which page you're on and how many there are. That's a bit more complex in my opinion, and agents don't handle that kind of complexity very well afaik.

  • Why can't the LLM/agent edit the context and dump that file if it decides it was dumb to have the whole thing in the context?

    • Base model is content. If it reads to much it becomes the content.

      What you want is a harness that continually inserts file portions until a sufficiently bright light bulb goes off.

      When they say agentic AI, ITS BASICALLY:

      <command><content-chunk-1/></command>

      its the ugliest string mashing indeterministic garbage the bearded masters would face palm.