frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Context Surgeon – Let AI agents edit their own context window

https://github.com/jackfruitsandwich/context-surgeon
3•jdjdjdi•1h ago
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

Comments

axeldunkel•1h ago
I like the approach to bring in the context surgeon as a wrapper that sees the conversation and can attach ids to the lines. You might even use the surgeon to replace parts with summaries?
jdjdjdi•1h ago
Yes! The replace command lets the agent write their own summary for any tool result or message or a single summary referring to several turns

Show HN: Access X, Reddit, Threads and all social media data from a single API

https://www.socialcrawl.dev/
1•magneticbrains•31s ago•0 comments

A picture is worth a thousand tokens

https://repaint.com/blog/picture-is-worth-a-thousand-tokens
1•benshumaker•33s ago•0 comments

Dual national Londoner stranded in Spain by new border rule

https://www.bbc.com/news/articles/c747vj1z0xwo
1•speckx•41s ago•0 comments

Problems Before the Real Problem: The First Lessons of Apollo 13

https://www.flyingbarron.com/2026/04/problems-before-real-problem-first.html
1•flyingbarron•2m ago•0 comments

Apple Reportedly Testing AI Glasses in Several Frame Styles

https://www.cnet.com/news/apple-reportedly-testing-ai-glasses-in-several-frame-styles/
1•CharlesW•3m ago•0 comments

How to Stop Cops from Using Wi-Fi to "See Through the Walls" of Your Home [video]

https://www.youtube.com/watch?v=LngDW3t36nc
1•dp-hackernews•4m ago•0 comments

Show HN: Curation: Share Podcast Recommendation

https://curation-509629088134.us-west1.run.app/
1•arbol•4m ago•0 comments

OpenAI's latest internal memo about beating the competition

https://www.theverge.com/ai-artificial-intelligence/911118/openai-memo-cro-ai-competition-anthropic
1•pretext•6m ago•0 comments

Mount GitHub repositories as a virtual read-only macOS filesystem

https://github.com/indragiek/GHFS
1•latchkey•7m ago•0 comments

I Rode in a Waymo with a Litigator: Here's What I Learned

https://www.law.com/2026/04/13/i-rode-in-a-waymo-with-a-litigator-heres-what-i-learned/
2•1vuio0pswjnm7•10m ago•0 comments

Show HN: Is Claude still thinking? How are you wasting life?

https://claudestillthinking.com
1•Exorust•10m ago•0 comments

Show HN: Hitoku Draft – context aware local macOS assistant

https://github.com/Saladino93/hitokudraft
1•lostathome•10m ago•0 comments

Running (and Coding with) Local AI on a Mac

https://github.com/dmitryryabkov/local-ai-mac
2•allessa•10m ago•0 comments

Linux 7.0 debuts as Linus Torvalds ponders AI's bug-finding powers

https://www.theregister.com/2026/04/13/linux_kernel_7_releaseed/
2•blackcoffeerain•10m ago•0 comments

New disclosures reveal how DOGE worked

https://www.washingtonpost.com/politics/2026/04/13/doge-musk-trump-deposition-videos-chatgpt/
1•_tk_•11m ago•0 comments

Want to understand the current state of AI? Check out these charts

https://www.technologyreview.com/2026/04/13/1135675/want-to-understand-the-current-state-of-ai-ch...
1•joozio•11m ago•0 comments

Why most AI projects feel useless

2•vaishcodescape•13m ago•1 comments

Lobsters Interview with Internet_Jannitor

https://alexalejandre.com/programming/interview-with-john-earnest/
1•PaulHoule•13m ago•0 comments

Show HN: Asthi – Damn good asset tracker

https://www.asthi.app/
1•suvamsh•15m ago•0 comments

Show HN: CRXcavator, but Better

https://amibeingpwned.com
1•acorn221•15m ago•0 comments

I vibe coded a feed reading web app. It was enlightening and uncomfortable

https://www.theregister.com/2026/04/12/vibe_coding_works/
3•geekinchief•16m ago•0 comments

Show HN: Built a personality that lives across CLI, browser, and web –> all solo

1•thomasgeelens•18m ago•0 comments

Show HN: Aurora – a browser engine experiment in Rust

1•JohannaAlmeida•19m ago•1 comments

What does it mean to measure durable change velocity in 2026?

https://www.gitclear.com/blog/measuring_durable_change_velocity_in_2026_prompt_to_production_era
1•wbharding•19m ago•0 comments

The AI build-out is powering global goods trade

https://www.ft.com/content/ad169119-4a62-437b-b6ec-70819b1e8b4f
1•alephnerd•20m ago•0 comments

Mist: Open-source Markdown editor with AI-native comments and suggested edits

https://interconnected.org/home/2026/04/10/open-mist
1•austinbirch•21m ago•0 comments

Cloudflare Turnstile Is Down

2•owenthejumper•21m ago•0 comments

Unpatched vuln in RAGFlow allows for post-auth RCE

https://zeropath.com/blog/ragflow-rce-unpatched-vulnerability
1•NonStopOyster•23m ago•0 comments

Does Trump think he's God?

https://www.taxresearch.org.uk/Blog/2026/04/13/does-trump-think-hes-god/
6•only_in_america•23m ago•2 comments

Tell HN: Claude-code prompt-cache fix

1•g4cg54g54•25m ago•1 comments