Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Python agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcpopenaiprompt-engineeringproxypythonragtoken-optimizationtokenstypescript
refactor(memory): deprecate the never-wired agent memory writers (#4101)
Tejas Chopra2e497cbec3c2
diff --git a/headroom/memory/writers/__init__.py b/headroom/memory/writers/__init__.pyindex a6f88e7df..ebf54415e 100644--- a/headroom/memory/writers/__init__.py+++ b/headroom/memory/writers/__init__.py@@ -14,14 +14,28 @@ Supported agents:- Aider: Convention files referenced in .aider.conf.yml- Gemini: GEMINI.md- Generic: Plain markdown (any agent)++.. deprecated::+ Nothing in Headroom uses these writers. ``headroom learn`` writes agent+ context files through ``headroom.learn.writer`` instead."""+import warnings+from headroom.memory.writers.base import AgentWriter, ExportResult, MemoryEntryfrom headroom.memory.writers.claude_writer import ClaudeCodeMemoryWriterfrom headroom.memory.writers.codex_writer import CodexMemoryWriterfrom headroom.memory.writers.cursor_writer import CursorMemoryWriterfrom headroom.memory.writers.generic_writer import GenericMemoryWriter+warnings.warn(+ "headroom.memory.writers is deprecated and will be removed in a future release; "+ "it has no replacement (headroom learn writes agent context files through "+ "headroom.learn.writer).",+ DeprecationWarning,+ stacklevel=2,+)+__all__ = ["AgentWriter","ClaudeCodeMemoryWriter",diff --git a/tests/test_memory/test_writers.py b/tests/test_memory/test_writers.pyindex fae5f856f..a864f3deb 100644--- a/tests/test_memory/test_writers.py+++ b/tests/test_memory/test_writers.py@@ -3,6 +3,8 @@from __future__ import annotationsimport asyncio+import importlib+import sysimport timefrom datetime import datetime, timezonefrom pathlib import Path@@ -22,6 +24,18 @@ from headroom.memory.writers.codex_writer import CodexMemoryWriterfrom headroom.memory.writers.cursor_writer import CursorMemoryWriterfrom headroom.memory.writers.generic_writer import GenericMemoryWriter++def test_importing_the_writers_package_warns_deprecated(monkeypatch: pytest.MonkeyPatch) -> None:+ # Restore both the sys.modules entry and the parent attribute afterwards, so+ # later tests see the original package object whatever the import form.+ import headroom.memory++ monkeypatch.delitem(sys.modules, "headroom.memory.writers", raising=False)+ monkeypatch.delattr(headroom.memory, "writers", raising=False)+ with pytest.warns(DeprecationWarning, match="headroom.memory.writers is deprecated"):+ importlib.import_module("headroom.memory.writers")++# =============================================================================# Test Data# =============================================================================