Skip to content

blackwell-systems/polywave-codex

Repository files navigation

Polywave for Codex CLI

Polywave

Blackwell Systems Buy Me A Coffee

Parallel AI agents that don't break each other's code. Now on Codex CLI.

Status: Usable alpha. The current blessed flow is hybrid: run scout in-session with $polywave scout, then run wave execution from your shell with scripts/run-polywave-wave. The single-session $polywave wave experience is not yet viable in the tested Codex runtime. See IMPLEMENTATION-NOTES.md for the current runtime evidence.

What is this?

This repo provides the Codex CLI implementation of the Polywave protocol: a Codex skill, custom agent definitions, and enforcement hooks that let Codex coordinate parallel agents with disjoint file ownership and worktree isolation.

Repositories

Repository Purpose
polywave-protocol Protocol specification
polywave Claude Code implementation
polywave-codex (this repo) Codex CLI implementation
polywave-go Go engine and polywave-tools CLI
polywave-web Web UI (optional)

Using Claude Code? Start at polywave.

Prerequisites

  • Codex CLI installed
  • Git 2.20+
  • jq 1.6+
  • polywave-tools CLI

Install polywave-tools with one of:

brew install blackwell-systems/tap/polywave-tools
go install github.com/blackwell-systems/polywave-go/cmd/polywave-tools@latest

Quick Start

Use one terminal. The current blessed flow is sequential.

  1. Install Polywave Codex artifacts:
./install.sh
  1. Merge the printed hook configuration into your Codex config, then restart Codex.

  2. Verify the install:

./scripts/verify-codex-install
  1. Initialize your target project if needed:
cd your-project
polywave-tools init
  1. Run scout in Codex:
$polywave scout "add a caching layer to the API client"
  1. Run the wave launcher from your shell:
scripts/run-polywave-wave docs/IMPL/IMPL-caching.yaml --wave 1 --repo-dir "$PWD"

A shorter version of the same flow lives in QUICKSTART.md.

Installation Notes

The installer installs:

  • the hook package
  • the polywave skill
  • progressive-disclosure references and injector scripts
  • prompt builders for scout and wave execution
  • direct Codex ports of the current Polywave custom agents
./install.sh

Use --write-user-hooks only if ~/.codex/hooks.json does not already exist and you want the installer to create it.

Important: install.sh does not finish the job by itself. You must:

  • merge the printed hook config into ~/.codex/config.toml or ~/.codex/hooks.json
  • restart Codex
  • run ./scripts/verify-codex-install

To remove installed hook artifacts:

./uninstall.sh

How to Use Polywave on Codex

Scout (blessed in-session path): Start Codex and invoke the skill directly:

$polywave scout "add a caching layer to the API client"

The orchestrator delegates to polywave-scout, which writes an IMPL manifest validated through polywave-tools.

Wave (blessed shell path): After reviewing the IMPL, run the wave launcher:

scripts/run-polywave-wave docs/IMPL/IMPL-caching.yaml --wave 1 --repo-dir "$PWD"

This prepares worktrees, launches each agent as a parallel codex exec process, and finalizes (merge + verify + cleanup). Disjoint file ownership is enforced through polywave-tools, and worktree isolation comes from per-process sandbox scoping.

Why the split? Codex runtime behavior currently blocks the ideal single-session wave UX:

  • in-session spawned workers can fail on git worktree metadata writes
  • nested codex exec from inside an active session can fail before worker start

The shell launcher avoids both constraints by running each worker as its own top-level process.

Progressive Disclosure

Codex limitation: Codex does not support Claude Code's automatic subagent prompt rewrite path (updatedInput on agent launch), so progressive disclosure references must be loaded explicitly by the $polywave orchestrator or the shell launchers.

The Codex port carries the same basic disclosure structure as the Claude implementation:

  • core orchestrator skill in SKILL.md
  • on-demand protocol references in references/
  • deterministic routing scripts in scripts/inject-context and scripts/inject-agent-context
  • deterministic prompt builders in scripts/build-scout-prompt and scripts/build-wave-agent-prompt

The exact in-session procedure is documented in references/live-loop-playbook.md.

Current Proven Paths

  • $polywave scout in-session: proven
  • scripts/run-polywave-wave: proven end to end
  • fully in-session $polywave wave: not yet a proven production path

Development

Run the hook fixture suite with:

scripts/run-hook-fixtures

To capture real Codex hook payloads, temporarily add the optional audit snippet printed by:

scripts/print-codex-config

Payloads are written under ${CODEX_HOME:-$HOME/.codex}/polywave/audit.

License

MIT OR Apache-2.0

Releases

No releases published

Packages

 
 
 

Contributors

Languages