Live data from Hacker News

Show HN: Badge that shows how well your codebase fits in an LLM's context window

github.com

31–40 of 47 posts

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#31
For at least some codebases, I'm not sure this is a useful metric. Because you don't usually put the whole codebase in your context at the same time.

For example in my current case, there are lots of files with CSS, SVG icons in separate files, old database migration scripts, etc. Those don't go in the LLM context 99% of the time.

Maybe a more useful metric would be "what percentage of files that have been edited in the last {n} days fit in the context"?

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#32
post #7

What’s the going rate for tokens in terms of dollars? How much are companies spending on “tokens”? Also kind of ironic that small codebases are now in vogue, just when google monolithic repos were so popular.

> What’s the going rate for tokens in terms of dollars? It depends on the provider/model, usually pricing is calculated as $/million tokens with input/output tokens having different per token pricing (output tends to be more expensive than input). Some models also charge more per token if the context size is above a threshold. Cached operations may also reduce the price per token. OpenRouter has a good overview over…

> Ime, most companies rather buy a subscription than give their developers API keys (as it makes spending predictable).

The downside with subscriptions is that your work with the LLM will grind to a halt for a number of hours if you hit the token limit. I was doing what I consider very trivial work adding Javadoc comments to a few dozen files using Claude Sonnet on the $20 plan and within 30 minutes had been told to sit out for a couple hours. The reason was that Claude was apparently repeatedly sending the files up and down to fill in the comments. In hindsight, sure, that's obvious, but you would think that Claude would be smart enough to do some sort of summarization to make things more efficient. Looking into it, it was on the order of several million tokens in a very short amount of time.

It really made me wonder how in the hell people are using Claude to do "real" work, but I've heard of people having multiple $200/month subscriptions, so I guess that could work. Definitely seems like a glimpse into the future of what these services will truly cost once people are hooked on them.

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#33
On a related note, this type of reasoning is what made me flip my opinion on microservices. I've generally been skeptical of a many-microservice architecture for the last decade but LLMs change that - a small microservice is more likely to fit in a context window.

I think this gestures at a more general point - we're still focusing on how to integrate LLMs into existing dev tooling paradigms. We squeeze LLMs into IDEs for human dev ergonomics but we should start thinking about LLM dev ergonomics - what idioms and design patterns make software development easiest for AIs?

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#34

On a related note, this type of reasoning is what made me flip my opinion on microservices. I've generally been skeptical of a many-microservice architecture for the last decade but LLMs change that - a small microservice is more likely to fit in a context window. I think this gestures at a more general point - we're still focusing on how to integrate LLMs into existing dev tooling paradigms. We squeeze LLMs into IDE…

Microservices are about deployment, less about code structure. You can have the same code modularization like microservices provide within a monolith instead, for example in the form of libraries. Conversely, you can in principle build several distinct microservices out of the same shared codebase.

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#35

On a related note, this type of reasoning is what made me flip my opinion on microservices. I've generally been skeptical of a many-microservice architecture for the last decade but LLMs change that - a small microservice is more likely to fit in a context window. I think this gestures at a more general point - we're still focusing on how to integrate LLMs into existing dev tooling paradigms. We squeeze LLMs into IDE…

[dead]

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#36
post #32
post #7

Earlier quoted context omitted.

> What’s the going rate for tokens in terms of dollars? It depends on the provider/model, usually pricing is calculated as $/million tokens with input/output tokens having different per token pricing (output tends to be more expensive than input). Some models also charge more per token if the context size is above a threshold. Cached operations may also reduce the price per token. OpenRouter has a good overview over…

> Ime, most companies rather buy a subscription than give their developers API keys (as it makes spending predictable). The downside with subscriptions is that your work with the LLM will grind to a halt for a number of hours if you hit the token limit. I was doing what I consider very trivial work adding Javadoc comments to a few dozen files using Claude Sonnet on the $20 plan and within 30 minutes had been told to…

I know of a corporate who has embraced Claude for doing documentation of their codebase to better use Claude to do coding on the codebase.

So Claude can understand the codebase, it needs to document it. Makes sense and is also great for humans because now there is uptodate docu on the codebase.

I don’t know how much it cost but the codebase, I’m told, is around 2 to 3 million lines of code.

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#37
Interesting idea, but I think it might have made more sense to use something like repomix to generate the source bundle and tiktoken’d that. Practically speaking you don’t send many source files in raw text form, either they have some sort of file wrapper with metadata or are pulled in from a tool call where the tool call arguments act as the metadata.

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#38
post #26

Maybe it’s useful to dig out the concept of modularization with a distinction between interface and implementation again, and construct agents that are able to make effective use of it. In the case that interfaces remain unchanged, agents only need to look at the implementation of a single module at a time plus the interfaces it consumes and implements. And when changing interfaces, agents only need to look at the in…

functional programming get recked, OOP is back, baby!

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#39
> Small codebases were always a good thing. With coding agents, there's now a huge advantage to having a codebase small enough that an agent can hold the full thing in context.

It is somewhat ironic that coding agents are notorious for generating much more code than necesary!

Re: Show HN: Badge that shows how well your codebase fits in an LLM's context window

#40
post #26

Maybe it’s useful to dig out the concept of modularization with a distinction between interface and implementation again, and construct agents that are able to make effective use of it. In the case that interfaces remain unchanged, agents only need to look at the implementation of a single module at a time plus the interfaces it consumes and implements. And when changing interfaces, agents only need to look at the in…

functional programming get recked, OOP is back, baby!

Funny but an aim of FP is composable flow as well?

With even more suitable for LLM types and "contracts at the edges".

Post reply on HN