Live data from Hacker News

Claude Sonnet 4 now supports 1M tokens of context

anthropic.com

351–360 of 706 posts

Re: Claude Sonnet 4 now supports 1M tokens of context

#351

I could be wrong, but I think this pricing is the first to admit that cost scales quadratically with number of tokens. It’s the first time I’ve seen nonlinear pricing from an LLM provider which implicitly mirrors the inference scaling laws I think we're all aware of.

Google[1] also has a "long context" pricing structure. OpenAI may be considering offering similar since they do not offer their priority processing SLAs[2] for context >128K.

[1] https://cloud.google.com/vertex-ai/generative-ai/pricing

[2] https://openai.com/api-priority-processing/

Re: Claude Sonnet 4 now supports 1M tokens of context

#352

Earlier quoted context omitted.

It does if you're working with bigger codebases. I've found copy/pasting my entire codebase + adding a works significantly better than cursor.

How does one even copy their entire codebase? Are you saying you attach all the files? Or you use some script to copy all the text to your clipboard? Or something else?

I created a script that outputs the entire codebase to a text file (also allows me to exclude files/folders/node_modules), separating and labeling each file in the program folder.

I then structure my prompts around like so:

``` ```

" "

" "

I've been using this with Google Ai studio and it's worked phenomenally. 1 million tokens is A LOT of code, so I'd imagine this would work for lots n lots of project type programs.

Re: Claude Sonnet 4 now supports 1M tokens of context

#353
post #252

Earlier quoted context omitted.

My experience has been entirely the opposite as an IC. If I spend the time to delve into the code base to the point that I understand how it works, AI just serves as a mild improvement in writing code as opposed to implementing it normally, saving me maybe 5 minutes on a 2 hour task. On the other hand, I’ve found success when I have no idea how to do something and tell the AI to do it. In that case, the AI usually do…

Both modes of operation are useful. If you know how to do something, then you can give Claude the broad strokes of how you want it done and -- if you give enough detail -- hopefully it will come back with work similar to what you would have written. In this case it's saving you on the order of minutes, but those minutes add up. There is a possibility for negative time saving if it returns garbage. If you don't know h…

Claude will point you in the right neighborhood but to the wrong house. So if you're completely ignorant that's cool. But recognize that its probably wrong and only a starting point.

Hell, I spent 3 hours "arguing" with Claude the other day in a new domain because my intuition told me something was true. I brought out all the technical reason why it was fine but Claude kept skirting around it saying the code change was wrong.

After spending extra time researching it I found out there was a technical term for it and when I brought that up Claude finally admitted defeat. It was being a persistent little fucker before then.

My current hobby is writing concurrent/parallel systems. Oh god AI agents are terrible. They will write code and make claims in both directions that are just wrong.

Re: Claude Sonnet 4 now supports 1M tokens of context

#354

Earlier quoted context omitted.

I think it's key to not give it contradictory instructions, which is an easy mistake to make if you forget where you started. As an example, I know of an instance where the LLM claimed it had tried a test on its laptop. This obviously isn't true so the user argued with it. But they'd originally told it that it was a Senior Software Engineer so playing that role, saying you tested locally is fine. As soon as you start…

The problem I often have is I may have instruction like- General instruction: - Do "ABC" If condition == whatever: - Do "XYZ" instead I have a hard time making the AI obey the instances I wish to override my own instruction and without having full control of the input context, I can't just modify my 'General Instruction' on a case by case basis to simply avoid having to contradict myself.

That's a difficult case where you might want to collect your good context and shift it to a different session.

It would be nice if the UI made that easy to do.

Re: Claude Sonnet 4 now supports 1M tokens of context

#355

Earlier quoted context omitted.

> I really desperately need LLMs to maintain extremely effective context The context is in the repo. An LLM will never have the context you need to solve all problems. Large enough repos don't fit on a single machine. There's a tradeoff just like in humans where getting a specific task done requires removing distractions. A context window that contains everything makes focus harder. For a long time context windows we…

> An LLM will never have the context you need to solve all problems. How often do you need more than 10 million tokens to answer your query?

I exhaust the 1 million context windows on multiple models multiple times per day.

I haven't used the Llama 4 10 million context window so I don't know how it performs in practice compared to the major non-open-source offerings that have smaller context windows.

But there is an induced demand effect where as the context window increases it opens up more possibilities, and those possibilities can get bottlenecked on requiring an even bigger context window size.

For example, consider the idea of storing all Hollywood films on your computer. In the 1980s this was impossible. If you store them in DVD or Bluray quality you could probably do it in a few terabytes. If you store them in full quality you may be talking about petabytes.

We recently struggled to get a full file into a context window. Now a lot of people feel a bit like "just take the whole repo, it's only a few MB".

Re: Claude Sonnet 4 now supports 1M tokens of context

#357

Earlier quoted context omitted.

For me it’s meant a huge increase in productivity, at least 3X. Since so many claim the opposite, I’m curious to what you do more specifically? I guess different roles/technologies benefit more from agents than others. I build full stack web applications in node/.net/react, more importantly (I think) is that I work on a small startup and manage 3 applications myself.

> Having spent a couple of weeks on Claude Code recently, I arrived to the conclusion that the net value for me from agentic AI is actually negative. > For me it’s meant a huge increase in productivity, at least 3X. How do we reconcile these two comments? I think that's a core question of the industry right now. My take, as a CTO, is this: we're giving people new tools, and very little training on the techniques that…

> How do we reconcile these two comments? I think that's a core question of the industry right now.

The question is, for those people who feel like things are going faster, what's the actual velocity?

A month ago I showed it a basic query of one resource I'd rewritten to use a "query builder" API. Then I showed it the "legacy" query of another resource, and asked it to do something similar. It managed to get very close on the first try, and with only a few more hours of tweaking and testing managed to get a reasonably thorough test suite to pass. I'm sure that took half the time it would have taken me to do it by hand.

Fast forward to this week, when I ran across some strange bugs, and had to spend a day or two digging into the code again, and do some major revision. Pretty sure those bugs wouldn't have happened if I'd written the code myself; but even though I reviewed the code, they went under the radar, because I hadn't really understood the code as well as I thought I had.

So was I faster overall? Or did I just offload some of the work to myself at an unpredictable point in the future? I don't "vibe code": I keep tight reign on the tool and review everything it's doing.

Re: Claude Sonnet 4 now supports 1M tokens of context

#358

My experience with the current tools so far: 1. It helps to get me going with new languages, frameworks, utilities or full green field stuff. After that I expend a lot of time parsing the code to understand what it wrote that I kind of "trust" it because it is too tedious but "it works". 2. When working with languages or frameworks that I know, I find it makes me unproductive, the amount of time I spend writing a goo…

> but for enterprise level code it is not there It is good for me in Go but I had to tell it what to write and how.

I've been able to create a very advanced search engine for my chat app that is more than enterprise ready. I've spent a decade thinking about search, but in a different language. Like you, I needed to explain what I knew about writing a search engine in Java for the LLM, to write it in JavaScript using libraries I did not know and it got me 95% of the way there.

It is also incredibly important to note that the 5% that I needed to figure out was the difference between throw away code and something useful. You absolutely need domain knowledge but LLMs are more than enterprise ready in my opinion.

Here is some documentation on how my search solution is used in my app to show that it is not a hobby feature.

https://github.com/gitsense/chat/blob/main/packages/chat/wid...

Re: Claude Sonnet 4 now supports 1M tokens of context

#359

My experience with the current tools so far: 1. It helps to get me going with new languages, frameworks, utilities or full green field stuff. After that I expend a lot of time parsing the code to understand what it wrote that I kind of "trust" it because it is too tedious but "it works". 2. When working with languages or frameworks that I know, I find it makes me unproductive, the amount of time I spend writing a goo…

I agree. For me it's a modern version of that good ol "rails new" scaffolding with Ruby on Rails that got you started with a project structure. It makes sense because LLMs are particularly good at tasks that require little more knowledge than just a near perfect knowledge of the documentation of the tooling involved, and creating a well organized scaffold for a greenfield project falls squarely in that area.

For legacy systems, especially ones in which a lot of the things they do are because of requirements from external services (whether that's tech debt or just normal growing complexity in a large connected system), it's less useful.

And for tooling that moves fast and breaks things (looking at you, Databricks), it's basically worthless. People have already brought attention to the fact that it will only be as current as its training data was, and so if a bunch of terminology, features, and syntax have changed since then (ahem, Databricks), you would have to do some kind of prompt engineering with up to date docs for it to have any hope of succeeding.

Re: Claude Sonnet 4 now supports 1M tokens of context

#360

My experience with the current tools so far: 1. It helps to get me going with new languages, frameworks, utilities or full green field stuff. After that I expend a lot of time parsing the code to understand what it wrote that I kind of "trust" it because it is too tedious but "it works". 2. When working with languages or frameworks that I know, I find it makes me unproductive, the amount of time I spend writing a goo…

My workflow is to use Claude desktop with the filesystem mcp server. I give claude the full path to a couple of relevant files related to the task at hand, ie where the new code should hook into or where the current problem is. Then I ask it to solve the task. Claude will read the files, determine what should be done and it will edit/add relevant files. There's typically a couple of build errors I will paste back in…

Any particular reason you prefer that over Claude code?
Post reply on HN