The pages on Claude Code, Codex and pi mostly describe what the model gets at the start of a session. But a session changes as it runs: files are edited, modes switch, hooks fire, background jobs finish, the user goes quiet. The harness has to tell the model about each change, and all three do it by adding a message, not by rewriting what came before.
Why not just edit the prompt?
Because of the cache. A model provider caches the start of a request,
so each turn pays full price only for what's new. Changing anything
early in the conversation, including the system prompt, throws away
the cache from that point on. Claude Code's
prompt caching
page spells out the consequences. When a file Claude already read is
edited, "Claude Code appends a <system-reminder>
noting the file changed" instead of updating the earlier read. A
CLAUDE.md edited mid-session doesn't apply at all until
/clear, /compact or a restart. Output styles
and skills arrive as messages at the point they're used.
So the system prompt is closer to a snapshot of the session's start than a description of its current state. What's true now is spread through the conversation, and the model has to put it together.
Claude Code: over a hundred kinds of reminder
Claude Code wraps these messages in <system-reminder>
tags. Its docs mention them only in passing. Hook output sent as
additionalContext "is injected as a system reminder"
(hooks guide),
and a subagent gets a reminder listing the other agents it can message
(subagents).
The full set is visible only in the strings pulled from the program by
Piebald-AI/claude-code-system-prompts.
At v2.1.280 it lists 113 reminder types with about 32,000 tokens of text
between them. Any one session sees only the few that apply to it.
Grouped roughly by what they're about:
| Group | Types | Tokens |
|---|---|---|
| Plan mode and other modes | 19 | 5,572 |
| Files and the IDE | 17 | 1,966 |
| Remote machines and directory sync | 13 | 5,263 |
| Artifacts, slides and designs | 12 | 11,126 |
| Warnings that text isn't from the user | 11 | 2,248 |
| Agents, teams and background tasks | 10 | 1,944 |
| Memory | 9 | 1,853 |
| Tools and MCP | 8 | 1,092 |
| Hooks | 7 | 289 |
| Budget and usage | 2 | 81 |
| Other | 5 | 788 |
Grouped by keywords in each reminder's name, so the boundaries are approximate. Token counts are Piebald's.
Two patterns stand out. Newer features carry the longest reminders. The artifact and design reminders are about a third of the text, and a few run past 1,500 tokens each, because the model learns how to use the feature when it's switched on rather than from the system prompt. And about one type in ten exists to tell the model that some text is not from the user: a message relayed from another session, a channel message, a scheduled task firing with "no live user approval", a comment on a published page. The harness has to keep marking where authority comes from, because everything reaches the model as text.
In one session
This is what arrived in the Claude Code session that wrote this page, as the model saw it (observed, 2026-09-24):
- At the start, attached to the first message: the global CLAUDE.md and the project's AGENTS.md, the git status, and the attribution lines to use in pull requests.
- After a connector loaded: a list of tools that had "just become available", some usable at once and some only by name until fetched.
- After each edit made through a shell script: a note that the file "changed on disk since you last read it". The harness can't tell who made the change, so it says such changes are "usually deliberate" and asks the model not to revert them. Here the model had made every one of them itself.
- Every few minutes of silent work: "The user hasn't heard from you in a while — say in a few words what you're doing, then continue." This one isn't in Piebald's v2.1.280 list, so it may be newer or put together elsewhere.
One thing that looks similar isn't a reminder. When auto mode's classifier blocked an edit to the settings file, the explanation came back as the tool call's result, with detailed instructions against getting the same result by another route.
A trusted channel can be imitated
Because the model gives reminders the weight of the harness, text that
looks like one is a way to inject instructions. Claude Code checks
each subagent's final report for this. If the report imitates a
<system-reminder> tag, it inserts a backslash so
the imitation "reads as ordinary text" and adds a warning line
(subagents).
The docs say plainly that this check "doesn't judge whether content is
malicious" and is no substitute for limiting what a subagent can
reach.
Codex: a handful of developer messages
Codex uses the developer message role for the same
purpose. In the 62 sessions still on disk, after the first turn, the harness
added only about eight kinds of message (observed, counted from the
logs):
turn_aborted(32 times): the user interrupted, and "any running unified exec processes may still be running in the background".environment_context(7 times, as a user-role message): the date, timezone and filesystem permissions, sent again when they change.- Mode and role changes: collaboration mode, multi-agent mode and role, skills and permissions.
model_switch: when the user changes model, Codex sends the new model's entire base instructions as a message, about 21,000 characters.- A saved approval: a note that a command prefix the user approved has been saved as a rule.
Codex also writes a turn_context record every turn, with
the working directory, date, model and policies (see
Codex, taken apart). Codex has much less to
say mid-session than Claude Code, because it has fewer features that
change while a session runs.
Pi: updating the system prompt itself
Pi goes the other way. It keeps the system prompt in named sections,
and when one changes it sends only that section again, as a later
system message: "Updated system prompt section …" or "Removed system
prompt section …"
(renderSystemMessageUpdate,
from reading the code). That works only for models whose API accepts a
system message partway through a conversation. For the rest, pi folds
the update into the opening prompt, which costs the cache. Beyond that,
new information reaches the model as ordinary user messages: steering
messages typed while the agent works, and follow-ups queued for when
it's done
(how pi works).
What this adds to the survey
- A session's context builds up in layers. The system prompt describes the start of a session. The current state comes from messages added along the way. Reading a harness's system prompt tells you less than it seems to.
- The cache shapes the design. Appending is cheap
and editing is expensive, so harnesses choose to append.
That's why a CLAUDE.md edit waits for
/clear. - Every feature teaches the model as it switches on. Claude Code puts instructions for plan mode, artifacts and remote sync into the conversation when they're needed, not into the prompt up front. It's the same on-demand loading it uses for tools and skills.
- The harness keeps marking what isn't from the user. Much of what it says mid-session is about which text carries authority, and that's the thing prompt injection attacks.
Keeping this current
This repo's check.py tracks every doc page and source
file linked here. The Codex counts come from my session logs, and the
Claude Code session list is from one session, so neither updates on
its own.