Context Language Models: Giving the Model Write Access to Its Own Context
An examination of Context Language Models, a University of Washington and Meta proposal that exposes an agent's live context as an editable file, and what it changes about compaction, caching, and training.
Based on research by Rulin Shao, Shannon Zejiang Shen, Junjie Oscar Yin, Yuetai Li, Minheng Wang, Hamish Ivison, Radha Poovendran, Nathan Lambert, Teng Xiao, Mike Lewis, Wen-tau Yih, Luke Zettlemoyer, Pang Wei Koh · 8 min read
```
turn t: live context ──mirrored──▶ /workspace/ctx_0.txt
│
model writes Bash / Python ──────┤ (regex replace, truncate,
│ rewrite a span, add a role)
▼
turn t+1: edited file ──synchronised──▶ live context sent to server
no edit this turn ⇒ generated tokens are appended (default)
multi-agent ⇒ one file per agent; spawning a subagent = creating a file
``` Almost every production agent harness treats the context window as an append-only log. The model emits tokens, tool results get appended, and when the log approaches a length threshold the harness steps in with a fixed policy, most often a summarisation pass of the kind Codex and Cursor run. Even the more adaptive approaches published this year, such as Self-Compact, AutoCompact, and ACM, give the model a small menu of predefined actions (compact now, offload this, retrieve that) rather than control over the context itself.
Context Language Models (CLMs), from the University of Washington and Meta Superintelligence Labs, remove the menu. The model's live context is mirrored to a file, the path is put in the system prompt, and the model can edit that file with ordinary Bash and Python. Whatever the file contains becomes the next turn's context. The code is released at facebookresearch/context-language-models.