Improving LLM token usage when debugging

2 byme 2 9/1/2025, 1:15:06 PM github.com ↗

Comments (2)

brudgers · 3h ago
byme · 2d ago
When debugging with an LLM, a failed build sends ~200 tokens of mostly useless output. The actual error? Maybe 60 tokens. Multiply that by 20-30 commands per debugging session, and you're burning through tokens like crazy.

So, I created a CLI tool that acts as a smart filter between your commands and the LLM. It knows what errors look like across different tech stacks and only shows what matters.

Before:

``` bash > npm run build:graphql && react-router typegen && tsc && react-router build

> build:graphql > graphql-codegen

Parse Configuration Generate outputs app/features/tasks/services/atoms.ts:55:60 - error TS2339: Property 'taskId' does not exist on type '{ request: UpdateTaskRequest; }'.

55 const response = await apiClient.updateTask(params.taskId, params.request); ~~~~~~

Found 1 error in app/features/tasks/services/atoms.ts:55 ```

After:

```bash $ aex frontend-build app/features/tasks/services/atoms.ts(55,60): error TS2339: Property 'taskId' does not exist Done ```

That's it. When the build succeeds? Just "Done" - literally 1 token instead of 200.

Have a look! The full article is here: https://github.com/byme8/apparatus.exec/discussions/1