Conversation
…ment Introduces a Claude + Codex debate workflow where Claude drafts implementation plans and Codex reviews them in iterative rounds until approval or max rounds are reached. New components: - plan-agent: opus-model architect agent for plan creation/revision - plan-with-codex command: orchestrates the debate loop - codex-review skill: structured Codex review with verdict tokens - debate-loop.sh: standalone shell harness for the debate - plan-review.sh hook: triggers Codex review on ExitPlanMode
- Add critical rule preventing orchestrator from editing plan directly - Switch agent resume to SendMessage with ToolSearch preload - Add explicit delegation for open question answers to plan-agent - Make Codex/Claude debate loop fully automated after user approval - Add mode=acceptEdits and run_in_background=false to Agent launches - Add AskUserQuestion, SendMessage, ToolSearch to allowed-tools
Structure each finding with a title, problem, and fix section instead of single long lines.
- Add --log-id to run_codex_review.sh, raw JSON stream logged to ~/.closedloop-ai/plan-with-codex/<uuid>.jsonl across rounds - Switch from SendMessage to Agent(resume=) for plan-agent session continuity; add explicit rule to ignore SendMessage guidance - Add log cleanup prompt (30+ day old logs) at end of workflow - Fix dependency check ordering (before log setup) - Normalize LOG_ID:none and CODEX_SESSION:none sentinels to empty - Fix Step 1.5 stray code fence and SendMessage prose mismatch - Add self-check guardrails to plan-agent (goal alignment, scope, simplicity, reuse, tests)
- Detect existing plan file without state and ask user to resume or start fresh; synthesize prompt sidecar from plan summary only when missing - Move prompt validation after existing-plan branch so resume path is reachable without a prompt argument - Normalize LOG_ID:none sentinel to empty in debate-loop.sh caller - Move dependency checks before log setup in run_codex_review.sh - Add LOG_ID to all SKILL.md output examples and usage snippet - Fix argument table: prompt optional when resuming existing plan
Apply context engineering principles to reduce token footprint ~35%: - Extract repeated agent-resume pattern into <templates> block (was 5x) - Extract state-write pattern into single template (was 4x) - Consolidate critical rules into <constraints> XML block - Merge vestigial Step 2e into 2d, renumber 2f to 2e - Fix stale-state STOP guard to allow fall-through on failed preconditions - Add explicit cross-session resume rule (no agent_id = launch fresh) - Preserve Codex session/log IDs in round-transition state writes
When user chooses "resume with existing plan", go directly to the Codex debate loop after resolving open questions instead of stopping at the Step 1.5 user checkpoint. Update option text to match behavior.
Plan-agent now verifies each Codex finding against the codebase before acting and writes a revision summary to a sidecar file with accepted changes and rejected findings with evidence. Codex reads this file on subsequent rounds so it does not re-raise findings that were validly rejected.
Add changelog entries for revision summary feedback loop, codex-review --revisions-file parameter, and plan-with-codex resume fix. Bump version to 1.2.1. Fix README hook description for plan-review.sh.
Install anthropic and mcp in CI so pyright/pytest can resolve all imports. Add pyproject.toml with ruff target-version and pyright pythonVersion set to py311. Run pull_request on all branches.
wongk
approved these changes
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan-agent now verifies each Codex finding against the codebase before acting and writes a revision summary to a sidecar file with accepted changes and rejected findings with evidence. Codex reads this file on subsequent rounds so it does not re-raise findings that were validly rejected.