The top AI prompts for Loop Engineering, free to copy right now. Get results in seconds.
Top tested AI prompts for Loop Engineering that get you real results, fast.
The top AI prompts for Loop Engineering, free to copy right now. Get results in seconds.
Top copy-paste AI prompts for Loop Engineering covering design the loop architecture, write the automation and schedule, assign sub-agent roles, and more. Free to use, no account required, and built for professional results at every stage.
Stage 1
Before writing a single prompt or cron entry, you need a clear picture of what the loop does, what triggers it, what agents are involved, and what done means. These prompts help you design the architecture on paper before building it.
Design a daily triage loop
I want to design a daily agent loop for [YOUR_PROJECT]. The loop should run every morning and do the following: (1) read open GitHub issues, recent CI failures, and any failing tests; (2) rank findings by priority; (3) write a task queue to .agent/tasks.md; (4) spawn one sub-agent per top-3 task, each in its own git worktree; (5) run a verification pass after each fix; (6) send a Slack summary when done. Output a complete AGENTS.md describing the loop architecture, the cron schedule, the sub-agent role definitions, and the stop conditions.
Map a loop to replace a manual workflow
I currently do the following manually for [YOUR_PROJECT]: [DESCRIBE YOUR WORKFLOW, e.g. review PRs, triage bugs, check test coverage]. I want to replace this with an agent loop. For each step in my workflow, propose: the trigger, the agent responsible, the tool or MCP connector needed, and the verifiable output. Then write a one-paragraph loop architecture summary I can use as the opening of my AGENTS.md.
Write a minimal viable loop
Design the simplest possible working loop for [YOUR_PROJECT] that will run nightly and do one useful thing without breaking anything. I want the minimum viable loop: one automation, one clear task, one verifiable stop condition. Output: the AGENTS.md entry, the cron expression, and the single loop prompt with a /goal condition.
Identify the right loop primitives for my project
I am building a loop for [YOUR_PROJECT] using [TOOL, e.g. Claude Code / Cursor]. My goal is: [DESCRIBE GOAL]. Based on this goal, tell me which loop primitives I need from this list and why: scheduled automations, worktrees, sub-agents, skills/SKILL.md, MCP connectors, memory/state files. For each primitive I need, describe exactly how it would function in my specific loop.
Design a loop for continuous improvement
I want a loop for [YOUR_PROJECT] that continuously improves code quality without me prompting it. The loop should: identify the weakest area of the codebase each morning (test coverage, type errors, lint warnings, dead code), fix the top issue, verify the fix, commit and push, then update a progress file. Design the full loop with: the discovery prompt, the fix agent definition, the verification conditions, the commit strategy, and the daily summary format.
Stage 2
The automation is the heartbeat of the loop. It fires on a schedule, does discovery, and starts the work. These prompts help you write automations that run reliably, scope their work correctly, and hand off cleanly to the rest of the loop.
Write a morning discovery automation
Write a Claude Code automation for [YOUR_PROJECT] that runs every morning at 6am UTC. The automation should: (1) read .agent/tasks.md and check which tasks are still open; (2) query GitHub for any new issues opened since yesterday with label "bug"; (3) read the last CI run result from the CI log file; (4) compile a prioritized list of up to 5 tasks and write it to .agent/tasks.md, replacing the old content. Write the full automation prompt and the cron schedule entry.
Create a /goal command for test coverage
Write a /goal command for [YOUR_PROJECT] with this stop condition: "Test coverage for the [MODULE_NAME] module is above 80% and all existing tests pass." The loop should: identify untested functions, generate test cases one at a time, run the test suite after each addition, and stop when the condition is met. Write the /goal command, the AGENTS.md context file the agent should read each run, and a fallback prompt for when the agent gets stuck.
Set up a nightly dependency audit
Write a Claude Code scheduled task for [YOUR_PROJECT] that runs every night and audits dependencies. The task should: run npm audit or equivalent, identify any high or critical vulnerabilities, check if there are known safe upgrades, attempt one upgrade per run with a test pass, and commit the upgrade if tests pass. Write the full task definition including schedule, prompt, and success/failure hooks.
Write a PR review automation
Set up an automation for [YOUR_PROJECT] that triggers when a new pull request is opened. The automation should: read the PR diff, check for missing tests in changed files, flag any lint errors introduced by the PR, post a structured review comment listing findings, and label the PR as "needs-work" or "looks-good" based on the check results. Write the full automation definition, the review prompt, and the GitHub MCP connector configuration needed.
Design a /loop for continuous refactoring
Write a /loop command for [YOUR_PROJECT] that runs on a 4-hour cadence and gradually refactors the codebase toward TypeScript strict mode. Each iteration should: identify the file with the most TypeScript errors, fix the errors in that file only, run tsc to verify no new errors were introduced, commit the change, and update a progress log. Write the /loop prompt, the per-iteration task definition, and the final stop condition.
Stage 3
The most powerful structural pattern in a loop is splitting the agent that builds from the agent that checks. A second agent with different instructions catches what the first one talked itself into. These prompts help you define clear roles, write agent definitions, and build the handoff between them.
Define a maker and checker pair
I want to set up a maker/checker sub-agent pair for [YOUR_PROJECT]. The maker agent writes or edits code. The checker agent reviews it against these criteria: [LIST YOUR CRITERIA, e.g. all tests pass, no new lint errors, logic matches the spec]. Write both agent definitions as .claude/agents/ YAML files. Include: name, description, instructions, and any tools or read-only restrictions. The checker should be configured to never write code, only report findings.
Write a three-agent pipeline
Design a three-agent pipeline for [YOUR_PROJECT] that handles [DESCRIBE THE TASK]. Agent 1 is the Explorer: reads the codebase and writes a plan. Agent 2 is the Implementer: executes the plan step by step. Agent 3 is the Verifier: runs tests and checks the implementation against the original spec. Write the definitions for all three agents and the handoff protocol between them, including what each agent reads, writes, and passes forward.
Create a security review sub-agent
Write a sub-agent definition for [YOUR_PROJECT] that does security review only. The agent should: never modify code, only read it; scan for OWASP Top 10 vulnerabilities; check for hardcoded secrets; verify authentication and authorization logic; and output a structured report to .agent/security-review.md. Write the full .claude/agents/security-reviewer.yaml definition with instructions detailed enough that the agent does not need additional prompting.
Build an agent team for a full feature
I want to ship [FEATURE NAME] in [YOUR_PROJECT] using a multi-agent team. Design the full agent team: one agent to write the feature spec, one to implement it, one to write tests, one to review the code, and one to update the documentation. Write all five agent definitions and the orchestration prompt that starts the team and passes work between agents in the right order.
Design a triage agent for incoming work
Write a triage sub-agent for [YOUR_PROJECT] that runs first in every loop iteration. Its job is to read .agent/tasks.md and decide: which task is highest priority, whether the task is specific enough to hand to an implementer agent, and if not, what clarifying questions to add to the task before it moves forward. Write the triage agent definition and the task format it should produce as output.
Stage 4
The loop forgets everything between runs. The memory file does not. A well-designed state file is what turns a series of disconnected agent runs into a coherent long-running project. These prompts help you design the files and structures that make your loop compound over time.
Design an AGENTS.md for a loop project
Write an AGENTS.md file for [YOUR_PROJECT] that is designed to be read by a loop agent at the start of every run. The file should include: the project purpose in one sentence, the loop architecture and cadence, the current task queue format, the conventions the agents must follow, the do-not-touch files, and the definition of done for this sprint. Write the full AGENTS.md in markdown.
Create a state file that tracks loop progress
Design a .agent/state.md file for [YOUR_PROJECT] that an agent updates at the end of every loop iteration. The file should track: what was attempted in the last run, what passed verification, what failed and why, the current open task list, and the overall progress toward the sprint goal. Write the state file template and the agent instructions for how to read and update it each run.
Build a task queue format
Design a task queue format for .agent/tasks.md in [YOUR_PROJECT] that a scheduling agent writes and implementation agents consume. Each task entry should include: a unique ID, a priority level, a one-sentence description, the acceptance criteria, the current status (todo, in-progress, done, blocked), and the branch or worktree it is running in. Write the format specification and a sample with three example tasks.
Write the memory update prompt
Write a prompt for the memory agent in [YOUR_PROJECT]. This agent runs at the end of every loop iteration. Its job is to: read the work done in this iteration from git diff and the agent logs, update .agent/state.md with what changed, add completed tasks to a done log, and write a one-sentence summary of the iteration for the morning report. Write the full memory agent prompt.
Design loop restart behavior
My loop for [YOUR_PROJECT] sometimes fails partway through a run. Design the restart behavior: what the loop should read at startup to understand where it left off, how it should handle partially completed tasks, how it should avoid re-doing work that already succeeded, and what it should log to help me debug failures. Write the restart prompt and the state file format that supports safe restarts.
Stage 5
A loop running unattended is also a loop making mistakes unattended. The verifier is the only thing standing between the loop and shipping bad code. These prompts help you write verification conditions that are tight, test-based, and impossible to talk around.
Write a /goal stop condition
Write a /goal command for [YOUR_PROJECT] that will run the loop until this condition is verifiably true: [YOUR CONDITION, e.g. "All TypeScript errors are resolved and the test suite passes with no skipped tests"]. The /goal command should: define the exact terminal condition in terms the agent can check programmatically, specify the check command to run after each iteration, set a maximum iteration count as a safety limit, and define what to do if the condition is not met after the limit.
Design a verification agent
Write a verification sub-agent for [YOUR_PROJECT] that runs after every implementation pass. The agent should check: (1) all tests in the affected module pass; (2) no new lint errors were introduced; (3) the change does not touch files outside the stated scope; (4) the commit message matches the task description. If any check fails, the agent should write a failure report to .agent/verification-failures.md and not mark the task as done. Write the full agent definition.
Write an acceptance test for loop output
I want to write an acceptance test that the loop for [YOUR_PROJECT] must pass before any PR is opened. The test should verify: [DESCRIBE YOUR REQUIREMENTS]. Write this as a shell script that exits 0 on pass and 1 on fail, and write the loop configuration to run this script as the final step before pushing.
Create a quality gate prompt
Write the quality gate prompt for [YOUR_PROJECT] that runs between the maker and checker agents. The prompt should instruct the checker to evaluate the maker's output against: the original task spec, the test results, the code style conventions in AGENTS.md, and any security requirements. The checker must output a structured verdict: PASS with summary, or FAIL with a numbered list of specific issues the maker must fix before re-submitting.
Handle loop failures gracefully
My loop for [YOUR_PROJECT] sometimes produces incorrect output or fails verification. Write the failure handling protocol: what the loop should do when verification fails (retry with additional context, escalate to human, or skip and continue), how many retries to allow, what to write to the state file on failure, and how to alert me when the loop cannot continue. Write the failure handling prompt and the notification format.
Loop engineering is the practice of designing systems where an AI coding agent runs autonomously on a schedule, works through a task queue, and produces verified output without human input on each iteration. Instead of prompting the agent yourself, you write the architecture that prompts it: AGENTS.md defines the roles, the cron entry sets the schedule, and state files give the agent the context it needs each run. The prompts in this guide cover every stage of that design.
A regular session ends when you close the window. A loop runs on a schedule, picks up where it left off using state files, and produces committed output without you intervening. The key difference is the design upfront: a good loop has a defined purpose, a verifiable stop condition, and a memory system that carries context between runs. These prompts help you build all three.
Claude Code is the most fully-featured option, with native support for scheduled tasks, worktrees, sub-agents, skills, and MCP connectors. Cursor supports multi-agent workflows using agent definitions and background tasks. Any tool that can run a coding agent on a schedule and read project-level instruction files can be used to build loops, though the specific primitives vary.
The minimum bar is: the loop can run unattended, verify its own output, stop when done or when something goes wrong, and leave the repo in a clean state. If any of those four properties is missing, the loop is not ready for autonomous operation. The verification and stop condition prompts in Stage 5 of this guide address the most common gaps.
Most loops need only two: a maker and a checker. Start there before adding more. The maker implements the task, the checker verifies the output. Once that pair is reliable, add specialized agents only for genuinely distinct roles, like a security reviewer or a documentation updater. More agents means more handoffs, which means more points of failure.
AI Prompts for Claude Code Loop Setup
Claude Code ships all five loop engineering primitives: scheduled tasks, worktrees, sub-agents, skills, and MCP connectors.
See promptsAI Prompts for Sub-agent Orchestration
The most reliable pattern in loop engineering is keeping the agent that builds separate from the agent that checks.
See promptsAI Prompts for Verification and Goal Loops
A loop running unattended is a loop making mistakes unattended.
See prompts