---
title: "codex-harness-patterns"
description: "Long-running task patterns distilled from OpenAI Codex harness v0.149.0: tool output budgeting, context pressure compaction, parallel sub-agent fan-out, structured plan streaming, self-review, sub-agent delegation, world"
canonical: https://agentpluginsdirectory.com/plugins/codex-harness-patterns
last-updated: 2026-10-25
---

# codex-harness-patterns
Long-running task patterns distilled from OpenAI Codex harness v0.149.0: tool output budgeting, context pressure compaction, parallel sub-agent fan-out, structured plan streaming, self-review, sub-agent delegation, world-state tracking, background task management, thread-level goal persistence, per-sub-task model routing, completion auditing, fork-context decision, sub-agent family tracking, goal token budgeting, error recovery strategy, retry with backoff, streaming output reader, session handoff, long-term memory, skill auto-selection, plugin authoring helper, tool discovery pattern, and session branch/fork. 23 Skills total covering the complete agent lifecycle: planning → decomposition → sub-agent parallelism → execution → state tracking → tool discovery → skill/plugin authoring → memory persistence → session branching. Activates when an agent must manage token budget, decompose work, sustain multi-step tasks without losing focus, coordinate sub-agents, pick the right model for the job, prove that a non-trivial task is actually done, stay within an explicit goal token budget, recover from transient failures, read streaming output without filling context, hand off a session cleanly, persist memory across sessions, write a discoverable skill, design a discoverable tool, author a marketplace plugin, or branch / fork / revert a session. **Requires MiniMax Code 0.2.4+** (pinned to the mcode 0.2.4 `task` / `bash` tool surface: `task(description, prompt, agent_name, run_in_background?)`, `bash(command, timeout?, run_in_background?)`, `task_query`, `task_output`, `task_stop`: earlier mcode versions used legacy placeholders for the same fields and are not supported).
- Slug: codex-harness-patterns
- Publisher: antianqi
- Repository: https://github.com/MiniMax-AI/MiniMax-Code-Plugins
- Manifest: plugins/antianqi/codex-harness-patterns/plugin.json
- Version: 1.0.4
- License: Apache-2.0
- Category (editorial): other
- Skills: 23 (background-task, completion-audit, context-pressure-compact, delegate-with-context, error-recovery-strategy, fork-context-decision, goal-persistence, goal-token-budgeting, long-term-memory, model-router, parallel-fanout, plan-stream-emit, plugin-author-helper, retry-with-backoff, review-mode, session-branch-fork, session-handoff, skill-auto-select, streaming-output-reader, subagent-family-tracking, tool-discovery-pattern, tool-output-budget, world-state-tracking)
- MCP servers: 0
- Stars: 21
- Repository created: 2026-08-17
- Repository last pushed: 2026-10-20
- Publisher type: Organization
- Listing: https://agentpluginsdirectory.com/plugins/codex-harness-patterns
- Schema: https://agent-plugins.org/schemas/1.0.0/plugin.schema.json

## What codex-harness-patterns does, in the publisher's words

A focused collection of Skills distilled from the OpenAI Codex harness v0.149.0 execution model (codex-rs/core/). These Skills teach a MiniMax Code agent how to survive long-running multi-step tasks without losing focus, blowing its token budget, stalling on serial work, shipping unverified changes, burning context on bad sub-agent briefs, drifting from the original goal, paying main-model prices for cheap-model work, losing track of which sub-agent is doing what, failing on transient errors without a budget, reading streaming output without filling context, or losing work at session end.

> 类型:patch · Skill 主体修正 (round 2) · 5 个 Skill 按 mcode 0.2.4 真实 task / bash schema 重写;新增 23-Skill frontmatter 静态检查

- fork-context-decision 0.2.0 → 0.3.0:reviewer 提出的 6 点全部 close

From the project README, punctuation lightly normalized. Full text: https://raw.githubusercontent.com/MiniMax-AI/MiniMax-Code-Plugins/HEAD/plugins/antianqi/codex-harness-patterns/README.md

## Skills

- background-task: Decide when to launch a long-running task in the background and how to refer to it later. Covers both the `task` tool (sub-agent background via `run_in_background: true`) and the `bash` tool (shell background via `run_in_background: true`). USE WHEN: a sub-agent is expected to take > 1 minute, a sh…
- completion-audit: Before saying "done", derive requirements, find authoritative evidence, verify each is ✅. USE WHEN: about to say "done" / "complete" / "ship it" / "I finished" / "做完了" on non-trivial task, about to mark `todowrite` step done, about to update goal to `complete`, user has been waiting for "done" for…
- context-pressure-compact: Compress a long-running multi-step task into a structured snapshot before continuing. USE WHEN: `todowrite` > 5 items, after ~20 tool calls, context getting full, agent has lost track of goal, user said "compact" / "summarize" / "refocus" / "压缩" / "总结" / "到哪了", before context window fills (>80%), b…
- delegate-with-context: Hand off a sub-task to a sub-agent with a tight, complete brief in the `prompt`, not the full conversation history. Apply the 4-part message envelope (Task name / Sender / Task / Payload + return path). USE WHEN: about to call `task()` to hand off a sub-task, the full conversation history is too la…
- error-recovery-strategy: Classify error into 4 buckets (transient / deterministic / stale / unknown) and pick one of 5 actions (retry / switch / fallback / refresh-then-retry / ask-user / skip). USE WHEN: tool returns non-success, sub-agent `status: closed-failed`, exception escapes, timeout fires, weird partial-success re…
- fork-context-decision: Decide how much parent context to include in a sub-agent's `prompt` before spawning it. Pick "all / N turns / brief only" explicitly, not by accident. USE WHEN: about to call `task()` to hand off work, designing a multi-agent flow, sub-agent failed and debugging whether cause was over- or under-for…
- goal-persistence: Maintain explicit north-star goal for the whole thread that survives compactions and detects drift. USE WHEN: non-trivial task stated, user redirected mid-task ("actually do X instead" / "wait scrap that" / "现在改成"), before `context-pressure-compact`, about to mark done, user said "我们的目标是" / "we're…
- goal-token-budgeting: Track running token usage against goal's `token_budget`, surface at 50/80/100% thresholds, stop at 100%. USE WHEN: `goal-persistence` active AND user provided `token_budget`, user said "do X within Y tokens" / "用 Y token 完成" / "不要超预算" / "stayed within budget" / "超出预算" / "用了多少 token", about to start…
- long-term-memory: Design a cross-session long-term memory system that extracts, consolidates, and cites durable knowledge from conversation rollouts. USE WHEN: building any system that needs to persist insights across sessions, designing "what should the next agent remember" pipelines, building memory workspaces wit…
- model-router: Classify sub-task complexity (cheap / medium / main) and decide whether to spawn a sub-agent at all. On MiniMax Code 0.2.4 the `task` tool does not expose per-call model selection, so the 3-tier rubric here is a thinking framework for session-level model choice and a "do I really need a sub-agent?"…
- parallel-fanout: Decompose a task into 2+ truly independent sub-tasks and dispatch them concurrently via separate `task()` calls. Pick whether to fan out explicitly, not by accident. USE WHEN: the user task is clearly decomposable into 2+ independent sub-tasks (independent files, independent probes, independent ana…
- plan-stream-emit: Before touching files on a non-trivial task, emit a structured plan and surface to the user for early course-correction. USE WHEN: non-trivial task, multi-step task, ambiguous requirement, would take > 3 tool calls, user has not approved an approach yet, user said "plan first" / "before you start"…
- plugin-author-helper
- retry-with-backoff
- review-mode
- session-branch-fork
- session-handoff
- skill-auto-select
- streaming-output-reader
- subagent-family-tracking
- tool-discovery-pattern
- tool-output-budget
- world-state-tracking

Descriptions come from the frontmatter of each SKILL.md, punctuation lightly normalized.
