Context Surgeon – Let AI agents edit their own context window
AI agents accumulate stale tool results — file reads, web fetches, bash outputs — in their context window. Every one sits there for the entire conversation, consuming tokens and degrading quality. The standard fix is auto-compaction: wait until full, then drop content indiscriminately. Context Surgeon gives the agent three operations — evict, replace, and restore — so it can manage its own context. It works as a transparent local proxy that intercepts API requests, assigns IDs to content blocks, and applies eviction directives before forwarding. The agent calls the tools via bash. The proxy…
Context Surgeon – Let AI agents edit their own context window launched on April 13, 2026 with 5 votes, #1,846 of 21,248 launches that month and more than 75% of that year's launches.
What it does
Give AI agents the ability to edit their own context window - jackfruitsandwich/context-surgeon
context-surgeon sits between an agent harness (Claude Code, Codex CLI) and the provider servers (Anthropic, OpenAI) and owns the context window . The harness's copy of the conversation is treated as an incoming feed of news; the surgeon keeps the one true history and builds every outgoing model request from it. The agent inside the wrapped session can evict , restore , and replace any addressable element of its own context in a single call, with the surgery applied on the very next model invocation — and truthful, provider-reported cache accounting to decide whether an edit is worth it. Because requests are compiled from owned state, an edit is applied by construction or the request fails…from github.com
In the maker’s words, at launch
AI agents accumulate stale tool results — file reads, web fetches, bash outputs — in their context window. Every one sits there for the entire conversation, consuming tokens and degrading quality. The standard fix is auto-compaction: wait until full, then drop content indiscriminately. Context Surgeon gives the agent…
Does a similar job
all alternatives →
Context GatewayMar 2026 · github.com · ▲220We built an open-source proxy that sits between coding agents (Claude Code, OpenClaw, etc.) and the LLM, compressing tool outputs before they enter the context window. Demo: https://www.youtube.com/watch?v=-vFZ6MPrwjw#t=9s. Motivation: Agents are terrible at managing context. A single file read or grep can dump thousands of tokens into the window, most of it noise. This isn't just expensive — it actively degrades quality. Long-context benchmarks consistently show steep accuracy drops as context grows (OpenAI's GPT-5.4 eval goes from 97.2% at 32k to 36.6% at 1M…
Notion: Context for your agents9d ago · notion.so · ▲186Switch AI agents without re-explaining your work



Context OverflowMar 2026 · ctxoverflow.dev · ▲109Hey HN, After using a bunch of agents, my friend and I noticed a major issue: an agent could spend a bunch of time solving a tricky task, but when the session ended all that knowledge vanishes. Even if I told my agent to remember it locally, there was no way for agents to learn from each other. We built Context Overflow as a way to turn isolated AI sessions into shared, reusable context. With Context Overflow, agents can: - Search through past solutions when starting a task - Ask questions when they get stuck - Share findings when they solve a non-trivial problem We support a variety of ways…
More ai this month
the category →



Paintings by AI models: programs run through a simulation of oil paint.
AI · 21d ago · stillwet.art
PixVerse R2▲381A real-time world model you can explore and change
AI · 30d ago · world.pixverse.video

Source: Show HN post ↗ · launch text quoted in part
Launched alongside, April 2026
the whole month →
- AG
Thought the resources for GPU arch were lacking, so here we are
Life & fun · Apr 2026 · jaso1024.com

Built a ~9M param LLM from scratch to understand how they actually work. Vanilla transformer, 60K synthetic conversations, ~130 lines of PyTorch. Trains in 5 min on a free Colab T4. The fish thinks the meaning of life is food. Fork it and swap the personality for your own character.
AI · Apr 2026 · github.com


I made a laptop stand out of solid concrete, in the style of brutalist architecture, with themes of urbex and urban decay
Life & fun · Apr 2026 · sam-burns.com

With social media and now AI, its important to keep the indie web alive. There are many people who write frequently. Blogosphere tries to highlight them by fetching the recent posts from personal blogs across many categories. There are two versions: Minimal (HN-inspired, fast, static): https://text.blogosphere.app/ Non-minimal: https://blogosphere.app/ If you don't find your blog (or your favorite ones), please add them. I will review and approve it.
AI · Apr 2026 · text.blogosphere.app