---
title: "A round of context cleanup"
date: "2026-10"
category: "AI Engineering"
tags: ["AI Engineering"]
description: "Cleaning out your context regularly matters a lot, especially as models get stronger and old context turns more and more into a constraint..."
source: "https://enriquemark.com/en/posts/a-round-of-context-cleanup/"
---

Cleaning out your context regularly matters a lot, especially as models get stronger, because old context turns more and more into a constraint. It feels a bit like a talented person who can't use their strengths inside a rigid organization. Treat a better model the way you'd treat talent, and what we need to do is obviously trim.

The things to trim are mainly these:
- **Outdated guidance.** Things like fine-grained, step-by-step instructions written for older models. A new model handles this stuff with ease, and forcing it to follow the old rules only holds it back.
- **Unnecessary restrictions.** This is close to the last one. When models weren't very capable they'd do all sorts of random things, so we used to write piles of restrictions telling them not to do this or that, or overuse emphasis words to make them never do something under any circumstances. For today's models this becomes unnecessary too. You still keep restrictions, but plain wording and a normal reminder are enough. Emphasis words can cause over-inference and lead the model to overdo it.
- **Process records.** Old context and skills (especially if you iterate on them as often as I do) may contain needless timestamps, records of reversed decisions, and project-specific reasons. For a new model these can be pure pollution. The right move here is layering: there should be a dedicated decision and history document that collects these valuable change records, instead of letting them into the skill, which is the manual. Just put yourself in a human's place. If your manual were full of "it used to be like this, and this detail is why this part changed", you'd find it exhausting to read, and so does the model. The manual only needs the results. If you want the revision history, check the dedicated record.
- **Rules that conflict with each other over time.** This is also a legacy problem that grows with time. It doesn't only show up in context management. We see it all the time in legal systems and organizational rules too: a constraint born in a particular period becomes unnecessary as time goes on, or even contradicts newer rules. In the real world we have dedicated legislative and regulatory reviews to clear out old rules, and context management needs regular review and cleanup too.
- **Duplicated content.** This is a problem area too. The typical case is a reminder written in place A, then repeated in place B. The right fix is subtraction: replace the repeated reminder with a reference. That saves context, and it also keeps the model from treating something as a constraint to over-obey just because it keeps seeing it.

Beyond the trimming above, I want to call out skill descriptions specifically, because a lot of people overlook them. The description matters a lot. For the LLM, each time a new conversation loads, the only thing it can see of a skill is this description, which acts as the index. So whether your skill gets triggered, and how good its recall is, depends almost entirely on it. In the past, because models were weaker, descriptions were often written very detailed and wordy, to raise the hit rate of course. But for today's models that kind of over-optimization becomes unnecessary. Every load pulls that wordy text into context again. If you rarely use it, fine, but add up all the times you do and the token cost is no small number anymore. Naturally it should be cut.

With the goals covered, let's talk about the process. It's simple. This "regular cleanup" can itself be handed to the newest model, like a legislative review: triggered on a schedule, reviewing automatically, pruning automatically. On the other hand, to guard against the agent's old problem of making arbitrary changes, we also need clear rules to constrain this automated pruning. When no one is watching, the best constraint is clear, hard tests. And the best choice here is an "ablation experiment": remove one part at a time, create a minimal task, and compare whether behavior got better or worse after the cut. This is also what Anthropic does internally.

---

**Translation note.** I wrote this in Chinese. This English version is an LLM translation, so the wording is not mine even though the thinking is. Original: [记一次上下文环境优化](</zh-hant/posts/a-round-of-context-cleanup/>).
