Show HN: Context Gateway – Compress agent context before it hits the LLM
TL;DR Highlight
A proxy pre-computes history summaries so agents skip compaction waits
Who Should Read
A developer running long Claude Code or Cursor sessions who is tired of waiting for context compaction.
Core Mechanics
- A proxy between agent and LLM
- Context Gateway sits between agents like Claude Code or Cursor and the LLM API.
- It compresses history in the background as the conversation grows.
- Summaries are precomputed
- The summary is ready when the context limit hits, so compaction is instant.
- The core claim is that users never wait for compaction.
- Trigger defaults to 75%
- The compression threshold is configurable in the setup wizard and defaults to 75%.
- The summarizer model and API key are set there too.
- Four agent options
- You can pick claude_code, cursor, openclaw, or custom.
- Running context-gateway after install opens a TUI wizard.
- Behavior is visible in logs
- Check logs/history_compaction.jsonl for compaction records.
- It is Apache-2.0 licensed and built by Compresr, a YC-backed company.
Community Reactions
- Concern: trust boundary collapses
- One commenter said compressing untrusted external content next to trusted instructions mixes injections into the system context.
- They suggested scanning before compressing or compressing trusted and untrusted content in separate passes.
- They reported testing six DOM extraction APIs: textContent and innerHTML expose hidden injections, while innerText and the accessibility tree filter them.
- Cache invalidation cost raised
- A commenter noted periodic history compression means paying uncached for all tokens after the change.
- Another asked how this beats subagents, which already prevent context pollution.
- Worry about lost context
- Some doubted it helps, fearing the middle layer strips tool output the agent needs for diagnosis.
- One asked for speed numbers versus Claude's and Codex's built-in compaction.
- Framework-level feature, some argued
- One commenter said ADK already handles this with a per-tool or per-subagent boolean.
- Others mentioned Anthropic's GA 1M context and doubted the business model.
How to Apply
- Baseline your compaction wait first
- Time how long compaction takes in a Claude Code session today.
- Install the gateway, rerun the same task, and compare with logs/history_compaction.jsonl.
- Try the proxy on a throwaway repo
- Run context-gateway and pick your agent and summarizer model.
- Keep the 75% trigger and use a non-critical repo first.
- Separate untrusted content before compression
- Process web pages and MCP results in a different pass from system instructions.
- Add an injection scan step before compression in your pipeline.
- Compare results with and without compression
- Run the same task with compaction on and off and check for lost information.
- Record cache hit rate and token cost changes too.
Try It
# Paste into your shell (install Context Gateway, then choose an agent)
curl -fsSL https://compresr.ai/api/install | sh
context-gateway
# In the wizard: pick claude_code, enter summarizer model/API key, keep the 75% trigger
# After working, check compaction records
tail -n 5 logs/history_compaction.jsonlTerminology
Related Papers
A Beginner's Guide to Local AI with Inkling, Qwen, and Unsloth
Install Unsloth Desktop, load a quantized Qwen model, and share a private ChatGPT-like AI on your home LAN.
Muru – AI-assisted Rust server for Python apps by mod_WSGI's creator
mod_wsgi's creator is building Muru, an AI-assisted Rust ASGI/WSGI server, documenting it in public
87% of the Anthropic power will come from gas and 11% from coal in 2028
Analysis of Anthropic's contracted data centers: 87% gas, 11% coal power in 2028
Anthropic’s Nasdaq debut
Anthropic listed on Nasdaq and closed its first day below its opening price.
OpenAI still has a WebRTC Problem
WebRTC drops late audio, hurting voice AI; MoQ retransmits and buffers instead
Gemini 4 Neon
Gemini 4 Neon cuts cost per task 32% versus Carbon, at $3 input and $15 output per million tokens
AI is killing All About Berlin
After Google AI Overviews, a Berlin guide site lost 70-75% of its traffic.
Not Everything Needs an LLM
PostHog used small decision models to skip 98.7% of expensive LLM calls