Back to News
Advertisement

Ask HN: What happens when we do compress the context in Claude Code?

ttbharath about 6 hours ago 4 comments

RU version is available. Content is displayed in original English for accuracy.

What happens when we do compress the context in claude code? How does the reduce the context with out loosing the details?
Advertisement

⚡ Community Insights

Discussion Sentiment

50% Positive

Analyzed from 160 words in the discussion.

Trending Topics

#query#agent#conversation#thread#entire#api#compression#might#summary#details

Discussion (4 Comments)Read Original on HackerNews

bubblebeardabout 6 hours ago
Not an expert, but, when you give Claude, or any AI agent a query it will usually need to do research, use various tools, execute commands etc. and all of this accumelates text in the conversation thread. Each subsequent query in a thread submits the entire conversation to the API, potentially consuming an unnecessary amount of tokens. Compression attempts to solve this by removing irrelevant information. For example, the entire output from a CURL query and how the AI thought about it might not be needed, having the resulting outcome might be enough. Since compression is also performed by the API though it may be worth it, or not, it always depends on the situation at hand. This is my understanding of it anyways.
verdvermabout 6 hours ago
The idea is that you create a summary with sufficient details, or you trim things away, depending on the method, but you do in fact lose exact details.

The impacts of this are not well known and likely depend on model, harness, and session. (hunch)

tbharathabout 5 hours ago
So it does forward pass once again to get the summary from the whole session as input?
verdvermabout 5 hours ago
There are a lot of things people do, but I don't think a forward pass is the right way to think about it, think more agent than llm