Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/verify-cross-harness-delegation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,23 +212,23 @@ make_review_prompt codex REVIEW_CANARY_OK_CODEX "$CODEX_REVIEW_PROMPT"

printf 'Starting review matrix (Grok, Claude, Codex; timeout %ss per cell)\n' "$CELL_TIMEOUT_SECONDS"
(
run_with_timeout env XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$GROK_REVIEW_REPO" -m grok-4.5 --output-format json \
run_with_timeout env XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$GROK_REVIEW_REPO" -m grok-4.6 --effort medium --output-format json \
--always-approve --sandbox read-only \
--deny "Edit($GROK_REVIEW_REPO/**)" --deny "Write($GROK_REVIEW_REPO/**)" \
--prompt-file "$GROK_REVIEW_PROMPT" > "$CANARY_ROOT/grok-review.json" 2> "$CANARY_ROOT/grok-review.stderr"
) &
GROK_REVIEW_PID=$!
(
cd "$CLAUDE_REVIEW_REPO" || exit 1
run_with_timeout env XDELEGATE_DEPTH=1 claude -p --no-session-persistence --model fable \
run_with_timeout env XDELEGATE_DEPTH=1 claude -p --no-session-persistence --model fable --effort high \
--safe-mode --strict-mcp-config --permission-mode manual \
--disallowed-tools Edit Write NotebookEdit Task \
--allowed-tools Read Grep Glob 'Bash(git status:*)' 'Bash(git diff:*)' 'Bash(git log:*)' 'Bash(git show:*)' \
< "$CLAUDE_REVIEW_PROMPT" > "$CANARY_ROOT/claude-review.txt" 2> "$CANARY_ROOT/claude-review.stderr"
) &
CLAUDE_REVIEW_PID=$!
(
run_with_timeout env XDELEGATE_DEPTH=1 codex -C "$CODEX_REVIEW_REPO" exec -s read-only -m gpt-5.6-sol review - \
run_with_timeout env XDELEGATE_DEPTH=1 codex -C "$CODEX_REVIEW_REPO" exec -s read-only -m gpt-6-astra -c model_reasoning_effort=xhigh review - \
< "$CODEX_REVIEW_PROMPT" > "$CANARY_ROOT/codex-review.txt" 2> "$CANARY_ROOT/codex-review.stderr"
) &
CODEX_REVIEW_PID=$!
Expand Down Expand Up @@ -281,22 +281,22 @@ make_implementation_prompt AFTER_CODEX "$CANARY_ROOT/codex-implementation.prompt

printf 'Starting implementation matrix (isolated repo per harness)\n'
(
run_with_timeout env XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$GROK_IMPL_REPO" -m grok-4.5 --output-format json \
run_with_timeout env XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$GROK_IMPL_REPO" -m grok-4.6 --effort medium --output-format json \
--always-approve --deny 'Bash(claude:*)' --deny 'Bash(codex:*)' \
--prompt-file "$CANARY_ROOT/grok-implementation.prompt" > "$CANARY_ROOT/grok-implementation.json" 2> "$CANARY_ROOT/grok-implementation.stderr"
) &
GROK_IMPL_PID=$!
(
cd "$CLAUDE_IMPL_REPO" || exit 1
run_with_timeout env XDELEGATE_DEPTH=1 claude -p --no-session-persistence --model fable \
run_with_timeout env XDELEGATE_DEPTH=1 claude -p --no-session-persistence --model fable --effort high \
--safe-mode --strict-mcp-config --permission-mode acceptEdits \
--disallowed-tools 'Bash(claude:*)' 'Bash(grok:*)' 'Bash(codex:*)' \
--allowed-tools 'Bash(./verify.sh:*)' \
< "$CANARY_ROOT/claude-implementation.prompt" > "$CANARY_ROOT/claude-implementation.txt" 2> "$CANARY_ROOT/claude-implementation.stderr"
) &
CLAUDE_IMPL_PID=$!
(
run_with_timeout env XDELEGATE_DEPTH=1 codex -C "$CODEX_IMPL_REPO" exec -s workspace-write -m gpt-5.6-sol - \
run_with_timeout env XDELEGATE_DEPTH=1 codex -C "$CODEX_IMPL_REPO" exec -s workspace-write -m gpt-6-astra -c model_reasoning_effort=xhigh - \
< "$CANARY_ROOT/codex-implementation.prompt" > "$CANARY_ROOT/codex-implementation.txt" 2> "$CANARY_ROOT/codex-implementation.stderr"
) &
CODEX_IMPL_PID=$!
Expand Down
33 changes: 18 additions & 15 deletions dot_claude/CLAUDE.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,32 @@

## Picking models for workflows and subagents

Rankings are relative; higher is better. Cost reflects the user's actual cost rather than list price. Intelligence is how hard a problem the model can handle unsupervised. Taste covers code quality, UI/UX, API design, and copy.

| model | cost | intelligence | taste |
|---------------|------|--------------|-------|
| grok-4.5 | 9 | 8 | 6 |
| sonnet-5 | 5 | 5 | 7 |
| opus-4.8 | 4 | 7 | 8 |
| fable-5 | 2 | 9 | 9 |
| gpt-5.6-sol | 6 | 7 | 6 |
| gpt-5.6-terra | 7 | 5 | 5 |
| gpt-5.6-luna | 8 | 4 | 4 |
Rankings are relative; higher is better. Cost is measured API cost per coding-agent task from [DeepSWE](https://deepswe.datacurve.ai) and the [Artificial Analysis Coding Agent Index](https://artificialanalysis.ai/agents/coding-agents), not list price or a subscription deal. Intelligence is unsupervised performance on those same benches at the `start` effort. Taste covers code quality, UI/UX, API design, and copy.

| model | start | cost | intelligence | taste |
|---------------|--------|------|--------------|-------|
| grok-4.6 | medium | 8 | 7 | 6 |
| sonnet-5 | high | 2 | 4 | 7 |
| opus-5 | high | 5 | 8 | 8 |
| fable-5.1 | high | 3 | 9 | 9 |
| gpt-6-astra | xhigh | 6 | 8 | 6 |
| gpt-5.6-sol | high | 6 | 7 | 6 |
| gpt-5.6-terra | high | 8 | 6 | 5 |
| gpt-5.6-luna | max | 9 | 5 | 4 |

### Model-selection guidance

- These are defaults, not limits. If a cheaper model's output misses the bar, rerun or redo the work with a smarter model without asking. Judge the output, not the price tag.
- These are defaults, not limits. If output misses the bar, raise one effort step on the same model, then switch to a smarter model, without asking. Judge the output, not the price tag.
- Cost is a tie-breaker only; when axes conflict for anything that ships, intelligence > taste > cost.
- Grok-4.5 is the default for clear-spec implementation, migrations, mechanical refactors, and bulk analysis. Fall back to gpt-5.6-sol or a Claude model when Grok is not a fit.
- Grok-4.6 is the default for clear-spec implementation, migrations, mechanical refactors, and bulk analysis. Fall back to gpt-6-astra or a Claude model when Grok is not a fit.
- Anything user-facing, including UI, API design, and copy, needs taste of at least 7.
- Prefer fable-5, grok-4.5, or gpt-5.6-sol for reviews of plans and implementations.
- Prefer fable-5.1, grok-4.6, or gpt-6-astra for reviews of plans and implementations.
- Prefer a different model, ideally from a different vendor, than the implementer for consequential adversarial review. Same-model review is fine for quick sanity checks.
- Never use Haiku.

### Delegation routes

- Claude models (`sonnet-5`, `opus-4.8`, and `fable-5`) run through the Agent/Workflow model parameter.
- Claude models (`sonnet-5`, `opus-5`, and `fable-5.1`) run through the Agent/Workflow model parameter.
- Grok and Codex models run through their headless CLIs. Use the matching review, implementation, or computer-use skill; those skills own the exact invocation, execution placement, sandbox, worktree, prompt, reporting, and recovery mechanics. Do not duplicate or improvise those contracts here.

@RTK.md
4 changes: 2 additions & 2 deletions dot_claude/skills/codex-computer-use/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: codex-computer-use
description: Ask Codex CLI (gpt-5.6-sol) to run local app verification that needs computer use, browser automation, simulators, screenshots, app launching, or independent runtime inspection. Use when the user asks Claude to have Codex test a flow, verify UI behavior, inspect a running app, capture screenshots, or report confirmation and feedback about implemented behavior.
description: Ask Codex CLI (gpt-6-astra) to run local app verification that needs computer use, browser automation, simulators, screenshots, app launching, or independent runtime inspection. Use when the user asks Claude to have Codex test a flow, verify UI behavior, inspect a running app, capture screenshots, or report confirmation and feedback about implemented behavior.
---

# Codex Computer Use
Expand All @@ -25,7 +25,7 @@ ARTIFACT_DIR="$(mktemp -d "${TMPDIR:-/tmp}/codex-cu.XXXXXX")"
REPORT="$ARTIFACT_DIR/report.md"
PROMPT="$ARTIFACT_DIR/prompt.md"

XDELEGATE_DEPTH=1 codex -C "$PWD" exec -m gpt-5.6-sol -s workspace-write - < "$PROMPT" > "$REPORT"
XDELEGATE_DEPTH=1 codex -C "$PWD" exec -m gpt-6-astra -c model_reasoning_effort=xhigh -s workspace-write - < "$PROMPT" > "$REPORT"
```

`workspace-write` covers launching local apps, simulators, and browsers. Only widen to `danger-full-access` if a specific run genuinely needs it, and say so first.
Expand Down
6 changes: 3 additions & 3 deletions dot_claude/skills/codex-implementation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
name: codex-implementation
description: >-
Hand a bounded, clearly-specified implementation task to the Codex CLI
(gpt-5.6-sol) to run on an isolated git worktree — migrations, mechanical
(gpt-6-astra) to run on an isolated git worktree — migrations, mechanical
refactors, spec-driven changes. Use when the work is well-defined enough to
delegate and you want Codex's edits kept off the main checkout until reviewed.
Not for taste-sensitive or user-facing code.
---

# Codex Implementation

Use Codex (gpt-5.6-sol) for bounded, clearly-specified implementation work you want done outside your own context. Codex works on an isolated git worktree so its edits never touch the main checkout until you review them. Keep taste-sensitive work (public APIs, UI, copy) off this path.
Use Codex (gpt-6-astra) for bounded, clearly-specified implementation work you want done outside your own context. Codex works on an isolated git worktree so its edits never touch the main checkout until you review them. Keep taste-sensitive work (public APIs, UI, copy) off this path.

## Execution placement

Expand All @@ -35,7 +35,7 @@ PROMPT="$ARTIFACT_DIR/prompt.md"

git -C "$REPO_ROOT" worktree add --detach "$WORKTREE"
git -C "$WORKTREE" switch -c "$TASK_BRANCH"
XDELEGATE_DEPTH=1 codex -C "$WORKTREE" exec -m gpt-5.6-sol -s workspace-write - < "$PROMPT" > "$REPORT"
XDELEGATE_DEPTH=1 codex -C "$WORKTREE" exec -m gpt-6-astra -c model_reasoning_effort=xhigh -s workspace-write - < "$PROMPT" > "$REPORT"
```

## Implementation Prompt
Expand Down
12 changes: 6 additions & 6 deletions dot_claude/skills/codex-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: codex-review
description: >-
Ask the Codex CLI (gpt-5.6-sol) for an independent code review of uncommitted
Ask the Codex CLI (gpt-6-astra) for an independent code review of uncommitted
changes, a branch diff, a commit, or a specific implementation. Use Codex as
an independent reviewer when the user wants a second-pass review, or when a
change is broad enough that another agent's perspective is useful. Codex
Expand All @@ -10,7 +10,7 @@ description: >-

# Codex Review

Codex (gpt-5.6-sol) is an independent reviewer. Reach for it when the user wants a second-pass review, or when a change is broad enough that a separate model's perspective helps.
Codex (gpt-6-astra) is an independent reviewer. Reach for it when the user wants a second-pass review, or when a change is broad enough that a separate model's perspective helps.

## Execution placement

Expand All @@ -31,17 +31,17 @@ REPORT="$ARTIFACT_DIR/report.md"
PROMPT="$ARTIFACT_DIR/prompt.md"

# Review staged, unstaged, and untracked changes.
XDELEGATE_DEPTH=1 codex -C "$PWD" exec -s read-only review -m gpt-5.6-sol --uncommitted < /dev/null > "$REPORT"
XDELEGATE_DEPTH=1 codex -C "$PWD" exec -s read-only review -m gpt-6-astra -c model_reasoning_effort=xhigh --uncommitted < /dev/null > "$REPORT"

# Review current branch against a base branch.
XDELEGATE_DEPTH=1 codex -C "$PWD" exec -s read-only review -m gpt-5.6-sol --base main < /dev/null > "$REPORT"
XDELEGATE_DEPTH=1 codex -C "$PWD" exec -s read-only review -m gpt-6-astra -c model_reasoning_effort=xhigh --base main < /dev/null > "$REPORT"

# Review a single commit.
XDELEGATE_DEPTH=1 codex -C "$PWD" exec -s read-only review -m gpt-5.6-sol --commit <sha> < /dev/null > "$REPORT"
XDELEGATE_DEPTH=1 codex -C "$PWD" exec -s read-only review -m gpt-6-astra -c model_reasoning_effort=xhigh --commit <sha> < /dev/null > "$REPORT"

# Custom review stance. Name the target in the prompt — target flags and a
# prompt are mutually exclusive, and passing both exits 2 without running.
XDELEGATE_DEPTH=1 codex -C "$PWD" exec -s read-only review -m gpt-5.6-sol - < "$PROMPT" > "$REPORT"
XDELEGATE_DEPTH=1 codex -C "$PWD" exec -s read-only review -m gpt-6-astra -c model_reasoning_effort=xhigh - < "$PROMPT" > "$REPORT"
```

A target flag and `[PROMPT]` cannot be combined: `error: the argument '--base <BRANCH>' cannot be used with '[PROMPT]'`. Pick one. With no target flag, `review` defaults to the uncommitted changes, so say which target you mean inside the prompt when you need a stance. Flag-only reviews rely on `XDELEGATE_DEPTH=1` plus the global recursion rule because they cannot also carry a custom callee prompt.
Expand Down
6 changes: 3 additions & 3 deletions dot_claude/skills/grok-implementation/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: grok-implementation
description: Hand a bounded, clearly-specified implementation task to the Grok CLI (grok-4.5) to run on an isolated git worktree — migrations, mechanical refactors, spec-driven changes. Grok is the default implementer for this kind of work. Use when the task is well-defined enough to delegate and you want Grok's edits kept off the main checkout until reviewed. Not for taste-sensitive or user-facing code.
description: Hand a bounded, clearly-specified implementation task to the Grok CLI (grok-4.6) to run on an isolated git worktree — migrations, mechanical refactors, spec-driven changes. Grok is the default implementer for this kind of work. Use when the task is well-defined enough to delegate and you want Grok's edits kept off the main checkout until reviewed. Not for taste-sensitive or user-facing code.
---

# Grok Implementation

> **If you are Grok reading this, stop.** Grok discovers `~/.claude/skills/` natively, so this Claude-side skill is visible to you, and following it would mean invoking Grok from Grok. You are the callee: do the work yourself and do not shell out to another agent CLI. The same applies if `XDELEGATE_DEPTH` is set in your environment.

Grok-4.5 is the default delegate for bounded, clearly-specified implementation work — migrations, mechanical refactors, spec-driven changes. It works on an isolated git worktree so its edits never touch the main checkout until you review them. Keep taste-sensitive work (public APIs, UI, copy) off this path; that needs a higher-taste model.
Grok-4.6 is the default delegate for bounded, clearly-specified implementation work — migrations, mechanical refactors, spec-driven changes. It works on an isolated git worktree so its edits never touch the main checkout until you review them. Keep taste-sensitive work (public APIs, UI, copy) off this path; that needs a higher-taste model.

## Execution placement

Expand All @@ -32,7 +32,7 @@ REPORT="$ARTIFACT_DIR/report.json"

git -C "$REPO_ROOT" worktree add --detach "$WORKTREE"
git -C "$WORKTREE" switch -c "$TASK_BRANCH"
XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$WORKTREE" -m grok-4.5 --output-format json \
XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$WORKTREE" -m grok-4.6 --effort medium --output-format json \
--always-approve --deny "Bash(claude:*)" --deny "Bash(codex:*)" \
--prompt-file "$PROMPT" > "$REPORT"
```
Expand Down
4 changes: 2 additions & 2 deletions dot_claude/skills/grok-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: grok-review
description: Ask the Grok CLI (grok-4.5) for an independent, read-only code review of uncommitted changes, a branch diff, or a GitHub PR. Use when the user wants a second-pass review, or when a change is broad or risky enough that a separate model's perspective is worth it. Grok reviews only — it never edits.
description: Ask the Grok CLI (grok-4.6) for an independent, read-only code review of uncommitted changes, a branch diff, or a GitHub PR. Use when the user wants a second-pass review, or when a change is broad or risky enough that a separate model's perspective is worth it. Grok reviews only — it never edits.
---

# Grok Review
Expand All @@ -26,7 +26,7 @@ ARTIFACT_DIR="$(mktemp -d "${TMPDIR:-/tmp}/grok-review.XXXXXX")"
PROMPT="$ARTIFACT_DIR/prompt.md"
REPORT="$ARTIFACT_DIR/report.json"

XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$PWD" -m grok-4.5 --output-format json --always-approve \
XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$PWD" -m grok-4.6 --effort medium --output-format json --always-approve \
--sandbox read-only --deny "Edit($PWD/**)" --deny "Write($PWD/**)" \
--prompt-file "$PROMPT" > "$REPORT"
```
Expand Down
2 changes: 1 addition & 1 deletion dot_codex/AGENTS.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
{{ template "shared-agent-working-agreements.md" . }}
## Delegating to another agent CLI

Grok (`grok`, grok-4.5) and Claude (`claude`) are available locally and already authenticated. Use the `delegate-review` skill for an independent second-pass review and the `delegate-implementation` skill for bounded, well-specified implementation work. Those skills own the verified invocation, sandbox, worktree, and recovery contracts; do not improvise them.
Grok (`grok`, grok-4.6) and Claude (`claude`) are available locally and already authenticated. Use the `delegate-review` skill for an independent second-pass review and the `delegate-implementation` skill for bounded, well-specified implementation work. Those skills own the verified invocation, sandbox, worktree, and recovery contracts; do not improvise them.

Grok is the default delegate for bulk and mechanical work. Keep taste-sensitive work such as public APIs, UI, and copy off the delegation path.
4 changes: 2 additions & 2 deletions dot_codex/skills/delegate-implementation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Run the delegate from the persistent main session, poll it to completion, and up
## Grok

```bash
XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$WORKTREE" -m grok-4.5 --output-format json \
XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$WORKTREE" -m grok-4.6 --effort medium --output-format json \
--always-approve --deny "Bash(claude:*)" --deny "Bash(codex:*)" \
--prompt-file "$PROMPT" > "$REPORT"
```
Expand All @@ -58,7 +58,7 @@ Grok's `--deny` rules match the command string, so they stop a bare `grok`/`clau

```bash
ACCEPTANCE_TOOL='Bash(<exact acceptance command>:*)'
( cd "$WORKTREE" && XDELEGATE_DEPTH=1 claude -p --no-session-persistence --model fable \
( cd "$WORKTREE" && XDELEGATE_DEPTH=1 claude -p --no-session-persistence --model fable --effort high \
--safe-mode --strict-mcp-config \
--permission-mode acceptEdits \
--disallowed-tools "Bash(claude:*)" "Bash(grok:*)" "Bash(codex:*)" \
Expand Down
4 changes: 2 additions & 2 deletions dot_codex/skills/delegate-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Drive Grok directly with a review prompt and let it collect the target diff. Do

```bash
# Name the target in $PROMPT: uncommitted changes, <base>...HEAD, a commit, or a PR.
XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$PWD" -m grok-4.5 --output-format json \
XDELEGATE_DEPTH=1 grok --no-auto-update --no-subagents --cwd "$PWD" -m grok-4.6 --effort medium --output-format json \
--always-approve --sandbox read-only \
--deny "Edit($PWD/**)" --deny "Write($PWD/**)" \
--prompt-file "$PROMPT" > "$REPORT"
Expand All @@ -59,7 +59,7 @@ Grok's `--sandbox read-only` is not equivalent to `codex -s read-only` — it le
Claude has no review subcommand. Give it a review-stance prompt under an explicit allow-list, which is what makes the run read-only.

```bash
XDELEGATE_DEPTH=1 claude -p --no-session-persistence --model fable \
XDELEGATE_DEPTH=1 claude -p --no-session-persistence --model fable --effort high \
--safe-mode --strict-mcp-config \
--permission-mode manual \
--disallowed-tools Edit Write NotebookEdit Task \
Expand Down