Nicheloom

Market intelligence for builders — see what's gaining traction before it's crowded.

Context Surgeon

Let AI agents edit their own context window

Details

External ID
47753430
Source
HN
Company
—
Product
Context Surgeon
Website domain
github.com
Launched
April 13, 2026
Cohort
—
Upvotes
5
Upvotes percentile
0.11182519280205655
Tags
—
Fetched at
Sept. 7, 2026, 9:26 p.m.
Updated at
Sept. 7, 2026, 9:26 p.m.

Description

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 is ephemeral: starts with your CLI session, dies when it ends.The interesting part is that agents naturally start managing their own context without much prompting. In testing, the agent decided on its own to evict old research results before starting an implementation phase.Works with Codex CLI and Claude Code.Install: npm install -g context-surgeon Usage: context-surgeon codex

Enrichment

Theme
browser automation and scraping for AI
Vertical
Horizontal
Function
Agent / copilot
Audience
Developer
AI stance
AI-native
Project type
Commercial product
Normalized one-liner
let ai agents manage their own context
Manually corrected
False

Could you build this?

Yes Context Surgeon is an MCP server or middleware helper providing tools for agents to edit or prune previous tool call messages in their conversation history, which is straightforward prompt/message-array manipulation.

Discussion

5 comments analyzed.

Feature requests: Automatic state persistence to file between sessions, Project-level configuration folder (like .git) for storing state, Multi-session work support

Competitors

Other products that read as similar to this one — 279 launches clear the similarity bar, closest 8 shown.

Attention rank: #255 of 280 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).

Launched 158 days after the earliest competitor.

Other launches for this product

Same idea, different domain

Nobody's really built a agent / copilot tool for Agriculture yet.