# Second-layer prompting

*The agent writes instructions for its future self.*

Published 2026-06-10 · https://dom.vin/2026/second-layer-prompting

## Summary

An essay coining the term second-layer prompting: not a human writing instructions for an agent, but an agent writing instructions for its future self. The system prompt was the first layer, a single human-written text file injected into the start of every session. It didn’t survive contact with real work: an agent operating across projects, channels, tools, and modes needs either too much or too little from one file, so the file becomes a library, a map of pointers the agent fetches from on demand. The turn the essay names: the agent can write files too, and a file written into the map today is loaded as context by the session that boots tomorrow. The write is a prompt, the author is the agent, the reader is its own successor. The recursive property follows: 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 after. Context creates context. That is what makes the second layer consequential in a way the first never was. A first-layer prompt was bounded, one author and one file, corrected by hand. A second-layer write propagates: 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, and nobody is proofreading.

## Claims

- Second-layer prompting: not a human writing instructions for an agent, but an agent writing instructions for its future self.
- The system prompt became a library. One human-written file can't hold an agent doing real work across many domains; it splits into a map the agent fetches from on demand.
- Context creates context. The files an agent reads at session start are context; the files it writes during a session become context for every session that follows.
- A first-layer prompt is bounded: one author, one file, corrected by hand. A second-layer write propagates, so good context compounds and bad context compounds too.

---

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](/2026/ax) 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.

> **Figure 1 — relay.** 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](/2026/good-context).)

My own agent updates his operating manual most weeks. By now, most of it was written by him.
