Where does each layer live, and how long does it last?
These terms describe different jobs. Ask what changes each time and what should stay available for future work. The current client and date range may change; the reporting procedure may stay the same.
| Layer | Where it lives | Lifespan | What does not belong in it |
|---|---|---|---|
| Prompt | The message you type | One turn | Standing policy you retype every time |
| Skill | A SKILL.md folder | Until the procedure changes | Client records, keys, task status |
| Memory | A memory file the host loads | Until the fact changes | Transcripts, to-do lists, secrets |
| Tool | An MCP server or host permission | Until access is revoked | Guidance about when to use it |
| Agent | The running session | The session | Anything you expected to persist |
How do you tell which layer a piece of knowledge belongs to?
Run four questions against the sentence you are about to write, in this order. The first yes wins and you stop.
- Does it expire when this task ends? Then it is a prompt and it stays in the message.
- Would a new hire need it to repeat the work? Then it is a skill, written as steps with a verification pass at the end.
- Is it a stable fact about the business, the stack, or the people? Then it is memory.
- Does it require reaching a system outside the model? Then it is a tool, and the real question becomes who approves the call.
Take a live example. A client wants a monthly report. The date range and the client name go in the prompt, because they change every run. The pull, clean, and format procedure goes in a skill, because it is identical every month. The fact that this client counts a booked call as a lead, not a form fill, goes in memory, because it stays true until they redefine it. The analytics connection is a tool, and publishing the finished report goes through a person.
What does this look like on disk?
The examples below show where different agent products store instructions and context. You do not need to memorize the paths. Use them to locate the files for the product you are setting up.
Claude Code
.claude/skills/<name>/SKILL.md skill, this project
~/.claude/skills/<name>/SKILL.md skill, every project
./CLAUDE.md memory, this project
~/.claude/CLAUDE.md memory, this user
.mcp.json tools
Hermes
~/.hermes/skills/<name>/SKILL.md skill
memory file location unconfirmed, check your install
OpenClaw
<workspace>/skills/<name>/SKILL.md skill, this workspace
~/.openclaw/skills/<name>/SKILL.md skill, shared
<workspace>/AGENTS.md memory, startup contextSaved instructions and skills can load in different ways. Some project instructions may be included automatically, while the full text of a skill may be read only when needed. Check which files your software loads, especially instructions inherited from a parent folder. Extra or outdated instructions can affect the result and usage cost.
What does a layer mistake actually look like?
When the agent repeats a mistake, check where the relevant instruction is stored. It may be missing from the current task, saved in the wrong project or contradicted by another file.
- Procedure stranded in prompts: output drifts between runs and nobody can say which version was correct.
- Business facts buried in a skill: you edit one file to change a phone number, and every project using that skill inherits the edit.
- Task status written into memory: the agent opens confident and works last month's priorities.
- Credentials anywhere in context: they now live in a file you sync, back up, and paste into support threads.
How do you move something into the right layer?
Run the task again without repeating the instruction you just saved. Check whether the agent still follows it. That verifies the saved procedure or context is doing its job.
Keep a change history for these files. Record what changed, when and why, so a change in behavior can be investigated and an earlier version restored if needed.
Is a skill just a saved prompt?
A skill can contain a reusable prompt, but it also has a description that helps the agent select it and can include supporting files. Check how your agent software loads each kind of instruction.
Should project rules go in memory or in a skill?
Use project context for stable facts and conventions. Use a skill for a procedure with steps, inputs and review criteria. Permission rules belong in the software controls that enforce them.
Do these layers work the same across every agent host?
The general ideas are similar, but file locations and supported settings differ. Check the product documentation and test the same task after moving a skill.
Sort your instructions into the right layers
Start with the layer map in this guide. If the same instruction keeps being repeated, we can help decide whether it belongs in a reusable procedure, project context, or a tool permission rule.