⚡ PromptLoot

Home › AI Agents

End-of-Session Review: Decision Log & Rules File Updates

Run before /clear or closing a session: the agent logs decisions to docs/decisions.md, notes where it stalled, and proposes small rules-file fixes so the next session doesn't repeat mistakes.

Added

We're ending this session. Before I clear context, do the following. Do not change code.

## 1. Decision log
Append to docs/decisions.md (create it if missing) one entry per real decision made this session:
### [YYYY-MM-DD] [Short title]
- Decision: [what we chose]
- Why: [the reason, in 1-2 lines]
- Rejected: [options we considered and dropped, and why]
- Revisit if: [what would change this decision]
Skip trivial choices. If nothing was decided, write nothing.

## 2. Where the session stalled
List up to 5 moments where you wasted turns: wrong assumptions, commands that failed, files you couldn't find, instructions you misread, or times I had to correct you. For each, give the cause in one line.

## 3. Proposed rules-file changes
For each stall that a rule would have prevented, propose ONE short line for AGENTS.md (or CLAUDE.md). Also flag any existing rule that was wrong or got in the way. Show these as a diff. Do not apply them; I'll approve each one.
Keep the rules file lean: prefer fixing or deleting a line over adding one, and never propose more than 3 additions.

## 4. Pick-up note
Write 5 lines max: what's done, what's in progress, the exact next step, and the command to verify current state. If work is unfinished, put this in HANDOFF.md.

Make sure AGENTS.md has this line so future sessions find the log: "Read docs/decisions.md before changing architecture or reversing an earlier choice."

How to use it

  1. Click Copy template.
  2. Paste into ChatGPT, Claude, Grok, Cursor, or your agent framework.
  3. Replace the [BRACKETED] parts with your details.

Pairs well with: Lean CLAUDE.md: Trim a Bloated Rules File to 40 Lines · Remove-and-Add-Back Test for CLAUDE.md & AGENTS.md Rules

Sponsor this page · Reach builders who use AI daily. Get details

FAQ

How do I keep context when I /clear in Claude Code?

Before clearing, have the agent write decisions to a file in the repo, such as docs/decisions.md, and a short pick-up note. Point AGENTS.md or CLAUDE.md at the log so every new session reads the why behind past choices instead of re-debating them.

Should an AI agent update its own CLAUDE.md or AGENTS.md?

Let it propose changes, not apply them. Agent-written rules tend to pile up and go stale. Reviewing each suggested line as a diff, and capping additions per session, keeps the file short and accurate.

What's the difference between decisions.md and HANDOFF.md?

decisions.md is a permanent log of why the project is built the way it is. HANDOFF.md is temporary and covers one task in progress. Use both: the log for lasting choices, the handoff for unfinished work.

Does this work with Codex, Cursor, and Gemini CLI?

Yes. It's plain Markdown in the repo, so any agent that reads AGENTS.md or your rules files can follow the pointer to docs/decisions.md.

Get 3 new templates every week

Free. Unsubscribe anytime.

Related templates

HANDOFF.md: Move Tasks Between Claude Code, Codex & Cursor

A HANDOFF.md prompt that makes your current coding agent write a short, exact handoff file so a fresh session or a different agent can pick up the task without re-reading everything.

AI Agent Run Postmortem Prompt (Find the Real Fix)

When an AI agent does something wrong, reconstruct what happened from logs and decide the right fix: a prompt edit, a rules-file change, a test, or a hard permission limit.

AI Agent Guardrails Checklist: Prompt Rules vs. Tool Permissions

Reviews your AI agent's rules and moves every limit that matters (money, data, deletes, messages) out of the system prompt and into permissions and code.

Browse all AI Agents templates

New on PromptLoot

Check Current Docs First: Stop Agents Using Outdated APIs

Rules that make Claude Code, Cursor, and Codex check your installed versions and current docs before calling any API, cite the version, and flag deprecations.

Minimal Diff Rules: Stop AI Agents Rewriting Unrelated Code

Rules for Claude Code, Cursor, and Codex: change only what you asked, no drive-by renames, refactors, or reformatting, and list every changed file.
PromptLoot Pro Pack · 200+ advanced templates, agent workflows, and Cursor rules bundles. Coming soon