Context Gateway: An Open-Source Proxy for Compressing AI Agent Context

What Context Gateway Does
Context Gateway is an agentic proxy that sits between AI coding agents (like Claude Code, OpenClaw, or Cursor) and the LLM API. When tool outputs like file reads or grep results dump thousands of tokens into the context window, the proxy compresses this content before it reaches the LLM. The motivation comes from research showing that long-context benchmarks experience steep accuracy drops as context grows—OpenAI's GPT-5.4 evaluation reportedly drops from 97.2% at 32k tokens to 36.6% at 1M tokens.
How the Compression Works
The system uses small language models (SLMs) that examine model internals and train classifiers to detect which parts of the context carry the most signal. When a tool returns output, compression happens conditioned on the intent of the tool call. For example, if an agent called grep looking for error handling patterns, the SLM keeps relevant matches and strips the rest. If the model later needs something that was removed, it can call expand() to fetch the original output.
Key Features and Setup
- Background compaction: Triggered at 85% window capacity, with summaries pre-computed so you don't wait for compaction
- Lazy-load tool descriptions: The model only sees tools relevant to the current step
- Spending caps: Control costs with budget limits
- Dashboard: Track running and past sessions
- Slack notifications: Get pinged when an agent is waiting on you
- Supported agents: Claude Code, Cursor, OpenClaw, or custom configurations
Getting Started
Install with:
curl -fsSL https://compresr.ai/api/install | sh
Then run context-gateway to launch an interactive TUI wizard that helps you:
- Choose an agent (claude_code, cursor, openclaw, or custom)
- Create/edit configuration including summarizer model and API key
- Enable Slack notifications if needed
- Set trigger threshold for compression (default: 75%)
The tool is open-source, built primarily in Go (90.9%), and maintained by Compresr, a YC-backed company. You can check compaction logs at logs/history_compaction.jsonl to see what's happening under the hood.
📖 Read the full source: HN LLM Tools
👀 See Also

Exploring Mistral Voxtral Realtime 4B in Pure C for Speech-to-Text
Voxtral.c offers a pure C implementation for Mistral AI's Voxtral Realtime 4B speech-to-text model, eliminating dependencies beyond the C standard library.

Slides-grab: Visual Editor for Fixing HTML Slides Generated by Claude Code
Slides-grab is a tool that lets you drag elements on HTML/CSS slides generated by Claude Code, then sends XPath and a highlighted screenshot to the AI agent for precise editing. It addresses the pain point of fixing small layout issues through text prompts alone.

ClawTalk iOS App Enables Voice Chat with Self-Hosted OpenClaw AI Agents
ClawTalk is a native iOS app that provides push-to-talk voice chat for OpenClaw self-hosted LLM setups. It features on-device speech-to-text using WhisperKit, real-time streaming responses with markdown rendering, and supports multiple TTS options including ElevenLabs, OpenAI, and Apple's built-in voices.

Open-source 31-agent product development system for Claude with 12,000+ lines of content
An open-source Claude Skill provides 31 specialized AI agents and 20 strategic frameworks covering all company departments from product to compliance. The MIT-licensed system includes 62 files with 12,000+ lines of actionable content, country-specific compliance for multiple regions, and a smart-loading system that routes requests efficiently.