When LLMs first landed, providers gave us the system prompt. A single text file, injected into the start of every session. People used it to store their name, their job, how they liked to be spoken to, and their agent felt a little more like theirs.
That file had one author and one direction. A human wrote it, in advance, for the agent to read.
It didn’t survive contact with real work. As soon as an agent is operating across multiple domains, projects, communication channels, installed tools, different modes for different tasks, a single text file becomes either too sparse to be useful or too long to be loaded. So you split it out: many files, and a map of pointers loaded at the start of each session, the content fetched only when the task demands it. At which point you’re not working with a system prompt anymore. You’re working with a library.
Here’s the turn. The agent can write files too. And if it can write files, it can write context. It can update the map during a session. Add a note about the project it just worked on. Correct a fact. Extend its own operating procedures based on something it learned today. It can, in other words, prompt itself.
I’m calling this second-layer prompting. The first layer was a human writing instructions for an agent. The second is an agent writing instructions for its future self.
Two session windows, Monday's and Tuesday's, connected by a single file. In Monday's session the agent loads its map (folders: projects, inbox, notes, skills), the user asks 'find last month's invoices', and the agent discovers something the map didn't know: the invoices live in Drive, not email. Before the session ends it writes that discovery into a file, notes/billing.md, shown leaving the session window: 'invoices live in Drive, not email'. Monday's session then dies; the file persists. Tuesday's session boots from zero, loads the same map, and notes/billing.md is pulled straight into its context alongside the map, before the user has said anything. When Tuesday's user asks for the invoices, the agent goes straight to Drive. The caption lands the point: Tuesday's prompt was written by Monday's session. No human edited anything in between.
Two session windows, Monday's and Tuesday's, connected by a single file. In Monday's session the agent loads its map (folders: projects, inbox, notes, skills), the user asks 'find last month's invoices', and the agent discovers something the map didn't know: the invoices live in Drive, not email. Before the session ends it writes that discovery into a file, notes/billing.md, shown leaving the session window: 'invoices live in Drive, not email'. Monday's session then dies; the file persists. Tuesday's session boots from zero, loads the same map, and notes/billing.md is pulled straight into its context alongside the map, before the user has said anything. When Tuesday's user asks for the invoices, the agent goes straight to Drive. The caption lands the point: Tuesday's prompt was written by Monday's session. No human edited anything in between.
There’s a recursive property here that matters when you zoom out. The files an agent reads at the start of a session are context. The files it writes during a session become context for every session that follows. Context creates context. An agent that writes carefully today is authoring the substrate its successors operate from tomorrow.
This is what makes the second layer consequential in a way the first never was. A system prompt was bounded. One author, one file, edited by hand, and a mistake got corrected the same way. A second-layer write has no such ceiling. It shapes what the next session knows, which shapes what it writes, which shapes the session after that. Good context compounds. Bad context compounds too: a wrong instruction saved in the wrong file propagates downwards indefinitely, and nobody is proofreading.
(What happens when dozens of sessions read and write the same files at once, simultaneously, is its own essay.)
My own agent updates his operating manual most weeks. By now, most of it was written by him.