Context Engineering and Agent Memory Practices

Anthropic engineering guidance reframes context engineering as dynamic, modular, and memory‑backed workspace.
Key insights
Context engineering defined as a dynamic workspace design
Anthropic's engineering blog reframes context engineering beyond prompt craft: it is the design of a self‑cleaning, dynamically loaded, and fault‑tolerant interaction workspace where data is fetched on demand, tools are searched and loaded, and long tasks remain manageable. The blog emphasizes environment design over static system prompts.
Tool retrieval and programmatic tool calling reduce context pollution
Key tactics include Tool Search—keeping a tool library and loading specific tool definitions only when needed—and Programmatic Tool Calling—having agents run code (e.g., Python) to process large inputs so only summarized results enter the model context. These methods preserve token budget and reduce noise in long tasks.
Long‑running tasks use anchor files and dual‑agent harness
Anthropic suggests a dual Agent architecture: an Initializer Agent creates global planning artifacts (feature lists, progress logs) and coding agents consume these anchors rather than full transcripts. External storage (e.g., Git commits) is the recommended memory for recoverable progress across sessions.
Open tooling projects add persistent memory for Claude Code
The claude‑mem GitHub project provides persistent memory for Claude Code: it captures operations, tool calls, generates semantic summaries, persists them, and supports natural‑language queries across project history with progressive disclosure and privacy filters. The project integrates via Claude Code plugin commands and a local web UI.
Practical examples show agents summarizing help responses and handling bad cases
Users describe using chat agents to consolidate hundreds of replies (e.g., airport help) into markdown summaries and propose agents detecting 'bad cases' by identifying abusive language to extract problematic session segments for analysis and dataset building.