Human-in-the-Loop Agent Task Management for Claude Code
Docs / How-To / Workflow Patterns
Workflow Patterns

Agentic Workflow Patterns

Five practical patterns for structuring human-agent collaboration with AgentRQ. Use these as templates — adapt them to your project's needs.

1

The Approval Gate

The most common pattern. Claude reaches a decision point — a destructive action, a production deployment, a schema change — and needs explicit human sign-off before proceeding. The agent pauses, creates a task, and waits for a reply.

Flow
Claude encounters a risky or irreversible action
createTask("Approve: drop users table", "I need to drop the legacy users table. All data has been migrated. Approve to proceed?", assignee: "human")
updateTaskStatus(taskId, "ongoing") — marks as waiting for response
Claude waits — human receives notification in dashboard
Human replies "approved" or "rejected"
Claude reads reply via channel notification, proceeds or stops accordingly
updateTaskStatus(taskId, "completed")

Instruct Claude to use this pattern in your CLAUDE.md:

CLAUDE.md — approval gate instruction
## Approval Gates

Before any of the following actions, create an AgentRQ task
and wait for explicit human approval:

- DROP or TRUNCATE any database table
- DELETE operations affecting more than 10 rows
- Any deployment to production
- Modifying authentication or authorization logic
- Sending emails or notifications to external users

## Approval workflow:
1. createTask() — title: "Approve: [action]", body: full context
2. updateTaskStatus(taskId, "ongoing")
3. Wait for human reply via channel notification
4. If approved: proceed, then updateTaskStatus(taskId, "completed")
5. If rejected: stop, explain why, updateTaskStatus(taskId, "completed")
2

Human Review of Output

Claude finishes a chunk of work and submits it for human review before moving on. Unlike the approval gate, the work is already done — this is about quality review, not permission. The task is created as completed, and the human's reply drives next steps.

Flow
Claude finishes a feature branch or module
createTask("Review: auth module complete", "Here's what I built...", attachments: [diff])
updateTaskStatus(taskId, "completed") — work is done, awaiting review
Human reviews the diff/output, replies with feedback or "LGTM"
Claude receives reply via channel notification, addresses feedback or moves on to next task
Key Distinction
In the Approval Gate, the task status is set to ongoing (waiting before acting). In Human Review, the task status is set to completed immediately (work is done, review is async). The difference signals intent to the human reading the dashboard.
3

Parallel Task Delegation

Claude needs information or decisions from the human on multiple independent fronts. Instead of blocking sequentially on each, it creates multiple tasks at once and continues working on whatever it can while the human resolves them in parallel.

Flow
Claude starts a long task, identifies multiple external dependencies
createTask("Provide Stripe API keys for payment integration")
createTask("Confirm DB migration window — when is safe to run?")
Claude continues working on non-blocked parts of the feature
Human resolves both tasks in the dashboard (independently, in any order)
Claude receives notifications for each, unblocks and completes the work
Claude creating parallel tasks
// Create both tasks immediately — don't wait for one before creating the other
const task1 = createTask({
  title: "Provide Stripe API keys",
  body: "I need STRIPE_SECRET_KEY and STRIPE_PUBLISHABLE_KEY to wire up payments."
})

const task2 = createTask({
  title: "Confirm DB migration window",
  body: "Migration adds 2 new tables. Safe to run during business hours? If not, when?"
})

updateTaskStatus(task1.id, "ongoing")
updateTaskStatus(task2.id, "ongoing")

// Now continue with work that doesn't depend on these answers
4

Status Reporting

For long-running work (multi-hour refactors, bulk migrations, multi-phase builds), Claude creates a single progress-tracking task and posts regular updates as replies. The human can check in at any time without interrupting the agent.

Flow
Claude starts a multi-phase refactor
createTask("Refactoring: session started", body: detailed plan of all phases)
Claude works through Phase 1 — then: reply(taskId, "Phase 1 complete: 12/40 files migrated")
Claude works through Phase 2 — then: reply(taskId, "Phase 2 starting: working on auth module")
reply(taskId, "All done. 40/40 files migrated, all tests passing.")updateTaskStatus(taskId, "completed")
Why This Works
The human gets a real-time log of progress without having to ask. If something looks wrong in an intermediate update, they can reply directly on the task with a course correction. Claude receives the reply as a channel notification and can adjust without breaking its overall flow.
5

Exception Escalation

Claude encounters something unexpected — an inconsistent DB state, ambiguous requirements, a missing credential, a test suite that's completely broken for unknown reasons. Rather than guessing or halting entirely, it escalates to the human with full context.

Flow
Claude encounters unexpected state or ambiguity it can't safely resolve
createTask("BLOCKER: Unexpected schema state", "Found X, expected Y. What do I do?")
updateTaskStatus(taskId, "ongoing") — Claude pauses work on this branch
Human investigates and replies with instructions or context
Claude receives reply via notification, resumes with human guidance
Use "BLOCKER:" prefix in the title for critical escalations. This makes urgent tasks immediately visible at the top of the dashboard's attention queue — the human knows not to wait to look at it.

CLAUDE.md Best Practices

The most reliable way to get consistent human-oversight behavior from Claude is to codify the rules in your project's CLAUDE.md. Claude reads this file at the start of every session. Here's a template that covers all five patterns:

CLAUDE.md — AgentRQ oversight section
## Human Oversight (via AgentRQ)

Always use AgentRQ MCP tools for human oversight:
- Before any destructive operation (delete, drop, truncate)
- Before touching production systems
- When a decision affects more than one file/module
- When you're uncertain about scope or intent

## Workflow

1. createTask() with title and full context
2. updateTaskStatus("ongoing") immediately
3. Wait for human reply via channel notification
4. Proceed or stop based on their response
5. updateTaskStatus("completed") when resolved

## Task Title Conventions

- "Approve: [action]"    → needs sign-off before proceeding
- "Review: [work done]"  → finished work, wants feedback
- "BLOCKER: [issue]"     → unexpected problem, need guidance
- "FYI: [update]"        → status update, no action needed

## Long-Running Work

For tasks taking more than ~15 minutes:
- Create a tracking task at the start with the full plan
- Post reply updates at each phase boundary
- Mark completed when all phases are done