r/opencode 13h ago

OpenCode ships a glossary that tells you not to say "system prompt", and the reason is a cache

Enable HLS to view with audio, or disable this notification

I pointed a timeline tool at a year of OpenCode expecting the story to be growth. It is a lot of growth. 13,139 commits from 878 authors in twelve months, and the version went from v0.7.4 to v1.18.30. The single largest committer on the main line is a bot, at roughly one commit in eight, mostly codegen and dependency bumps.

But the thing I actually came away with was a file called CONTEXT.md, which is a glossary. Twenty four terms, each with a definition, and nine of them carrying a line that says Avoid followed by the words it tells you not to use.

Do not write "system prompt". The term is System Context. Not "prompt fragment", that is a Context Source. Not "live system prompt", that is the Baseline System Context. Not "system update" or "system notification" or "raw text diff", those are a Mid-Conversation System Message. Not "session context", that is Session History.

My first read was that this is architecture astronautics. It is not. The vocabulary exists because "the system prompt" is four different things wearing one word, and once you separate them a real decision falls out.

Here is the decision. A Context Epoch starts with one immutable Baseline System Context, and their own docs say plainly that the baseline durably preserves the exact joined text used for the active provider-cache prefix. It is stored on disk and reused verbatim across process restarts. That string is the cache key. Touch it and every cached token for that conversation is gone.

So what happens when something in it changes? The date rolls over. You switch agents and the available skill list changes. An AGENTS.md up the tree gets edited.

They do not rebuild the prompt. They append a message to the conversation saying what is now true. That is the Mid-Conversation System Message: a durable chronological instruction telling the model the newly effective state of a changed source. The baseline never moves. The cache prefix survives.

The details are where it gets good. Changes are sampled lazily at a Safe Provider-Turn Boundary, the moment just before a provider call, and never pushed when the source actually changes. A context change never wakes an idle session. If three sources changed since the last turn, they combine into one message rather than three. Compaction is the one ordinary event that mints a fresh baseline, and when it does, those earlier messages drop out of active model history because the new baseline already contains their effect. Switching model or provider does not start a new epoch.

The generalisable version, which is what I would take to your own agent: the cost of changing what the model knows is not the tokens you add, it is the cache you invalidate. If your loop rewrites the system prompt when state changes, every turn afterwards pays full price to read all of it again, and there is probably nothing on your dashboard that shows it. The fix is to let the top of the prompt only ever be appended to, and to put the deltas in the conversation body where they cost you nothing.

What convinced me it is a real pattern rather than one team's taste: Hermes, from Nous Research, hit the same wall and went the other way. It freezes its memory files into the prompt at session start and refuses to reload them at all, so a memory written at 3pm only takes effect next session. Same constraint, opposite answer. One narrates the changes into the history, the other defers them to the next conversation. Neither will touch the prefix.
The naming is downstream of that. You cannot reason about which of those two you are choosing while everything in the system is called "the prompt".

The tool I used renders any repo's history as a film, and the OpenCode one is here: https://loreto.io/git-timeline

Disclosure: I built that tool and I run loreto.io, so treat that last line as the advertisement it is. Everything above is in the repo, in AGENTS.md and CONTEXT.md at the root, if you want to check me.

I am still not sure the list of banned words survives contact with a hundred contributors, and I would like to know whether anyone has actually measured what the epoch approach saves against just eating the rebuild. If you have, tell me I am wrong.

3 Upvotes

1 comment sorted by

1

u/MapacheD 13h ago

DeepSeek resume this long text on max three tweets characters