PromptForge
Prompt library

Giving Loops Memory

ClaudeAutomation From a course

For loops that run over many steps (research agents, multi-turn assistants), summarize prior steps into a short running memory instead of replaying the full history every time — this keeps context small and cheap..

The prompt

Here is a running summary of research so far: [summary]. Here is the newest finding: [new info]. Update the summary to under 150 words, keeping only what's still relevant to answering: [original question].

What to replace

Swap these placeholders for your own details before running the prompt:

  • [summary]your own value
  • [new info]your own value
  • [original question]your own value

Pro tip: Re-summarize memory every 3-5 steps in long-running agents to avoid context bloat and drifting off-task.

How to use this prompt

  1. Copy the prompt using the button above.
  2. Replace [summary], [new info], [original question] with your own details — the more specific you are, the better the output.
  3. Paste it into Claude and run it.
  4. If the answer feels generic, add constraints: audience, length, tone, and what to avoid. That single change fixes most weak output.

Learn the technique

Giving Loops Memory

Module 2 — Building Agent Loops · Loop & Agentic Engineering

Related prompts