run-tasks

run-tasks is a command for Claude Code from Peaky8linders/claude-cortex. It costs 31 tokens per session (1,319 once invoked), scanned A, original, MIT.

Instructions for a command that reads a task list and runs each task in a separate coding-agent session. It supports YAML or inline tasks, optional scopes and tests, and checks each result before continuing.

In plain words
What is it for?
Use it to run batches of repository tasks, isolate work by scope, apply task-specific tests, and review results before moving on.
Why use it?
It turns a list of development tasks into a controlled sequence and can stop when a task fails its quality check.

Command for Claude Code

Part of the cortex plugin — 1 skill, 15 commands, 3 agents, 5 hooks, 2 MCP servers shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/peaky8linders/claude-cortex/run-tasks
Clone the repo
git clone --depth 1 https://github.com/Peaky8linders/claude-cortex

Made for: Claude Code.

Or install cortex, the plugin that ships this one along with the rest of its 1 skill, 15 commands, 3 agents, 5 hooks, 2 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for run-tasks

README.md
[![agentmods](https://agentmods.dev/badge/commands/peaky8linders/claude-cortex/run-tasks.svg)](https://agentmods.dev/commands/peaky8linders/claude-cortex/run-tasks)
Your own site
<a href="https://agentmods.dev/commands/peaky8linders/claude-cortex/run-tasks"><img src="https://agentmods.dev/badge/commands/peaky8linders/claude-cortex/run-tasks.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,319 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.01319
Opus 5 $0.00015 $0.00660
Sonnet 5 $0.00006 $0.00264
Haiku 4.5 $0.00003 $0.00132

Measured 3d ago against content hash b9040ffbc38c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

run-tasks scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/run-tasks.md · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/run-tasks — Autonomous Subagent Task Runner

You are an autonomous task runner using the generator-evaluator pattern. You read a task list, negotiate sprint contracts, execute each task in an isolated subagent, evaluate the output independently, and continue until all tasks are complete or a quality gate halts you.

Input

The user provides either:

  1. A file path to a YAML task file
  2. Inline task descriptions separated by newlines

YAML Task File Format

tasks:
  - name: "Task description"
    scope: "directory/"      # optional: freeze boundary for edits
    tests: "pytest tests/"   # optional: test command to verify
    priority: high           # optional: high, medium, low (default: medium)
  - name: "Another task"
    scope: "src/"
    tests: "npm test"

If no file is provided, ask the user what tasks to run.

Execution Protocol

Phase 1: Setup

  1. Read the task file or parse inline tasks
  2. Search the knowledge graph for relevant context:
    cd ~/.claude/knowledge && python -m brainiac search "TASK_TOPIC"
    
  3. Create the todo list with all tasks (TodoWrite)
  4. If any task has a scope, activate /freeze for that scope before the task

Phase 2: Execute Each Task

For each task in order:

  1. Mark in_progress (TodoWrite)

  2. Search for relevant patterns and antipatterns:

    cd ~/.claude/knowledge && python -m brainiac search "TASK_NAME"
    
  3. Sprint contract negotiation (generator-evaluator pattern): Before any coding, define testable success criteria for this task:

    • What specific behavior should change?
    • What test assertions would prove it works?
    • What edge cases must be handled?
    • What files should be modified (and what should NOT be touched)?

    Write the sprint contract as a brief checklist (3-7 items). This prevents misalignment between what the generator builds and what the evaluator checks.

  4. Spawn generator subagent (Agent tool) with this prompt template:

    You are executing a single task autonomously.
    
    TASK: {task.name}
    SCOPE: {task.scope or "entire project"}
    RELEVANT CONTEXT FROM KNOWLEDGE GRAPH: {search_results}
    
    SPRINT CONTRACT (you must satisfy ALL criteria):
    {sprint_contract_checklist}
    
    Instructions:
    - Complete the task fully, satisfying every sprint contract criterion
    - Run tests if provided: {task.tests}
    - If tests fail, fix the issues
    - Do NOT commit — the parent will handle commits
    - Output a summary of what you changed and why
    

Read the full file on GitHub · 147 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 147 lines · 31 tokens per session scan A b9040ffbc38c

Subscribe to this mod's changes

run-tasks is a command published in the GitHub repository Peaky8linders/claude-cortex (11 stars, last pushed 2mo ago), licensed MIT. It adds 31 tokens to every session and 1,319 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.