Dual-model architecture reduces token consumption by half for long conversations

Context compression system for AI agents
A developer on r/ClaudeAI shared a solution to the problem of AI agents losing context after conversation compaction. The system uses a dual-model architecture where a cheap small model (called the "subconscious") continuously compresses conversation history in the background.
Architecture details
The system has four layers:
- Narrative summary (~1K tokens)
- Compressed factoids
- Semantically retrieved verbatim quotes
- Raw recent turns
The main model ("conscious") receives a curated ~35K token context with the same information density that would normally require 120K tokens of raw history. The main model reads one coherent timeline and doesn't know the memory system exists.
Performance results
The developer simulated 260 turns across different conversation types. For sustained project work (starting with heavy research and gradually shifting to quick exchanges as the model learns the domain), the system cuts token consumption roughly in half.
Development tools
The system was built with Claude Code for the simulation and Claude.ai in the consulting and research stage. The developer is looking for others who have tried routing a smaller model to manage context for a larger one or found other workarounds for the compaction problem.
📖 Read the full source: r/ClaudeAI
👀 See Also

Libretto: Deterministic Browser Automation Generation for AI Coding Agents
Libretto is a Skill+CLI toolkit that enables AI coding agents to generate deterministic browser automation scripts as actual code, moving away from runtime AI agents. It combines Playwright UI automation with direct network/API requests for reliability and includes step-through debugging and read-only modes.

Kios: An iOS Reader for Self-Hosted Kobo/Calibre Libraries with Progress Sync
Kios is an iOS app that reads books from self-hosted Kobo/Calibre servers and syncs reading progress via the Kobo protocol, OPDS 1.2/2.0, and kosync. Built with Claude Code.

Scrapling integrated as OpenClaw's scraping backbone
Scrapling, an open-source library that learns page structure and adapts to changes, has been integrated into OpenClaw as its core scraping engine. It's 774x faster than BeautifulSoup with Lxml and supports multiple selector types with async sessions.

OpenGalatea MCP Server Connects Claude to Prusa 3D Printers
OpenGalatea is an open-source MCP server that enables Claude to control Prusa 3D printers via PrusaLink, allowing natural language commands to search Printables.com, slice models, and manage prints.