Skip to main content
prompt GP ChatGPT

return_background — Claude Code prompt for background jobs

The return_background Claude Code prompt coordinates background jobs and waits. It defines queue boundaries, result checks, and recovery after failures.

MIT ★ 488 updated 2026-11-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/return_background.md
Open on GitHub

What return_background does

The prompt sets rules for queuing work and waiting for it to finish. The agent keeps each returned job ID and calls wait_for_tool only in a later submission, after receiving that ID. An enqueue receipt confirms acceptance, not execution or arrival.

A tail job that finishes in the same episode queue confirms that earlier jobs have ended. A timeout or cancellation does not create that barrier, nor does it apply across resources. finish is not a queue barrier. When an earlier result matters, the agent checks it with get_tool_result.

At a physical decision boundary, the agent waits for motion to finish, then checks feedback and the observation of its effect. A successful tool call alone does not prove physical success. If a prerequisite fails, queued dependents can be cancelled with the exposed cancellation tools; an action already running cannot be forcibly stopped.

What it helps with

  • queue independent work before a blocking wait
  • confirm earlier jobs have ended in the same queue
  • inspect feedback before relying on an action result
  • cancel queued dependents after a prerequisite fails

Example prompts for the agent

  • Run independent jobs in the background, then wait according to return_background.
  • After a physical action, inspect its feedback and the observation before continuing.
  • If a prerequisite fails, cancel unjustified queued work and inspect the measured state.

How to install return_background

Manually: put the files in place

.claude/commands/return_background.md

Questions about return_background

How do I install return_background in Claude Code?

Add the file to the project at .claude/commands/return_background.md.

What does return_background do?

It sets rules for background jobs: when to wait, how to check results, and how to handle dependent jobs after a failure.

When does a completed background job confirm that earlier jobs have ended?

Only when the tail job actually finishes in the same episode queue. A timeout or cancellation provides no such barrier, and the guarantee does not cross resource queues.

Source text

return_background.md · MIT
Issue independent work before a blocking wait when resource scheduling allows
it to overlap a running job. An enqueue receipt is acceptance, not execution or arrival. Keep returned job
IDs. Call wait_for_tool only after receiving its job_id, in a later submission;
never invent IDs or place a wait beside the submission that will create its ID.
For confirmed order on the same episode queue, a tail job that actually finishes
execution means earlier jobs have ended. A timeout or cancelled tail provides
no such barrier, and no barrier extends to another resource. finish is not a
queue barrier. The tail result certifies only its own execution: inspect
relevant earlier feedback with get_tool_result if a prerequisite is uncertain.

Wait at physical decision boundaries, then inspect feedback and the observation
showing the effect. Job completion and tool call_ok=true do not establish
physical success. Read-only work may overlap motion when it needs no new state;
a historical view is not a completion barrier. Wait for motion before relying
on geometry it may invalidate. Any action-model call remains one queue boundary,
including all of its internal chunks.

Failed or partial actions do not automatically cancel queued dependents. If a
prerequisite fails, use the exposed cancellation tools to remove unjustified
queued work. Cancellation cannot forcibly stop an already running action.
Resolve running work and inspect the measured state before planning recovery.

© Open-RUA · MIT · Open-RUA/uni-robot-agent

Similar prompts

All prompts for Agent setup: memory, context, orchestration →

From the same set41

The whole set →
hybrid The hybrid Claude Code prompt coordinates a humanoid as one actor. It combines upper-body targets with walking velocity while native control handles the legs and waist. GP ChatGPT ★ 488repo stars hybrid The hybrid prompt for Claude Code reports RoboDojo task progress with evidence-backed subgoals. A reviewer checks action-model proposals before execution. GP ChatGPT ★ 488repo stars hybrid The hybrid Claude Code prompt controls an arm and dexterous hand assembly in DexJoCo. It supports pick_bucket with the published single-arm model recipe. GP ChatGPT ★ 488repo stars hybrid The hybrid prompt for Claude Code directs R1Pro through actor_act. It covers bounded local phases using the robot’s whole body and grippers. GP ChatGPT ★ 488repo stars main_agent This Claude Code prompt delegates visual observation while leaving physical actions and task completion to the main agent. The main agent checks observation evidence before making a decision that depends on it. GP ChatGPT ★ 488repo stars hybrid The hybrid Claude Code prompt helps choose between actor_act and direct robot motion. It guides a bounded control phase and the checks that follow. GP ChatGPT ★ 488repo stars hybrid The hybrid prompt for Claude Code and ChatGPT guides a Go2 quadruped through a prepared indoor navigation episode. The agent chooses movement from RGB views and ends the run only by calling finish. GP ChatGPT ★ 488repo stars meta_skill The meta_skill Claude Code prompt guides agents through finding existing skills and recording lessons backed by a task. It comes into play when an agent needs to add a lesson or revise a skill. GP ChatGPT ★ 488repo stars

Project sponsors

Companies that keep this analytics open