For AI agents: the complete documentation index is available at https://docs.phax.run/llms.txt, the full documentation bundle is available at https://docs.phax.run/llms-full.txt, and this page is available as Markdown at https://docs.phax.run/reference/cli.md.

phax

  • version: 0.44.0

phax is verified delegation for AI coding agents: delegate a change to another coding agent and get results you can verify.

  • Usage: phax [FLAGS] <SUBCOMMAND>

Global Flags

--usage

Print the phax.usage.kdl CLI spec and exit

--usage-format <format>

Format for --usage output: kdl (default, no external dependency) or json (requires the usage CLI)

Default: kdl

--json-schema

Print the program's contracts as JSON Schema, or a command's after its name, and run nothing

--verbose

Print human-readable progress and system events

--trace

Write structured JSONL trace events to the run folder

phax validate

  • Usage: phax validate [--plan <path>] [--json]

Checks that the configuration decodes and, with --plan, that the given phax-plan.json decodes. The config layers (phax.json, phax.local.json and the phax home's config.json, which is ~/.phax/config.json unless PHAX_HOME is set) are merged and decoded; a user overlay that carries assignments is refused, because assignments is accepted only in phax.json.

The protected paths are listed: the globs of phax.json's "protectedPaths" in order, then the phax.json phax loaded, which is protected too, by its repo-relative path. A malformed glob exits 2 naming protectedPaths[N], and protectedPaths in phax.local.json or the phax home's config.json is refused, because it is accepted only in phax.json.

The prefixes that gate steps' partial commands allow a secure session to start are listed per gate profile that declares any: the words of each pipe segment before its first placeholder, each one a command the agent may run with any further arguments.

The assignment bounds of phax.json are checked against the routing catalog: each bound's model must be in the catalog, its min and max efforts must be efforts that model offers, and min may not come after max. A bad bound exits 2 naming assignments[N] and the field. The shape of a bound is checked at decode time by every command; the catalog check is this command's, lint's and the run preflight's.

A process repository may link its code repository with "code": { "root": "<dir>" }, accepted only in phax.json. The root must be written as a relative path inside the repository, and four checks run: the directory exists, it is exactly the top level of a git repository, this repository ignores it, and this repository does not track it (no gitlink and no file under it in the index, which an ignore rule does not remove). A refusal exits 2 naming code.root and the reason.

The phax home in use is printed on the line after the success line with its source: (PHAX_HOME) when the variable chose it, (default) for ~/.phax. --json carries it as home: { path, from }.

Exits 0 when everything is valid, 2 otherwise.

Side effects: none.

Flags

--plan <path>

Also validate a phax-plan.json at this path

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax validate
phax validate --plan phax-plan.json

phax unlock

  • Usage: phax unlock [--force] [--json] <short-name>

Remove a stale run lock; use --force to remove any lock

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--force

Remove the lock regardless of staleness

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax enter

  • Usage: phax enter [--json] <short-name>

Attaches to the kept-open agent session in the final worktree, so you can review the agent's work, ask follow-up questions, or apply manual fixes interactively.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax enter usage-cli

phax enter-phase

  • Usage: phax enter-phase [--new-session] [--json] <short-name> <phase-id>

Continues a phase's agent session interactively in the phase's worktree: claude-code with claude --resume and codex with codex resume; mistral-vibe has no verified interactive resume. The session carries the phase's own filesystem, network and MCP posture, rebuilt from its security.json; a phase whose security.json cannot be read is refused rather than opened unconfined. Useful for inspecting intermediate state or debugging a phase that has not yet been committed to main.

At the stopped phase of a run in awaiting_review, it continues the stop's current session, or starts a fresh session with the stop's fresh-start command when no session is current or the provider's resume is unverified. --new-session first runs a new read-only first turn there under the run lock, makes its session current (keeping the earlier ones in interactive-session.json) and refreshes review-stop.json; a held lock refuses it with exit 7. A turn that fails or is refused leaves the previous session current. Once the run's close has started, enter-phase refuses the stopped phase until the close ends. At a held stop the current session is the builder's own, continued by default; --new-session starts a read-only look in a fresh session and refreshes only the session and the continue command of review-stop.json. --new-session on a phase that is not stopped is refused with exit 1.

Arguments

<short-name>

Run short name, e.g. usage-cli

<phase-id>

Phase identifier, e.g. phase-02

Flags

--new-session

At a stopped phase, run a new read-only first turn and continue its session

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax enter-phase usage-cli phase-02
phax enter-phase usage-cli phase-03 --new-session

phax session-info

  • Usage: phax session-info [--debug] [--json] <short-name>

Prints diagnostic information about a run: its current state, active phase, worktree path, and agent session id. For a run in awaiting_review it prints the stop's cause, the stopped phase, its worktree, the seed and the current session with the phax enter-phase command that continues it. A held stop reads headless, committed <short sha>, and its session is the builder's. Read-only — no side effects.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--debug

Dump raw binding and model-resolution metadata

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax session-info usage-cli
phax session-info usage-cli --debug

phax shell

  • Usage: phax shell [--json] <short-name>

Opens an interactive shell in the final worktree. Useful for manually inspecting files, running tests, or executing commands outside the agent session. For a run in awaiting_review it opens the stopped phase's worktree.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax shell usage-cli

phax path

  • Usage: phax path [--json] <short-name>

Prints the absolute path to the final worktree on a single line. Useful in scripts: cd $(phax path my-run) or for piping to other tools. For a run in awaiting_review it prints the stopped phase's worktree.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax path usage-cli
cd $(phax path usage-cli)

phax open

  • Usage: phax open [--json] <short-name>

Opens the final worktree with the system's default opener (open on macOS, xdg-open elsewhere), as if you ran that opener on the worktree path. For a run in awaiting_review it opens the stopped phase's worktree. To open the worktree in an editor of your choice, run that editor on the path that phax path <run> prints.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax open usage-cli

phax ls

  • Usage: phax ls [FLAGS]

Lists runs from the local registry (~/.phax/runs/). With no filter flags, shows all runs. Use status filters to narrow output: --active (created or running), --failed, --review-open (finished, open for human review), --awaiting-review (stopped at an interactive phase), or --archived. A run waiting at a stop reads awaiting_review (declared) or awaiting_review (held), and its PHASE column names the stopped phase. Use --json for the versioned run list: one run-list document (a $schema and a runs array) whose runs carry qualifiedName, namespace, shortName, state, branch, currentPhase, gateProfile, updatedAt, lockState, recordsPending, archivePath, stop and pullRequest. A value that is unknown is null, stop is the run's review-stop document, or null when the run is not waiting at a stop, and pullRequest is the URL of the pull request phax opened for the run, or null when it opened none.

Flags

--active

Show only active runs (created or running)

--failed

Show only failed runs

--review-open

Show only review_open runs

--awaiting-review

Show only runs awaiting_review at an interactive phase

--archived

Show only archived runs

--complete

Print run short-names for shell completion

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax ls
phax ls --review-open
phax ls --awaiting-review
phax ls --failed --json

phax archive

  • Usage: phax archive [--force] [--json] <short-name>

Archives a run by moving its worktrees under ~/.phax/archive/<namespace>.<short-name>/ and marking it archived in the registry. Nothing is destructively deleted — every phase's working state is preserved.

Finished runs (review_open, completed) archive by default. Unfinished runs (created, failed, interrupted, rate_limited, stopped, awaiting_review) are refused unless --force is set; the refusal message names the run's current state and the flag. Archiving a run in awaiting_review with --force removes its review-stop.json and moves its worktrees, uncommitted corrections included, to the archive. Running, locked, and already-archived runs are never archivable regardless of --force.

The run's stoppedReason and lastError survive archival intact.

Without --force on a finished run, the final worktree must be clean. With --force, no cleanliness check runs.

Side effects: moves worktrees on the filesystem, updates ~/.phax/runs/.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--force

Archive even if the run is unfinished or a worktree has uncommitted changes

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax archive usage-cli
phax archive usage-cli --force
phax archive plan-27 --force  # give up an interrupted run

phax prune

  • Usage: phax prune [FLAGS] [short-name]…

Deletes each selected archived run of the current namespace for real: its archive folder under ~/.phax/archive/<namespace>.<short-name>/, its worktree metadata in the current repository, its local branches (<branch> and <branch>--phase-NN) and, last, its registry entry — so its name and disk space come back. Before deleting the archive folder, it keeps the run's cost ledger: runs/cost-ledger.json is copied byte for byte to ~/.phax/cost-ledgers/<namespace>.<short-name>.<run-id>.json, and a failed copy keeps the run. Select runs by name (short or <namespace>.<short-name>) or with --all; only archived runs of the current namespace can be pruned, and an unknown, non-archived or other-namespace name refuses the whole command. Never touches records on phax/records/v1, remote branches, remote-tracking refs or pull requests, and never contacts a remote.

A run whose local branches hold commits that no other branch, tag or remote-tracking ref keeps is kept whole unless --force is set, which discards those commits. A branch checked out in a worktree keeps the run even with --force. A locked run refuses the whole command (exit 7).

Always prints a preview first, then asks for confirmation on a TTY; --yes proceeds without asking, --dry-run deletes nothing, and without a TTY the command refuses unless --yes or --dry-run is set. --json prints one JSON document and never prompts. Exits 0 when every selected run was pruned, 1 when nothing was deleted, 3 when at least one run was kept.

Side effects: writes under ~/.phax/cost-ledgers/, deletes under ~/.phax/archive/, deletes local branches and stale worktree metadata, updates ~/.phax/registry.json.

Arguments

[short-name]…

Archived run short name, e.g. old-idea

Flags

--all

Prune every archived run of the current namespace

--force

Also prune runs whose branches hold unpreserved commits (discards those commits)

--dry-run

Print the preview and delete nothing

-y --yes

Proceed without confirmation (required without a TTY)

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax prune old-idea
phax prune --all --dry-run
phax prune --all --yes

phax cost

  • Usage: phax cost <SUBCOMMAND>

Parent command for the runs' cost ledgers. Every run keeps cost-ledger.json in its run folder: one entry per Claude invocation (phase turn, fix attempt, handoff generation, compliance review, code review) with its own API-list cost, tokens per model, agent duration, end time and subscription-window samples. phax archive moves it with the run, and phax prune keeps a copy under ~/.phax/cost-ledgers/.

Examples

phax cost backfill

phax cost backfill

  • Usage: phax cost backfill [--json]

Writes cost-ledger.json for every run in the registry, across namespaces, that has none, derived from the Claude streams its run folder kept: each phase's output.jsonl, fix-attempt-NN.jsonl and handoff-generation.jsonl (reset phase folders first), then compliance-review.session.jsonl, compliance-review-retry.session.jsonl, code-review.session.jsonl and code-review-retry.session.jsonl. It reads the active run folder (/.phax/runs/<namespace>.<short-name>/) or the archived one (/.phax/archive/<namespace>.<short-name>/runs/). Each entry is the invocation's own cost, corrected when Claude Code reports a resumed session cumulatively; its end time is the stream's modification time, and an interrupted invocation carries no duration. A run with no Claude stream gets an empty ledger.

Never touches a run that already has a ledger, never rewrites a ledger and never reads a pruned run or phax/records/v1. A locked run is skipped and named, and so is a run whose folder is missing. A second pass reports nothing to backfill.

Prints wrote <N> cost ledgers (<M> invocations, $<X> API-list) or nothing to backfill. Exits 0 on success, 1 on error.

Side effects: creates cost-ledger.json in run folders under ~/.phax/runs/ and ~/.phax/archive/.

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax cost backfill

phax run

  • Usage: phax run <FLAGS> [short-name]

Extracts a plan from the plan.md given by --plan, creates a run entry in the registry, and executes each phase sequentially in its own Git worktree using the configured AI agent. Each phase runs its gate profile's every-phase steps after execution; the final phase also runs the profile's terminal steps. Each step's surface (local, structural, or product) is recorded per phase and the run's verified surfaces are reported at run end.

A gate step with "output": "gate-report" is judged from the gate report it prints on stdout, saved as checks-attempt-NN.report-SS.json beside the attempt's log: a checked report with any finding fails the step whatever the exit code, and one with no finding passes it on exit 0; the fix prompt lists each finding with its rule, location, message, related locations and guide. A refused report stops the phase without a fix attempt and exits 4, naming the step, the reason and the remedy; the phase pauses as on gates_exhausted and phax resume runs the gate again with the full fix budget. Anything else is a broken step that gets the raw-log fix prompt. Review notes in a checked report fail nothing and go to the review handoff's Review notes section, never to the agent.

Acceptance step: at the gate of an acceptance phase and of the phase that passes it, after every configured step passed, phax runs the acceptance provider (phax.json "acceptance": { "command" }). The command is split on whitespace and run without a shell, in the phase worktree before the commit, under a 120 s limit. It reads one acceptance-request on stdin, {$schema, verdict, phase, acceptancePhase, base, files}, where verdict is "authored" for the acceptance phase and "passed" for the passing phase, which also carries acceptanceCommit; phax saves it as checks-attempt-NN.acceptance-request.json beside the attempt's log. The provider prints a gate report on stdout, judged as a report step and saved as report-SS: findings go to the fix loop, a refused report stops the phase and exits 4, and a provider that cannot be spawned, times out or prints nothing usable fails the step. The step is recorded under the acceptance surface. A passing phase whose acceptance phase was skipped (it produced no changes, so it noted no commit) is refused before its agent runs, with exit 11, and the run fails. A committed acceptance phase is not reset. An acceptance step that exhausts the fix loop or refuses pauses the run with exit 4, and the next steps name both phax resume <run> and the --skip-acceptance correction for a wrong acceptance test.

Extraction results are cached by content hash under ~/.phax/cache/plans/; a repeated run of the same plan.md reuses the cached extraction without calling the LLM again. Use --refresh to force a fresh extraction.

The start preflight also holds every phase to the owner's assignment bounds (phax.json "assignments"): a bound that names an unknown model or effort, or a phase that departs from its governing bound without an Assignment reason: line, refuses before the run is named, with exit 11 and "Assignment preflight failed". A part bound makes the preflight run the architecture provider.

The preflight also checks the plan's acceptance phases: a malformed declaration, a broken pair, or an acceptance phase with no "acceptance" provider configured refuses before the run is named, with exit 11 and "Acceptance preflight failed". The provider is never spawned by the preflight.

A phase the plan declares interactive (**Mode:** interactive) stops the run. phax sets the phase up like any phase, writes the seed into .phax-context/ and runs one read-only first turn, then leaves the run in awaiting_review, writes review-stop.json in the run folder and exits 13 without waiting for input. The output names the worktree, the command that continues the agent session (or starts a fresh one) and phax resume. The person works in the worktree with any editor or agent; phax resume closes the stop.

--hold [selection] stops the run for review at headless phases too: no value holds every headless phase but the final one, --hold acceptance the plan's acceptance phases, and --hold phase-02,phase-04 the phases listed (exactly phase-NN, no repeats). A malformed value exits 1 before the run is named, and a selection the plan cannot honour (an unknown, interactive or final phase) exits 11 with "Hold preflight failed". A held phase does its work, passes its gate, commits and validates its handoff, then stops in awaiting_review before its record and its cleanup, with no agent turn, and exits 13. The hold is recorded with the run: phax resume takes no --hold and holds exactly those phases. A bare --hold takes the next word as its value, so put the run name before it or write --hold=<selection>. With --dry-run, the hold is resolved and printed as one line, Hold: none or Hold: listed — phase-02, phase-04, with any hold preflight errors under it; the dry run still exits 0 and names no run. A hold may stop inside an acceptance pair: see phax resume. Transcripts are not part of this release.

A gate attempt fails when the phase changed a path listed in phax.json "protectedPaths", or the phax.json phax loaded: the fix loop is told which paths to put back, and a phase that does not pauses as on gates_exhausted. The same check runs before a commit-only resume commits, after the handoff turn, and when a held phase is re-entered; a stop's close is not checked. A skill edit grant (--allow-skill-edits) on a protected path is refused before the run is named, with exit 11.

A plan under docs/plans/ of a process repository whose phax.json "code.root" names this repository is gated as that repository's artifact: it must be Approved, recorded and fresh against this code, with the refusals a plan living with its code gets, and the run reaches review as any other. At review the run leaves the plan and spec alone and prints the phax artifact complete command to run in the process repository instead of completing anything. The process repository's phax.json is the nearest one walking up from the plan's directory, and phax reads only its "code" key. A plan runs loose, as before, when it sits anywhere else outside this repository, or when that phax.json is absent, has no "code" key, or has a code.root that resolves to another repository, whatever else the file holds. The run refuses with exit 2 when phax cannot tell whether a plan under that repository's docs/plans/ is linked (its phax.json is not a JSON object, or "code" has no "root" string), and when the link names this repository but is unusable: its "code" key does not decode, or code.root is not written canonically, is not exactly this repository's top level, or is not ignored or still tracked by the process repository.

Side effects: creates worktrees, commits files, writes to ~/.phax/runs/.

Arguments

[short-name]

Run short name, e.g. usage-cli

Flags

--plan <path>

Path to the plan.md file to extract from

--allow-dirty

Allow starting when the working tree is dirty

--provider-priority <list>

Comma-separated provider priority override (e.g. mistral-vibe,claude-code)

--dry-run

Preview only — extracts the plan but performs no run actions

--security <mode>

Security mode override (secure|unsafe|isolated, overrides config default)

--refresh

Re-extract the plan even if a cached extraction exists

--allow-skill-edits

Allow phases to edit the .claude/skills files the plan declares

--hold [selection]

Stop for review once these headless phases commit: no value for every phase but the final one, acceptance, or phase ids such as phase-02,phase-04

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax run --plan plan.md
phax run my-feature --plan plan.md
phax run --plan plan.md --dry-run
phax run --plan plan.md --refresh

phax review-handoff

  • Usage: phax review-handoff [--allow-partial] [--json] <short-name>

Regenerate review-handoff.md and global file reconciliation for a review_open run

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--allow-partial

Generate a partial document when some phase artifacts are missing

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax publish-pr

  • Usage: phax publish-pr [--json] <short-name>

Pushes the final worktree branch to the GitHub remote and creates a pull request, or reuses an existing PR for the same branch. Requires a GitHub remote and gh CLI authentication.

Side effects: git push to remote, GitHub API call to create or update a pull request.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax publish-pr usage-cli

phax review-compliance

  • Usage: phax review-compliance [--json] <short-name>

Runs a plan-compliance review by invoking the AI agent with the run's handoff artifacts and the original plan. The agent session is read-only and writes no file. On Claude Code its shell is limited to the read-only git prefixes (log, diff, show, status, ls-files, blame), which run with your user's rights, without an OS sandbox; on Mistral Vibe, bash is prefix-allowlisted to the same commands, without an OS sandbox; on Codex, the read-only OS sandbox blocks writes and the network but lets any reading command run. It answers a structured verdict with its final message, per phase, with two ledgers (unplanned changes and unmet promises). phax writes compliance-review.json (the answer as given) and compliance-review.md (rendered from it) in the run folder; when records are enabled, it also commits the review entry to the records of the run's own project, even when the run belongs to another project.

A refused answer, one that does not match the schema or does not name every phase of the run exactly once, is asked once more in the same session (its transcript is compliance-review-retry.session.jsonl). A review refused twice, or whose session fails, writes neither file nor a records entry, leaves an earlier review as it was, and exits 1 (14 when the provider was unreachable: a network failure), naming the retry command.

Side effects: spawns a short-lived, read-only AI agent session (network I/O); writes compliance-review.json and compliance-review.md in the run folder; when records are enabled, commits the review entry to phax/records/v1, and pushes it when records.autoPush is on.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax review-compliance usage-cli

phax review-code

  • Usage: phax review-code [FLAGS] <short-name>

Opens an interactive, pre-prompted code-review session for a review_open run by launching the AI agent in the run's worktree with the code-review prompt. The prompt carries the phax-review skill: the project's copy at .claude/skills/phax-review/SKILL.md in the run's worktree when it has one, else the bundled skill. The session is resumable: re-running resumes the existing session, while --new-session starts fresh. The developer takes over the session to investigate, discuss, and apply fixes.

--headless runs the review without a person, whether or not review.code.enabled is set, in a read-only session: its reading tools and read-only git (log, diff, show, status, ls-files, blame). The session answers with its final message; a session that changed the worktree has its changes put back and its answer refused. A refused answer, an empty one included, is asked once more in the same session (its transcript is code-review-retry.session.jsonl) before the review fails naming both refusals; a session that changed the worktree is never resumed. An accepted answer writes code-review.json and code-review-session.json in the run folder; when records are on, it commits the code-review entry, and pushes it when records.autoPush is on. It prints the finding count and how to resume the session to fix them (phax review-code <run> on Claude Code, the provider's own resume otherwise), and exits 1 naming the reason and the retry command when the review fails (14 when the provider was unreachable: a network failure), leaving code-review.json and code-review-session.json as they were. It never touches a pull request. A later phax review-code <run> resumes that session on the provider that ran it. --new-session after a headless review starts a new interactive session that becomes the recorded review session and detaches it from code-review.json, which is left as it is.

Side effects: writes a code-review prompt file under the worktree's .phax-context/ and a session record under the run directory; spawns a long-lived interactive AI agent session (network I/O). With --headless: spawns a short-lived AI agent session (network I/O), writes code-review.json and code-review-session.json in the run folder, and may commit a code-review entry to phax/records/v1.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--new-session

Start a fresh review session instead of resuming the existing one

--model <model>

Override the model, including on resume (default: review.code.model, else claude-opus-5-5)

--effort <effort>

Override the effort (low | medium | high), including on resume (default: review.code.effort, else high)

--headless

Run the code review without a person: write code-review.json and record the session for review-code to resume; runs whether or not review.code.enabled is set

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax review-code usage-cli
phax review-code usage-cli --headless

phax finding

  • Usage: phax finding <SUBCOMMAND>

Read the findings of a run's reviews and their fates

phax finding list

  • Usage: phax finding list [--json] <short-name>

Lists every finding of a run's code and compliance reviews: its id (F<n> for a code-review finding, C<n> for a compliance finding, numbered across the run's reviews), severity, location, message and fate. A fate is open (no fate record), fixed, dismissed, deferred, or unrecorded (the review was persisted before finding ids existed, so its ids were given by position). Earlier reviews are read from the run's records on the phax/records/v1 branch, then the unrecorded reviews kept in the run folder (<kind>.unrecorded-<NN>.json, kept when a review whose record write failed is replaced), then the run folder's own file when it differs from the newest record (its record write failed, or records were off), so a re-review drops no finding; with records off only the run folder is read, and a note on stderr says so. A fate other than open or unrecorded comes from the finding's latest fate record on phax/records/v1; the text shows a fixed finding's commits, a dismissed finding's reason and a deferred finding's pointer. A fixed finding's latest fix is looked for on the base branch (publish.baseBranch, else main; the remote-tracking branch when there is no local one), then on the run's branch: by its recorded commit, then by its Finding-Run and Finding trailers, then by its patch id, among commits made since the run started. Nothing is written or fetched. The text shows where it landed after the latest fix's commit when it is not the recorded commit on the base branch (→ <sha> on <branch>, by key, by patch id or by recorded sha; → ambiguous on <branch>; → not found on <branches>), and --json shows it as the finding's landed (null unless fixed). When git cannot read the records branch, the run folder alone is read, the answer says records unavailable, and a note on stderr says why. An archived run is read from its archive folder; a note on stderr says when that folder is gone. With --json it prints the finding-list document: a $schema, the run with the base branch it searched, whether its records were read, and the findings, F before C, each by number. Reads local files and git only; it never calls GitHub. Exits 1 for a run that cannot be resolved, a review document or fate record that cannot be read, a file failure, or a git failure while looking for a fix, and 2 for an invalid configuration.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax finding list gate-retry
phax finding list gate-retry --json

phax finding fix

  • Usage: phax finding fix [FLAGS] <short-name> [operand]…

Commits exactly the paths named after -- in the run's final worktree, while the run is open for review (review_open), and records each named finding as fixed on the phax/records/v1 branch. Other staged or unstaged changes stay where they are. The commit's subject is fix(review): <ids> of <short-name>, or -m; --body adds a paragraph. Its last paragraph holds phax's trailers: Short-Name: <short-name>, then Finding-Run: <run id>, then one Finding: <id> per id, in the order named, and never a Run-Id. Each record holds the commit, its path classes (code, docs, gate-config or tests, from the paths the commit changed) and who fixed it: --by operator, or no --by from a terminal, names the operator as git commits; --by machine:<grant> declares a machine. Without a terminal and without --by the call is refused. The ids come first (F2 F5), every operand from the first one not spelled like an id is a path, relative to the current directory when it is inside the worktree and to the worktree's root otherwise; a path spelled like an id must follow another path or be written ./F2. A named directory commits every change under it.

--commit <sha> records an existing commit and makes none: it takes no path, -m or --body. A commit on the run's final-phase branch or on the base branch (publish.baseBranch, else main) is recorded as named. A commit on neither branch, or one the repository no longer holds (named by 4 to 40 hex characters), is followed on the base branch, over its commits since the run started: first by the named findings' Finding-Run and Finding trailers, then by the named commit's patch id. It is recorded when one commit carries them all, and the output names both the named commit and the recorded one; otherwise, when no commit, several commits, or a different commit per finding are found, the call is refused, naming the candidates. A rewrite only on the run's branch is not followed. It works on a run that is no longer open for review and on an archived run, and is the retry when a record failed after the commit landed. Every refusal comes before anything is written: no id, no path, an unchanged path, a path outside the worktree, an id the run does not have, a run not open for review, records off, a records clone that is missing, an unknown commit, and a commit followed to none, several or different commits. A record that fails after the commit landed keeps the commit, exits 1, names the ids not recorded and the --commit retry, and pushes and posts nothing. When publication.json in the run folder names a pull request (the one phax publish-pr opened, or found on the run branch and recorded) and publish.auto is on, the command then pushes the run's branch to publish.remote (never forced; not with publish.pushBranch off, and not for an archived run) and posts one comment per finding on the pull request, naming the commit. Before that it asks GitHub the pull request's state: a merged or closed pull request gets no push and no comment, since the commit is not in its base branch; the commit and the fates stay, a line says so, and the command exits 0. With publish.auto off, or no pull request yet, nothing leaves the machine. A state query, a push or a comment that fails keeps the commit and the fates, exits 1 and names the phax finding post retry; a refused push also says to bring the remote's commits in with git pull --no-rebase. The records branch is never pushed. With --json it prints { run, commit, recorded, findings, pullRequest }: the named findings as phax finding list reads them after the write, and pullRequest either { kind: not-posted, reason } or { kind: posted, url, pushed, comments }; commit.followed is { named, notOn, matches, branch } when --commit was followed (notOn null when the repository does not hold the named commit; matches says, per named finding, whether it was found by key or by patch id), and null otherwise. Exits 1 for a refusal, a git or file failure, a fate not recorded and a pull request not updated, and 2 for an invalid configuration.

Arguments

<short-name>

Run short name, e.g. usage-cli

[operand]…

Finding ids (F2, C1), then — after -- — the paths to commit

Flags

--by <arbiter>

operator or machine:<grant>; required without a terminal

--commit <sha>

Record this existing commit instead of making one

-m --message <subject>

The commit's subject, instead of the default

--body <text>

A body paragraph for the commit, before phax's trailers

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax finding fix gate-retry F2 -- tests/gate.test.ts
phax finding fix gate-retry F2 F5 -m "fix(gate): keep the exit code" -- src/app/gate.ts
phax finding fix gate-retry F3 --commit 9f8e7d6 --by operator

phax finding dismiss

  • Usage: phax finding dismiss <FLAGS> <short-name> [id]…

Records each named finding as dismissed on the phax/records/v1 branch, with --why as the reason: a decided verdict that chooses dismiss and abandons fix and defer, whose case for fixing is the finding's suggestion (a code-review finding) or its message (a compliance finding). One record per id, in the order named. Only an operator may do this: --by operator, or no --by from a terminal, names the operator as git commits; --by machine:<grant> is refused, and without a terminal and without --by the call is refused. It runs on any run whose records exist, an archived run and an unrecorded finding included. A later fate record supersedes it. Every refusal comes before anything is written. A record that fails names the ids not recorded; running the same command again records them. When publication.json in the run folder names a pull request (the one phax publish-pr opened, or found on the run branch and recorded) and publish.auto is on, it then posts one comment per finding on the pull request, with the reason or the pointer; it pushes nothing. With publish.auto off, or no pull request yet, nothing leaves the machine. A comment that fails keeps the fates, exits 1 and names the phax finding post retry. The records branch is never pushed. With --json it prints { run, commit, recorded, findings, pullRequest }, commit being null and pullRequest either { kind: not-posted, reason } or { kind: posted, url, pushed, comments }. Exits 1 for a refusal, a git or file failure, a fate not recorded and a pull request not updated, and 2 for an invalid configuration.

Arguments

<short-name>

Run short name, e.g. usage-cli

[id]…

Finding ids (F2, C1)

Flags

--why <reason>

Why the finding is settled this way

--by <arbiter>

operator; required without a terminal

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax finding dismiss gate-retry F3 --why "the second check guards --resume"

phax finding defer

  • Usage: phax finding defer <FLAGS> <short-name> [id]…

Records each named finding as deferred on the phax/records/v1 branch, to the tracked file --to names (a brief, a spec, NEXT_STEPS.md), with --why as the reason. The path is read relative to the current directory within its checkout, must be a file tracked at HEAD, and is recorded relative to the repository root. One record per id, in the order named. Only an operator may do this: --by operator, or no --by from a terminal, names the operator as git commits; --by machine:<grant> is refused, and without a terminal and without --by the call is refused. It runs on any run whose records exist, an archived run and an unrecorded finding included. A later fate record supersedes it. Every refusal comes before anything is written. A record that fails names the ids not recorded; running the same command again records them. When publication.json in the run folder names a pull request (the one phax publish-pr opened, or found on the run branch and recorded) and publish.auto is on, it then posts one comment per finding on the pull request, with the reason or the pointer; it pushes nothing. With publish.auto off, or no pull request yet, nothing leaves the machine. A comment that fails keeps the fates, exits 1 and names the phax finding post retry. The records branch is never pushed. With --json it prints { run, commit, recorded, findings, pullRequest }, commit being null and pullRequest either { kind: not-posted, reason } or { kind: posted, url, pushed, comments }. Exits 1 for a refusal, a git or file failure, a fate not recorded and a pull request not updated, and 2 for an invalid configuration.

Arguments

<short-name>

Run short name, e.g. usage-cli

[id]…

Finding ids (F2, C1)

Flags

--to <path>

The tracked file that takes the finding over

--why <reason>

Why the finding is settled this way

--by <arbiter>

operator; required without a terminal

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax finding defer gate-retry F5 --to docs/briefs/gate-retry-docs.md --why "docs pass after the gate rework"

phax finding post

  • Usage: phax finding post [--json] <short-name> [id]…

Posts, on the run's pull request, one comment per named finding of an already settled fate, in the order named: the finding's id, fate, location and message, then the commit that fixed it (with the branch it was found on, when found) and its fate key (the run id and the finding id), the reason it was dismissed, or the file that takes it over. A call naming a fixed finding first asks GitHub the pull request's state. Open, phax first pushes the run's branch to publish.remote from the run's final worktree, so the commit the comment names is visible on the pull request; with publish.pushBranch off it pushes nothing. Merged, phax pushes nothing and posts when every named fixed finding's fix is found on the base branch (publish.baseBranch, else main), and otherwise refuses, naming each such finding, where its fix was looked for, and the phax finding fix <run> <id> --commit <sha> retry that records the commit carrying the fix. Closed, the call is refused, pushing and posting nothing. Name only the dismissed and deferred findings to post theirs, which reach a merged or closed pull request too. It writes no record, so it never records a fate twice, and it ignores publish.auto: it is an explicit request to post. It is the retry that phax finding fix, dismiss and defer name when they could not update the pull request. The pull request is the one publication.json in the run folder names: the one phax publish-pr opened, or found on the run branch and recorded, a pull request opened by hand included. A run whose publication.json names none has nothing to post. Every refusal comes before any push or comment: an id the run does not have, a finding that is open or unrecorded (it has no fate to post), a run without a pull request, a fixed finding on a closed pull request, and a fixed finding whose fix is not found on the base branch of a merged pull request. A state query, a push or a comment that fails exits 1, names the ids left and the phax finding post retry; a refused push also says to bring the remote's commits in with git pull --no-rebase. With --json it prints { run, pullRequest, pullRequestState, findings }, pullRequest being { url, pushed, comments } and pullRequestState open, merged, or null when no fixed finding was named. Exits 1 for a refusal, a git, gh or file failure and a pull request not updated, and 2 for an invalid configuration.

Arguments

<short-name>

Run short name, e.g. usage-cli

[id]…

Finding ids (F2, C1)

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax finding post gate-retry F2
phax finding post gate-retry F3 F5

phax adjust-plan

  • Usage: phax adjust-plan <FLAGS> <plan>

Opens an interactive, pre-prompted session to help you adjust a plan.md after a landed run has introduced drift. The session establishes which of the plan's declared files, line references, and decisions are invalidated by the landed run's actual changes, asks clarifying questions where needed, proposes concrete edits and waits for your explicit approval, and only then edits and commits the plan — all interactively within the session. The command itself mutates nothing.

Input: the path to the plan.md to adjust and --landed <run> (the run whose actual changes drive the adjustment). The landed run must have a global-file-reconciliation.json (i.e. it must have reached review); a run in awaiting_review is refused until it lands. Re-invocation without --new-session resumes the same session; --new-session starts a fresh one.

Side effects: spawns a long-lived interactive provider session (network I/O); the session may, after developer approval, edit and commit the plan.md.

Arguments

<plan>

Path to the plan.md to adjust

Flags

--landed <run>

The landed run whose actual changes drive the adjustment

--new-session

Start a fresh adjustment session instead of resuming

--model <model>

Override the model (default: claude-opus-5-5)

--effort <effort>

Override the effort (low | medium | high)

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax adjust-plan docs/plans/2609101030-plan-prune-plan.md --landed my-feature

phax brief

  • Usage: phax brief [--json] [path]…

Asks the brief provider configured as "brief": { "command": …, "push": … } in phax.json, phax.local.json or ~/.phax/config.json which rules cover the given paths, what fails there and how to fix it. Paths resolve against the current directory, may not exist yet, and must lie inside the working tree; they are sent relative to its root, deduplicated, in the order given. Config is read from the repository's main checkout; the provider runs from the working tree's root, with no shell, one brief request on stdin, and a fixed 60-second limit.

Inside a phase worktree, the request is $schema, the phase facts copied from .phax-context/brief-request.json (phase, base, terminal, phases), then files: the paths, or null with no path, which asks for the phase's brief (its planned files). Outside a phase, the request is $schema and files only, and at least one path is required.

The provider prints a brief report on stdout: {"$schema": ".../brief-report/<release>.json", "rules": [{ rule, files, guide }], "findings": [{ id, rule, location, message, related, guide, due }]}. The report must carry its own $schema naming brief-report at a release this phax reads. A location is { file, lines }, with lines [start, end] or null; a guide is { summary, read } or null; due is this-phase, later or null. The provider's order is its rank, a key the format does not name is refused, and empty rules and findings lists mean nothing to report. phax checks nothing in the report beyond its shape: a brief informs and never blocks.

Prints the whole report, every rule with its files and guide, then every finding with its location, due, rule, message, related locations and guide, in the provider's order, and exits 0 on any readable report. Exits 1 otherwise: the provider fails, exits non-zero, prints invalid JSON or outruns the limit; the report is refused at $schema or by shape; no brief provider is configured; .phax-context/brief-request.json is not a phase's brief request; no path outside a phase; a path outside the working tree; or no git working tree at all. An invalid config exits 2.

Side effects: runs the brief provider. Inside a phase whose briefs are not yet collected, each pull is recorded as .phax-context/briefs/brief-NN.json, numbered from 01 in call order; outside a phase nothing is written.

Arguments

[path]…

Paths to brief, existing or not, relative to the current directory

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax brief src/core/billing/invoice.ts src/core/billing/tax.ts
phax brief

phax architecture

  • Usage: phax architecture [--json] [path]…

Asks the architecture provider configured as "architecture": { "command": … } in phax.json, phax.local.json or ~/.phax/config.json for the repository's architecture, and prints its report: the Markdown body, then the report's parts rendered to Markdown, then the owner's assignment bounds (phax.json "assignments") as a "## Bounds" list, each as assignments[N] with its model and effort range; a part bound shows its part's name and globs, and a path-scoped report that does not carry the part says to run the command with no path for its globs. With no path, it asks about the whole repository; with paths, about the parts that hold them. Paths resolve against the current directory, may not exist yet, and must lie inside the working tree. Config is read from the repository's main checkout; the provider runs from the working tree's root, with no shell, one architecture request on stdin, and a fixed 60-second limit.

The request is {"$schema": ".../architecture-request/<release>.json", "files"}: files is null with no path (the whole repository), otherwise the paths relative to the working tree's root, deduplicated, in the order given, never checked for existence.

The provider prints an architecture report on stdout: {"$schema": ".../architecture-report/<release>.json", "body", "parts"}. The report must carry its own $schema naming architecture-report at a release this phax reads, and body is non-empty Markdown for the agent to read. parts is a list, possibly empty, of {"id", "name", "description", "globs"}: id is a kebab-case slug unique within the report, name and description are non-empty text, and globs is a non-empty list of working-tree-root-relative POSIX globs matched case-sensitively, where only ** (a whole segment), * and ? are special; a leading slash, a backslash, braces, an empty, . or .. segment and ** inside a segment are refused. A key the format does not name is refused, and no model or effort appears anywhere. phax prints the body as is, never parsing it, then a "## Parts" section with each part's name, id, description and globs in the report's order. A provider that declines exits non-zero.

Exits 0 on a readable report. Exits 1 with one line on stdout, telling the agent to read the architecture from the code and its documentation, when no architecture provider is configured; when bounds are declared, that line is followed by the bounds, part bounds marked unresolved, and the exit is still 1. Exits 1 with one line on stderr when the provider fails, exits non-zero, prints invalid JSON or outruns the limit; the report is refused at $schema or by shape (a missing parts, a repeated part id, an unknown key, an empty or refused glob); a path lies outside the working tree; or there is no git working tree at all. An invalid config exits 2.

Side effects: runs the architecture provider. Writes no file, inside a phase worktree or outside one.

Arguments

[path]…

Paths to ask about, existing or not, relative to the current directory

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax architecture
phax architecture src/core/billing/totals.ts

phax init

  • Usage: phax init [FLAGS]

Creates phax.json and phax.schema.json in the current directory. Use --force to overwrite an existing phax.json. Does not connect to any network or external service.

Flags

--force

Overwrite and reconfigure an existing phax.json

--yes

Accept detected defaults without prompting

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax init
phax init --force

phax report

  • Usage: phax report [--no-gist] [--json] [short-name]

Creates a GitHub issue from local run telemetry. By default, uploads the full log as a secret GitHub gist and links it in the issue body. Use --no-gist to inline the log directly.

Side effects: GitHub API calls — creates a GitHub issue and, unless --no-gist is set, a secret gist.

Arguments

[short-name]

Run short name, e.g. usage-cli

Flags

--no-gist

Inline the full log in the issue body instead of creating a secret gist

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax report
phax report usage-cli
phax report usage-cli --no-gist

phax completions

  • Usage: phax completions [--json] <shell>

Generate a shell completion script (zsh, bash, fish, nu, powershell). Requires the usage CLI.

Arguments

<shell>

Shell to generate completions for (zsh, bash, fish, nu, powershell)

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax resume

  • Usage: phax resume [FLAGS] <short-name>

Picks up a run from its next pending phase, re-entering the same execution loop as phax run. Without --yes it prints where it would resume and exits 0, asking nothing; --yes proceeds.

A committed phase whose handoff turn was cut short (a rate or usage limit) gets its handoff written first: resume runs that phase's handoff turn again, in its session and its worktree, then goes on. When that worktree is gone, or its session id, resume refuses with exit 1 and nothing changes; the message names the remedy: restore the worktree with git worktree prune then git worktree add <recorded worktree path> <phase branch> (git keeps a deleted worktree registered until it is pruned), or write <run folder>/<phase>/phase-handoff.md with its four sections by hand, then resume again. After a handoff written by hand, resume finishes that phase with no agent turn: it collects its pulled briefs, writes its record and runs its cleanup, then goes on; when its worktree is gone too, the cleanup commands do not run (a warning names them: run them yourself if they free resources outside the worktree) and the phase is still cleaned up. The final message counts every phase of the run that committed, across resumes.

A run whose phax-plan.json was written by an older phax, in an older shape, is refused with exit 2: finish it with the phax release that started it, or archive it with phax archive <run> --force and run its plan again.

The same preflight as phax run applies: a phase that departs from the owner's assignment bounds without an Assignment reason: line, or an invalid bound, refuses with exit 11 ("Assignment preflight failed"), and so does every error of the plan's acceptance phases: a malformed declaration, a broken pair, or an acceptance phase with no "acceptance" provider configured ("Acceptance preflight failed"). The preflight re-checks the current configuration, so a run whose "acceptance" block was removed since it started is refused too.

A passing phase whose acceptance phase was skipped (it produced no changes, so it noted no commit) is refused before its agent runs, with exit 11: there are no acceptance tests to pass, and the run fails.

--skip-acceptance applies only to the phase this resume restarts at, and only in this invocation. That phase's configured gate steps run and must pass, with the usual fix loop; its acceptance step does not run, and is recorded as skipped in its gate-attribution, so acceptance is then not among that phase's verified surfaces, nor the run's. At a phase that is neither an acceptance phase nor a passing phase, it is refused with exit 1 and nothing changes. On a run in awaiting_review it is refused with exit 1 too: at a stop in an acceptance pair because a close's authored step is never skipped (undo the acceptance-test-file correction or phax reset-phase the stop), and at a stop in no pair because that phase has no acceptance step. A committed acceptance phase is never reset, so a wrong acceptance test is corrected in the stopped phase (phax enter-phase <run> <phase>) and closed this way.

A run in awaiting_review (stopped at a declared interactive phase or a held one, exit 13) is closed by resume, which re-checks the preflight and then runs the gate first: a red gate returns the phase to the person (exit 4) and the run stays in awaiting_review. The handoff is the person's .phax-context/correction-handoff.md when it exists (four sections, checked before anything runs), otherwise the handoff a read-only closing turn writes from the diff of the corrections; a closing turn that edits the worktree exits 5, its edits set aside in the phase's refused-turn-NN/ folder and the worktree put back to the gated tree, and so does an answer still invalid after one corrective resume; a closing turn that could not reach the provider (a network failure) exits 14, its message recorded in review-stop.json, and the run stays in awaiting_review. At a declared stop phax then commits exactly the gated tree with an Interactive-Phase: trailer (an empty commit when nothing changed). At a held stop it leaves one review commit with a Held-Phase: trailer on top of the unchanged phase commit, or no commit when nothing changed, then writes the phase's record once, naming the phase commit. Either way it runs the cleanup and continues with the next phase in the same invocation, whose prompt carries the correction under ## Review corrections. A hold or a close interrupted before its cleanup is finished by the next resume: a held phase that committed but did not stop stops then, with no agent turn, and a close that landed its state but not its cleanup runs the cleanup (and writes the held phase's record, once). A close that changes an acceptance test file of the pair it sits in runs the acceptance provider's authored verdict as the last step of its gate, naming the stopped phase and judging the acceptance test files in the worktree's gated tree, before the close commits (the passing phase later judges the pair's latest commit that passed authored); a held passing phase is closed on its configured steps only and warns about each acceptance test file its corrections changed. A close reads the closer's identity from the main checkout's git configuration first (user.name and user.email); an unset identity refuses the close with exit 1 and the run stays in awaiting_review. It then copies the transcript of each recorded session (the builder, the first turns that answered and every --new-session session) into <run>/<phase>/interactive-transcripts/<session id>.jsonl, mode 0600, or records it as missing with a reason; a transcript never enters a commit or a record. It records the closer in the stop and writes the phase's record once, for a declared phase as well as a held one, naming the mode, cause, outcome, closer and sessions with their transcript digests; a record destination that refuses it pauses the run for a resume. A close also sets the stop section of the phase's security.json.

A refused close puts the run back in awaiting_review with the reason in review-stop.json; an interrupt during a close does the same.

Side effects: creates worktrees, commits files, writes to ~/.phax/runs/.

Arguments

<short-name>

Run short name, e.g. usage-cli

Flags

-y --yes

Proceed without confirmation

--provider-priority <list>

Comma-separated provider priority override (e.g. mistral-vibe,claude-code)

--skip-acceptance

Skip the acceptance step of the phase this resume restarts at; its configured gate still runs

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax resume usage-cli
phax resume usage-cli --yes
phax resume refunds --yes --skip-acceptance

phax reset-phase

  • Usage: phax reset-phase [-y --yes] [--json] <short-name> [phase-id]

Resets a stuck or failed phase: its folder is archived, its worktree and branch are removed, and the run becomes resumable so phax resume starts the phase over. Without --yes it first previews what the reset would discard.

A run in awaiting_review (stopped at a declared interactive phase or a held one) can reset only the stopped phase: the preview lists the uncommitted corrections in its worktree and the person's .phax-context/correction-handoff.md when it exists, the reset discards review-stop.json, and phax resume then runs the phase again from the start, first turn included. At a held stop the preview names the phase commit it discards, and the phase is held again when it commits. A phase of an acceptance pair whose closed stop ran the authored step is not reset once the pair's passing phase has started, like the acceptance phase itself: the passing phase judges the pair's latest authored commit. An earlier phase is committed work the stop sits on, and a later one has not started, so both are refused.

The reset takes the run lock: while a run, a resume or an enter-phase --new-session turn holds it, the reset is refused with exit 7 and nothing changes.

Arguments

<short-name>

Run short name, e.g. usage-cli

[phase-id]

Phase identifier to reset, e.g. phase-02; defaults to the stuck phase

Flags

-y --yes

Proceed without confirmation (removes the worktree and branch)

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax reset-phase usage-cli
phax reset-phase usage-cli phase-02 --yes

phax agent

  • Usage: phax agent <SUBCOMMAND>

Inspect and manage model routing and provider configuration

phax agent models

  • Usage: phax agent models [--json]

Print the routing table and provider priority

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax agent resolve

  • Usage: phax agent resolve <FLAGS>

Show how a model+effort request resolves to a provider and concrete model

Flags

--model <id>

Requested model id (e.g. claude-sonnet-4-6)

--effort <level>

Effort/thinking level (none|off|low|medium|high|xhigh|max|ultracode|ultra)

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax agent probe

  • Usage: phax agent probe [--json]

Check which provider executables are available on PATH; never throws on an unavailable provider

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax agent setup

  • Usage: phax agent setup <SUBCOMMAND>

Set up provider integrations

phax agent setup providers

  • Usage: phax agent setup providers [FLAGS]

Write providers.json in the phax home from live executable probes; a first write enables the installed providers, an existing file keeps its flags (dry-run by default)

Flags

--write

Persist the reconciled config (writes a timestamped backup first)

--prune

Also disable providers whose executable is unavailable

--with-routing

Scaffold model-routing.json in the phax home from defaults when absent (never overwrites)

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax security

  • Usage: phax security <SUBCOMMAND>

Security-related commands

phax security status

  • Usage: phax security status [--json]

Show provider security capabilities and availability

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax skills

  • Usage: phax skills <SUBCOMMAND>

Manage PHAX skills

phax skills install

  • Usage: phax skills install <FLAGS> [skill]

Install bundled PHAX skills into an agent's native skill directory

Arguments

[skill]

Skill to install (phax-planning|phax-cli|phax-spec|phax-review|phax-decide-spec|phax-decide-plan|phax-decide-review); installs all skills when omitted

Flags

--target <target>

Agent target (claude|codex|agent)

--scope <scope>

Installation scope (project|user)

Default: project

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax schema

  • Usage: phax schema <SUBCOMMAND>

Manage the local phax.schema.json

phax schema upgrade

  • Usage: phax schema upgrade [--json]

Regenerate phax.schema.json from the installed binary's config contract; never modifies phax.json

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax artifact

  • Usage: phax artifact <SUBCOMMAND>

Parent command for inspecting and transitioning the lifecycle status of a spec (docs/specs/) or plan (docs/plans/). Specs carry Draft, Approved, Abandoned, or Completed; plans additionally carry Stale. Transitioning to a terminal status (Abandoned, Completed) moves the file into the artifact's archive/ subdirectory as part of the transition. A headless-authored artifact's JSON document sidecar (<name>.json beside the .md) travels with it: every transition's write-set includes it, and a terminal transition moves it into archive/ alongside the .md. Illegal transitions and validation failures (missing frontmatter block, unknown status, status/location disagreement) refuse with exit code 12.

Examples

phax artifact status docs/plans/2607101056-typescript-7-migration-plan.md

phax artifact status

  • Usage: phax artifact status [--json] <path>

Reports an artifact's kind (spec or plan), current status, and the legal transitions from that status (an Approved spec or plan lists Draft, reached with phax artifact reopen). For an approved spec or plan, also reports the approval date and baseline, its approver (by machine (<grant>), by operator (<name>), or unattributed for an approval recorded before phax named the approver), and whether the artifact has been edited since that approval (recorded) or has no approval record (unrecorded). Also reports how the artifact was authored: interactive (no sidecar), or headless with its JSON document sidecar and whether the body is still the sidecar's rendering (in sync), differs from it (diverged — the body was edited by hand), or the sidecar is not a valid document (invalid). Frontmatter changes never count as divergence. A sidecar stamped below its document format's current shape, or written before $schema, is not compared: status names its stamped shape and phax artifact migrate-documents instead.

An artifact with question sections also prints a Questions line: the number of questions, the open ones with their ids, and the arbitrated ones with how many are lifted (Questions: 4 — open 2 (Q3, Q4) · arbitrated 2 (1 lifted)). A headless artifact's questions come from its sidecar, lifted when it is older; a valid spec sidecar always prints the line, a plan's only when it has questions. A hand-authored artifact's come from its ## 9. Open questions and ## 9b. Arbitrated questions sections (a plan's ## Open questions and ## Arbitrated questions); one that departs from the §9 format prints the first departing line instead, and status still exits 0. Read-only — no side effects.

Arguments

<path>

Path to a spec or plan file under docs/specs/ or docs/plans/

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact status docs/plans/2607101056-typescript-7-migration-plan.md
phax artifact status docs/specs/2609030749-spec-approval-ground.md

phax artifact approve

  • Usage: phax artifact approve [--by <arbiter>] [--json] <path>

Transitions an artifact to Approved. Legal from Draft (both kinds) and from Stale (plans only); re-approving an already-Approved artifact re-records the approval, refreshing its timestamp and baseline — this is the correct way to record an in-place revision of a spec, not editing the date by hand. Rewrites the frontmatter status key in place. An Approved artifact goes back to Draft only through phax artifact reopen, which voids the approval.

Every approval names its approver, and the approval record file records it as approvedBy. --by machine:<grant> declares a machine — a loop or a script — by its grant, a kebab-case slug matching ^[a-z0-9]+(-[a-z0-9]+)*$. --by operator, or no --by from a terminal, names the operator as git commits: GIT_COMMITTER_NAME, else the repository's git user.name, never a guessed name. Without a terminal there is no default: approve refuses with exit 12 unless --by is given, naming --by operator and --by machine:<grant>. An operator approval refuses with exit 12 when neither is set, naming git config user.name. A malformed --by or grant refuses with exit 12. Every refusal comes before anything is written. Approval records written before phax named the approver read as unattributed. A plan approval reads one key of the configuration, code in the project's phax.json (the nearest one walking up from the working directory, as every command finds it), and no overlay; a spec approval and every other transition read no configuration. In a project that declares a code link, a plan approval also records the code repository's HEAD as the code baseline, and refuses with exit 2 when that phax.json is not a JSON object, its code key does not decode, or the link's root is missing, is not a repository's top level, or is not ignored or still tracked by this repository.

For specs: stamps approved: { date, baseline } in the frontmatter and writes the spec's approval record file, docs/specs/approvals/<spec file name>.json. For plans: stamps approved: { date, baseline } in the frontmatter and writes the plan's approval record file, docs/plans/approvals/<plan file name>.json. Plan approval refuses with exit 12 if the declared Source-Spec is Approved but its approval is unrecorded or edited since approval — re-approve the spec first. For headless-authored artifacts (either kind): approval refuses with exit 12 when the JSON document sidecar is diverged (the body differs from the sidecar's rendering) or invalid, naming the two remedies — re-author the artifact with --headless, or delete the sidecar to demote the artifact to hand-authored. While any live spec or plan sidecar is stamped below its document format's current shape, approval refuses with exit 12 before anything is written, naming each such sidecar and phax artifact migrate-documents.

Side effects: writes the artifact file and commits the transition's write-set (the artifact file, its JSON document sidecar when headless-authored, plus its own approval record file under docs/plans/approvals/ or docs/specs/approvals/) in a single commit; no transition touches another artifact's record file. Refuses with exit code 12 if any write-set path already has uncommitted changes.

Arguments

<path>

Path to a spec or plan file under docs/specs/ or docs/plans/

Flags

--by <arbiter>

operator or machine:<grant>; required without a terminal

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact approve docs/plans/2607101056-typescript-7-migration-plan.md
phax artifact approve docs/specs/2609030749-spec-approval-ground.md --by operator
phax artifact approve docs/specs/2609030749-spec-approval-ground.md --by machine:roadmap-loop

phax artifact stale

  • Usage: phax artifact stale [--json] <path>

Manually marks a plan Stale. Legal from Approved only — Stale has no automatic trigger (that belongs to a future lineage spec). Rewrites the frontmatter status key in place.

Side effects: writes the plan file and commits the write-set in a single commit; refuses with exit code 12 if the plan file already has uncommitted changes.

Arguments

<path>

Path to a spec or plan file under docs/specs/ or docs/plans/

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact stale docs/plans/2607101056-typescript-7-migration-plan.md

phax artifact abandon

  • Usage: phax artifact abandon [--json] <path>

Abandons an artifact — a terminal status distinct from Completed, for work dropped without execution. Legal from Draft or Approved (specs) or Draft, Approved, or Stale (plans).

Side effects: moves the file into the artifact's archive/ subdirectory with its frontmatter status key rewritten to Abandoned, deletes its approval record file under docs/plans/approvals/ or docs/specs/approvals/ if it has one, and commits the move and the deletion in a single commit; refuses with exit code 12 if any write-set path already has uncommitted changes.

Arguments

<path>

Path to a spec or plan file under docs/specs/ or docs/plans/

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact abandon docs/plans/2607101056-typescript-7-migration-plan.md

phax artifact complete

  • Usage: phax artifact complete [--json] <path>

Completes an artifact — a terminal status for work that ran to completion. Legal from Approved (specs) or Approved or Stale (plans).

Side effects: moves the file into the artifact's archive/ subdirectory with its frontmatter status key rewritten to Completed, deletes its approval record file under docs/plans/approvals/ or docs/specs/approvals/ if it has one, and commits the move and the deletion in a single commit; refuses with exit code 12 if any write-set path already has uncommitted changes.

Arguments

<path>

Path to a spec or plan file under docs/specs/ or docs/plans/

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact complete docs/specs/2608091526-artifact-lifecycle-status.md

phax artifact reopen

  • Usage: phax artifact reopen [--by <arbiter>] [--json] <path>

Reopens an artifact back to Draft, voiding its approval, for when it must be revised before re-approval. Legal from Approved (specs and plans) and from Stale (plans only); a Draft, Completed or Abandoned artifact is refused with exit 12 and nothing is written. Rewrites the frontmatter status key in place and clears the approved stamp.

Every reopen names its arbiter, as approve does. --by machine:<grant> declares a machine by its grant, a kebab-case slug matching ^[a-z0-9]+(-[a-z0-9]+)*$. --by operator, or no --by from a terminal, names the operator as git commits: GIT_COMMITTER_NAME, else the repository's git user.name, never a guessed name. Without a terminal there is no default: reopen refuses with exit 12 unless --by is given, naming --by operator and --by machine:<grant>. An operator reopen refuses with exit 12 when neither is set. While any live spec or plan sidecar is stamped below its document format's current shape, reopen refuses with exit 12, naming each such sidecar and phax artifact migrate-documents. Every refusal comes before anything is written. The reopen commit ends with a Reopened-By: machine (<grant>) or Reopened-By: operator (<name>) trailer.

Reopening a spec leaves every live plan that names it in source-spec unchanged — its file, frontmatter and approval record file — and names each one with its status. Reopen changes only status and approved, which the fingerprint ignores, so a bound plan still reads fresh.

Side effects: writes the artifact file, deletes its approval record file (docs/specs/approvals/<spec file name>.json or docs/plans/approvals/<plan file name>.json) if it has one, and commits them with its JSON document sidecar when headless-authored in a single commit; refuses with exit code 12 if any write-set path already has uncommitted changes.

Arguments

<path>

Path to a spec or plan file under docs/specs/ or docs/plans/

Flags

--by <arbiter>

operator or machine:<grant>; required without a terminal

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact reopen docs/plans/2607101056-typescript-7-migration-plan.md --by operator
phax artifact reopen docs/specs/2609030749-spec-approval-ground.md --by machine:roadmap-loop

phax artifact decide

  • Usage: phax artifact decide [FLAGS] <path>

Decides a Draft spec's or plan's open questions in one of two modes: with the operator in an interactive Claude Code session (the default), or from a verdicts file with --verdicts (below).

In interactive mode the session first raises the framing questions F1–F5, then presents the open questions in document order; --question <id> presents that question alone, an open one or an arbitrated one to re-arbitrate (its previous verdict is kept in its history). The session follows the doctrine skill for the artifact's kind (phax-decide-spec or phax-decide-plan; a project copy under .claude/skills/ replaces the bundled one), with --doctrine <file> appended after it; a verdict may cite only the backticked ids that open list items in that doctrine. It resumes the artifact's headless authoring session when phax kept its id, and starts a new one otherwise, and says which.

Interactive decide runs on Claude Code only: the model is --model and --effort, else claude-opus-5-5 at high; a model outside the Claude Code catalog, or an effort it does not list, is refused. When the operator exits the session, phax resumes it headless for the revised document — the whole sidecar document of a headless artifact, $schema first at its current shape, or its kind's hand decision answer (spec-hand-decision-answer or plan-hand-decision-answer) for a hand-authored one — and asks once more when the answer is refused. phax stamps each verdict with the committing git identity and the time, checks the answer (only presented questions move, others stay as they were, chosen and abandoned name the question's options or the reserved other, cited principles are loaded ids, a departing verdict names what it revised), shows the body diff and the verdicts, and writes nothing unless the operator accepts the diff.

Before any session it refuses, writing nothing: a live sidecar not yet migrated (phax artifact migrate-documents), an artifact that is not Draft (an Approved or Stale one names phax artifact reopen <path>), a diverged or invalid sidecar, a hand-authored §9 that does not parse (naming its first departing line), uncommitted changes on the artifact or its sidecar, an unknown --question (naming the artifact's question ids), no terminal (interactive mode needs one), a model outside Claude Code (interactive mode), a doctrine file that is unreadable, defines no principle id or redefines a skill id, and no committing git identity. With no open question and no --question it says there is nothing to decide and exits 0. Inside a phase worktree the phase guard refuses it.

Exit codes: 0 decided and committed, a declined diff, or nothing to decide; 1 inside a phase worktree; 5 no document, not JSON, an answer not stamped with its current shape, or one refused by the schema or its checks (after the one corrective resume), or a failed agent session, with nothing written; 8 a provider rate or usage limit, with nothing written; 14 the provider unreachable (a network failure), with nothing written; 12 an artifact refusal, the artifact changed during the session (its change left in place), or a failed commit (the files left written but uncommitted).

Verdicts mode: --verdicts <file|-> reads decisions a person has already made, from a file or from a pipe on stdin (-; a terminal on stdin is refused with exit 64), and writes them into the artifact without a prompt. The file is JSON with a $schema naming the decide-verdicts format of this release (phax artifact schema verdicts prints it), an artifact key naming the artifact's repo-relative path, and a non-empty verdicts list of { question, chosen, note }: chosen is one of the question's option ids or the reserved id other, and note is the person's reason, a non-empty string or null. A note is required when the verdict departs from the recommendation, other included; a null note on a question with an empty rationale is refused, since nothing would stand as its why. Every key is required and unknown keys are refused. Questions the file does not name stay open; an arbitrated question it names is re-arbitrated. No terminal is needed with --by operator, which names the operator as git commits; any other --by, machine:<grant> included, is refused (a verdict always comes from the operator), and without --by a terminal is required. One headless writer session, running under the same doctrine, writes the verdicts into the revised document and revises the body where a departing verdict implies it. It runs on the model --model and --effort name, else claude-sonnet-5-5 at medium, routed to a provider like headless authoring (a model with no equivalent on the selected provider runs as the concrete model routing chose, and the report names it beside the requested one); the writer runs read-only on whatever provider routing selects, Mistral Vibe included. It resumes the kept authoring session when that session ran on the same provider in this checkout, and starts a new one otherwise, and says which. phax refuses a bad file before anything runs, with exit 64 and a refused line naming the file and the field: a file that cannot be read, is not a verdicts file of this release, or does not fit the artifact (another artifact's path, an unknown question or option, a question named twice, a missing note). It checks the writer's answer against the file (each question's options first, then the question set, each chosen and abandoned option, the history, the revised sections, the body outside them; a following verdict revises nothing, except one restoring the recommendation after a departing verdict: it names the sections it restores when that verdict named revised sections, none when it named none, and either when it records none) and asks once more when the check fails, then sets each verdict's why (the note, else the question's rationale), by and at itself. It writes and commits without asking, leaves the artifact Draft, and prints the report to read before approving: each verdict (chosen, followed or departed with the sections revised, and why), the questions left open, the body diff, the commit and the Draft status. With --json it prints that report as one indented JSON object on stdout (artifact, status, session, provider, model, requestedModel, effort, verdicts, open, diff, commit, decisionId, then written, the files its commit holds, and record, the decision record's outcome); progress and warnings are note lines on stderr. The commit subject is as in interactive mode, and its body is followed by the trailers Artifact, Decided-By, Decided-Via: verdicts and Decision-Id; the decision record has mode verdicts. --question is refused with --verdicts, and --by without it, exit 12; --json without --verdicts or without --by is refused with exit 64 before anything starts, since the call would wait on a person. The exit codes are 0 decided and committed, 1 inside a phase worktree, 5 a refused answer after the one corrective resume or a failed agent session, 8 a provider limit, 12 a refusal, 14 the provider unreachable (a network failure), 64 a verdicts file refused before anything runs.

Side effects: in interactive mode, spawns an interactive and then a headless Claude Code session, both read-only whatever the security profile (only the Read, Grep and Glob tools, no MCP server), so the session never writes to the repository; keeps the session's prompts, transcripts, answer and diff under the state root's decide/<stamp>-<slug>/<NN>/; on an accepted diff, re-seeds a plan's extraction cache, writes the artifact and its sidecar (or the hand-authored artifact alone) and commits exactly those paths in one commit, with a Decision-Id: <stamp>-<slug>/<NN> trailer. Verdicts mode spawns one headless writer session, read-only like the others, on whatever provider routing selects, Mistral Vibe included, keeps verdicts.json (the file as given) with the prompts, answer and diff in the same folder, and writes and commits the same paths without a prompt.

Arguments

<path>

Path to a spec or plan file under docs/specs/ or docs/plans/

Flags

--question <id>

Present this question alone: an open one, or re-arbitrate one

--by <arbiter>

operator: who gave the verdicts; required without a terminal (with --verdicts)

--doctrine <file>

Append this doctrine file after the decide skill

--model <model>

Override the decide model (interactive: a Claude Code model)

--effort <effort>

Override the decide effort

--verdicts <file|->

Decide from a verdicts file, or - for stdin, without an interactive session

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact decide docs/specs/2609251400-plan-prune.md
phax artifact decide docs/specs/2609251400-plan-prune.md --question Q1
phax artifact decide docs/plans/2609261000-plan-prune-store-plan.md --doctrine docs/doctrine/plan.md --model claude-sonnet-5-5 --effort medium
phax artifact decide docs/specs/2609251400-plan-prune.md --verdicts verdicts.json --by operator
phax artifact decide docs/specs/2609251400-plan-prune.md --verdicts - --by operator --json

phax artifact revise

  • Usage: phax artifact revise [FLAGS] <path>

Revises a Draft spec or plan that was authored headlessly (its JSON sidecar beside the .md, in sync with it) from an amendment: a change request in prose, read from a file or from stdin (-; a terminal on stdin is refused with exit 64, and so is an empty amendment). A hand-authored artifact has no sidecar and is refused: edit it directly.

One headless writer session returns the whole revised document, carrying the amendment wherever it applies and leaving everything else as it is. It resumes the artifact's kept authoring session when that session ran on the writer's provider in this checkout, and starts a new one otherwise (a new session also gets the kind's authoring skill and the kept brief as background), and says which. The model is --model and --effort, else phax.json's authoring.<kind> (which carries the catalog default when phax.json sets none), routed to a provider like headless authoring: a model with no equivalent on the selected provider runs as the concrete model routing chose, and the report names it beside the requested one. The writer runs read-only on whatever provider routing selects, Mistral Vibe included; no model is refused for its provider. The effort is low, medium or high.

phax checks the answer: the document carries its kind's current $schema and decodes, every existing question stays unchanged and in place (an arbitrated question, its verdict and history included, and every open question as it was), and new open questions are only appended, with ids new to the artifact. It asks once more, resuming the same session, when the check fails. The frontmatter is kept byte for byte. When the revised body renders the same as the current one, nothing is written and no commit is made (exit 0, the report says the amendment changed nothing). Otherwise phax writes the .md and its sidecar, re-seeds a plan's extraction cache, and commits both in one commit without asking. The artifact stays Draft: read the body diff, decide every question still open (phax artifact decide; the report's status line names them), then approve. The commit body carries the amendment verbatim, followed by the trailers Artifact, Revised-By and Revision-Id.

--by operator | machine:<grant> names who asked for the revision; without it the operator is assumed when stdin is a terminal, and a call without a terminal needs --by. A committing git identity (user.name) is required in every case, since the revision commits.

Before any session it refuses, writing nothing (exit 12): a live sidecar not yet migrated (phax artifact migrate-documents), an artifact that is not Draft (an Approved or Stale one names phax artifact reopen <path>), a hand-authored, diverged or invalid sidecar, uncommitted changes on the artifact or its sidecar, an unusable --by, no committing git identity, and a model or effort it cannot use.

With --json it prints the report as one indented JSON object on stdout (artifact, status, session, provider, model, requestedModel, effort, newQuestions, openQuestions, the ids of every question open after the revision, diff, commit, revisionId, written, the files its commit holds, and record, the revision record's outcome); progress and warnings are note lines on stderr. commit is null when nothing changed.

Exit codes: 0 revised and committed, or nothing changed; 1 inside a phase worktree, where the phase guard refuses it; 5 no document, not JSON, an answer not stamped with its current shape, or one refused by the schema or its checks (after the one corrective resume), or a failed agent session, with nothing written; 8 a provider rate or usage limit, with nothing written; 12 a refusal, the artifact changed during the session (its change left in place), or a failed commit (the files left written but uncommitted); 14 the provider unreachable (a network failure), with nothing written; 64 an amendment that cannot be read or is empty, or a terminal on stdin for -, before anything runs.

Side effects: spawns one headless writer session, read-only whatever the security profile; keeps the amendment, prompts, answer, body diff and transcripts under the state root's revise/<authoringId>/<NN>/; on a change, writes the artifact and its sidecar and commits exactly those paths in one commit with a Revision-Id: <authoringId>/<NN> trailer. When records are configured, every writer session that ran — committed, unchanged or failed — writes one revision record (key revision/<authoringId>/<NN>) on phax/records/v1, and phax records explain <commit> resolves the commit to it.

Arguments

<path>

Path to a Draft spec or plan under docs/specs/ or docs/plans/

Flags

--by <requester>

operator, or machine:<grant>: who asked for the revision; without it the operator when stdin is a terminal

--model <model>

Override the writer model (else authoring.<kind>)

--effort <effort>

Override the writer effort: low, medium or high

--amendment <file|->

Path to an amendment file, or - to read the amendment from stdin

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact revise docs/plans/2610271402-identity-store-plan.md --amendment amendment.md --by machine:plan-loop
phax artifact revise docs/specs/2610271505-artifact-revise.md --amendment - --by operator --json

phax artifact new

  • Usage: phax artifact new <SUBCOMMAND>

Parent command for creating a Draft spec or plan named from the current UTC minute: <YYMMDDHHMM>-<slug>.md for a spec, <YYMMDDHHMM>-<slug>-plan.md for a plan. The instant is captured when the command runs, never chosen or backdated. A bad slug, an existing target name, or (for a plan) a --spec that is missing or not a spec, a --spec without exactly one of --last/--not-last, or either flag without --spec all refuse with exit code 12 before anything is written.

Examples

phax artifact new spec plan-prune

phax artifact new spec

  • Usage: phax artifact new spec [FLAGS] <slug>

Creates a Draft spec at docs/specs/<YYMMDDHHMM>-<slug>.md, with a frontmatter-only skeleton (status, date, audience, scope). The slug must match [a-z0-9]+(-[a-z0-9]+)*.

Side effects: writes the new spec file. Does not commit — transition commands (phax artifact approve) commit, creation does not.

Pass --headless --brief <file|-> (experimental) to author the spec itself instead of writing a blank skeleton: phax spawns a recorded agent session with the phax-spec skill and the spec document JSON Schema, accepts a schema-valid document as the session's only output, renders it to the canonical Markdown, and writes the rendered spec plus its JSON sidecar. --model and --effort override the resolved authoring model/effort (flag, then phax.json's authoring.spec, then the catalog default). Side effects: spawns a provider session; on success, writes and commits the spec and its sidecar in one commit; nothing lands on a refusal or an invalid session result. When records are configured, every session that ran — committed or failed — writes one authoring record (key authoring/<YYMMDDHHMM>-<slug>) on phax/records/v1, and phax records explain <commit> resolves it through the artifact commit's Authoring-Id trailer.

Arguments

<slug>

Slug matching [a-z0-9]+(-[a-z0-9]+)*

Flags

--headless

Author via a recorded agent session from a brief instead of a blank skeleton (experimental)

--model <model>

Override the authoring model (default: flag → config → catalog)

--effort <effort>

Override the authoring effort (low|medium|high)

--brief <file|->

Path to a brief file, or - to read the brief from stdin

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact new spec plan-prune
phax artifact new spec plan-prune --headless --brief brief.md

phax artifact new plan

  • Usage: phax artifact new plan [FLAGS] <slug>

Creates a Draft plan at docs/plans/<YYMMDDHHMM>-<slug>-plan.md, with a frontmatter-only skeleton (status, source-spec, and completes-spec when a spec is bound). Pass --spec <path> to bind an existing spec as the plan's source-spec; the path must classify as a spec (live or archived), exist, and pass artifact validation. With --spec, pass exactly one of --last or --not-last: --last writes completes-spec: true (this plan is the spec's last, and its run completes the spec), --not-last writes completes-spec: false (more plans of the spec follow, and its run leaves the spec live). Every plan of a spec except the last says --not-last; no default is ever inferred. Without --spec, source-spec is written as null with no completes-spec, and both flags are refused. The slug must match [a-z0-9]+(-[a-z0-9]+)*.

Side effects: writes the new plan file. Does not commit — transition commands (phax artifact approve) commit, creation does not.

Pass --headless --brief <file|-> (experimental) to author the plan itself instead of writing a blank skeleton: phax spawns a recorded agent session with the phax-planning skill and the plan document JSON Schema (the extracted-plan shape plus informational content), accepts a schema-valid document as the session's only output, renders it to the phax-planning Markdown shape, writes the rendered plan plus its JSON sidecar, and seeds the extraction cache so phax run never re-extracts it. --model and --effort override the resolved authoring model/effort (flag, then phax.json's authoring.plan, then the catalog default). Side effects: spawns a provider session; on success, writes and commits the plan and its sidecar in one commit and seeds the extraction cache; nothing lands on a refusal or an invalid session result. When records are configured, every session that ran — committed or failed — writes one authoring record (key authoring/<YYMMDDHHMM>-<slug>) on phax/records/v1, and phax records explain <commit> resolves it through the artifact commit's Authoring-Id trailer.

Arguments

<slug>

Slug matching [a-z0-9]+(-[a-z0-9]+)*

Flags

--spec <path>

Path to the source spec to bind as source-spec

--last

This plan is its spec's last: its run completes the spec

--not-last

More plans of the spec follow: its run leaves the spec live

--headless

Author via a recorded agent session from a brief instead of a blank skeleton (experimental)

--model <model>

Override the authoring model (default: flag → config → catalog)

--effort <effort>

Override the authoring effort (low|medium|high)

--brief <file|->

Path to a brief file, or - to read the brief from stdin

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact new plan plan-prune-store --spec docs/specs/2609091412-plan-prune.md --not-last
phax artifact new plan plan-prune-cli --spec docs/specs/2609091412-plan-prune.md --last
phax artifact new plan catalog-refresh
phax artifact new plan plan-prune --headless --brief brief.md --spec docs/specs/2609091412-plan-prune.md --last

phax artifact schema

  • Usage: phax artifact schema [--json] <kind>

Prints the JSON Schema of the experimental spec document (kind spec) or plan document (kind plan), or of a decide verdicts file (kind verdicts, the input of phax artifact decide --verdicts), pretty-printed to stdout, so a consumer can read the contract a headless authoring session must satisfy, or the file to write, without a model call.

The spec and plan document formats are experimental: outside the version 1 stability promise, they may change between releases. The printed spec or plan schema is the answer schema a headless authoring session answers, rendered from the decoder: it accepts and refuses the same documents as the published one, its $schema a const naming the current stamp; the plan document's extracted fields are the extracted-plan shape phax run reads. phax checks, when it decodes a document, what the schema does not express: traceability (every acceptance criterion references existing requirements, every requirement is covered), the question checks (unique question ids, a recommendation among a question's options), the plan's sourceSpec/completesSpec pairing, and an authoring answer's empty arbitratedQuestions.

Side effects: none — read-only.

Arguments

<kind>

Document kind: spec, plan or verdicts

Choices:

  • spec
  • plan
  • verdicts

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact schema spec
phax artifact schema plan
phax artifact schema verdicts

phax artifact migrate-approvals

  • Usage: phax artifact migrate-approvals [--json]

Reads docs/plans/approvals.json and docs/specs/approvals.json in any released shape, writes one record file per entry under docs/plans/approvals/ and docs/specs/approvals/, deletes the ledgers, and commits exactly those paths in one commit. Exits 0 when migrated or when there is nothing to migrate; exits 12, writing nothing, on an unreadable ledger, an entry that is not a live artifact path, an uncommitted change to any path it would write, or an existing record file holding a different record.

An entry whose artifact no longer exists still migrates, and is reported on stderr as an orphan record file to delete. An existing record file that already holds the entry's record is kept as is.

Side effects: writes the record files, deletes the ledgers and commits those paths in one commit.

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact migrate-approvals

phax artifact migrate-documents

  • Usage: phax artifact migrate-documents [--gate-profile <id>] [--json]

Rewrites every live spec and plan sidecar (a <name>.json directly under docs/specs/ or docs/plans/ beside its <name>.md) stamped below its document format's current shape, or written before $schema, at that shape, and re-renders its body in the current layout, keeping its frontmatter byte for byte. A spec's questions are lifted by the author's rationale marker: a question whose rationale opens with Decided by the author on <YYYY-MM-DD> becomes arbitrated with a lifted, unattributed verdict; every other question stays open. A plan document stamped 0.20.0 lifts with empty preamble questions and keeps its body, lineage and frontmatter as they were. A plan sidecar stamped 0.26.0 or below has each phase's testStrategy string read as test lines: one whose every line follows the line format (- <guarantee> — <size> · <technique> · <oracle> · <loop>[ · <criterion>]) is lifted to those lines, and one holding prose is refused, naming the phase, its first departing line and the remedy: rewrite each phase's test strategy in the line format, in the sidecar and plan.md alike, or re-author the plan, then rerun. Archived artifacts, hand-authored artifacts and approval record files are never touched.

A plan sidecar stamped 0.38.0 or earlier declares no gate profile, and phax never invents one: it migrates only with --gate-profile <id>, which writes that id as its run.gateProfile and renders it as the body's ## Gate profile section, so an Approved plan reads as edited since its approval and needs approving again. Without the flag such a plan is refused, naming the flag. One call applies the one id to every plan it migrates. An id phax.json does not define is refused with exit 2 before anything is read or written. A spec sidecar ignores the flag.

Before writing anything it decides everything, and exits 12, writing nothing, on an invalid sidecar (including a plan document stamped 0.17.0–0.19.x, which stays refused), on a plan sidecar whose test strategy is not in the line format, on a body that is not its sidecar's own-shape rendering (a hand edit would be overwritten), or on an uncommitted change to any path it would write; each refused artifact is named with its remedy: re-author it headless, or delete its sidecar to demote it to hand-authored.

The report names each migrated artifact with its status and question counts (open, with their ids, and arbitrated, with how many are lifted), or body unchanged. It names every Approved artifact the re-rendering leaves edited since approval — with its open question ids and phax artifact reopen <path> when it has any, else phax artifact approve <path> — and every live plan it leaves stale with spec-changed evidence. With nothing to migrate it says so, writes nothing and exits 0.

Until it has run, phax artifact approve and phax artifact reopen refuse with exit 12, naming each unmigrated sidecar; complete, abandon and run completion carry an older sidecar as before.

Side effects: writes the sidecars and re-rendered bodies, re-seeds each rewritten plan's extraction cache so phax run never re-extracts it, and commits exactly the rewritten paths in one commit. A failed commit exits 12, leaving the files written but uncommitted.

Flags

--gate-profile <id>

The gate profile each plan sidecar stamped 0.38.0 or earlier declares once migrated, one phax.json defines; such a sidecar declares none, and is refused without it

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax artifact migrate-documents
phax artifact migrate-documents --gate-profile standard

phax plans

  • Usage: phax plans <SUBCOMMAND>

Parent command for reporting on plans: the mechanical defects of a single plan (lint), a plan laid out phase by phase with its planned files by architecture part, its test lines and the coverage of its source spec's criteria (overview), a plan's API-list cost and its fit in the subscription windows (estimate), staleness of Approved plans against their recorded approval, and cross-plan file overlap.

Examples

phax plans lint docs/plans/2609101200-foo-plan.md
phax plans overview docs/plans/2609101200-foo-plan.md
phax plans status
phax plans overlap docs/plans/2609101031-a-plan.md docs/plans/2609101032-b-plan.md

phax plans status

  • Usage: phax plans status [--apply] [--json]

Reports every live, Approved plan's staleness against the ground it was approved against: the declared source spec's content, the plan's own content, and the files changed since the recorded baseline intersected with the plan's footprint. Each stale entry names its reasons (spec-changed, ground-changed, self-changed) with evidence; a plan with no approval record — or one whose baseline commit no longer exists — reports missing-record, which renders as stale. In a project that declares a code link, ground-changed is judged in the code repository from the approval's code baseline. This is a report, not a gate: it exits 0 whether or not stale plans exist. Use --apply to flip stale-computed plans Approved -> Stale as an explicit gesture (the flip is never automatic). Use --json for machine-readable output.

Side effects: read-only unless --apply is set, in which case it writes the flipped plans' frontmatter status key.

Flags

--apply

Flip stale-computed plans Approved -> Stale

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax plans status
phax plans status --apply
phax plans status --json

phax plans overlap

  • Usage: phax plans overlap [FLAGS] <plan>…

Reports which of two or more plans can run in parallel without a merge conflict — predicted from each plan's declared file-sets, or confirmed against a landed run's actual diff.

(Predicted) Without --landed: reads each plan.md's structured form through the content-addressed extraction cache (a cold cache miss extracts once via LLM and caches the result; use --no-extract to fail on a miss instead). Unions each plan's declared phase file-sets into a per-plan footprint, intersects footprints pairwise, and reports the severity-graded conflict matrix, clean pairs, the largest fully-disjoint parallel-safe set, and a greedy wave schedule.

(Confirmed) With --landed <run>: takes a run that has already produced changes and reports which of the given plans need re-adjustment because they touch a file the run actually changed. The landed run's footprint is read from its persisted global-file-reconciliation.json (the real git diff across its phases), giving actual-vs-declared impact with no false negatives.

Caveats: the predicted mode reflects declared file intentions, not what agents will actually touch. Conflicts are file-level, not hunk-level — two plans editing different regions of the same file are flagged even if git would auto-merge them. Regenerated artifacts (phax.usage.kdl, docs/cli/reference.md) are a hard-conflict class.

Side effects: read-only with respect to your plans; may run one LLM extraction per uncached plan.md.

Arguments

<plan>…

Paths to two or more plan.md files

Flags

--no-extract

Fail on a cache miss instead of extracting the plan.md

--landed <run>

Report which of the given plans need re-adjustment after this run's actual changes

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax plans overlap docs/plans/2609101031-a-plan.md docs/plans/2609101032-b-plan.md
phax plans overlap --landed my-feature docs/plans/2609101033-other-plan.md

phax plans lint

  • Usage: phax plans lint [--json] <plan>

Reports every mechanical defect of a plan.md that phax can establish before a run, as findings with a severity (error or warning), a check, and the phase they concern.

Nine checks run: structure — every field the deterministic extraction requires, reported in full rather than stopping at the first, a missing or doubled ## Gate profile section included; files — the planned create/edit lists walked in phase order against the working tree, so an edit of a file no earlier phase creates, a create of a file that already exists or was already created, and a phase that both creates and edits a path are errors (a path listed both to create and as optional is the one warning; optional files are never checked); commands — the plan's required commands against security.agentCommands and the steps of the gate profile the plan declares; gate-profile — a declared gate profile that phax.json (with its workspace layer) does not define is an error naming every defined profile, and the commands comparison is then skipped; models — each phase's model and effort against the routing catalog, with alternatives when one is refused, each assignment bound of phax.json against the catalog, and each phase against the first bound that matches a file it plans to touch (or the policy default when none does): a departure without an Assignment reason: line is an error against a bound and a warning against the default, and a Model reason: line is an error (the label is now Assignment reason:); when a bound names an architecture part, the architecture provider runs once to resolve it; interactive and acceptance — a malformed Mode: or Acceptance phase: line is an error; so are the interactive-phase rules: an interactive phase that is the first or the last phase, one that directly follows another interactive phase, and one that plans a file to create or edit (its optional files name what the person may touch); and so are the acceptance-phase rules: an Acceptance phase: line without Acceptance test files: (or the reverse), a passing phase that is not later in the plan or does not exist, a phase that is both an acceptance phase and a passing phase or passes more than one acceptance phase, an acceptance test file listed more than once on the Acceptance test files: line, an acceptance test file that is not a planned file of the acceptance phase or that a phase in between plans, an interactive phase in a role (one between the pair is allowed), and an acceptance phase when no acceptance provider is configured (the provider is never spawned by lint); tests — a test line off the format is an error, one per phase naming its first departing line, and the other checks run on the plan without the departing lines; so are an acceptance-loop line on a phase that is not an acceptance phase, an acceptance phase with no acceptance-loop line (a phase with no test line at all included), and a criterion id the source spec's sidecar lacks; a criterion no line names is a warning, and so is a source spec whose criterion ids cannot be read (no sidecar, not found, a sidecar that does not read, or a source-spec that is not a spec path under docs/specs/, which is never read), in which case no criterion id is checked. The source spec's JSON sidecar is read in any shape, from docs/specs/archive/ when the spec has moved there; a plan with no source spec checks no criterion, and a loose plan.md whose frontmatter does not decode gets one warning naming the problem and checks no criterion. A phase with nothing to test is not flagged; advisory — when phax.json registers a planAuditor, phax writes the plan projection (the ordered phases, each with its planned create/edit files, and nothing else) to that command's stdin and reports every finding it returns as a warning naming the phases it concerns; a failing auditor is a single warning, and so is one that outruns the 30s cap phax spawns it under; with no auditor, or a plan the parser cannot read, there are no advisory findings. Advisory findings never affect the exit code.

A plan under docs/plans/ is first validated like any artifact (a name off <YYMMDDHHMM>-<slug>-plan.md, an invalid frontmatter block or a status/location disagreement refuses with exit code 12), and a slug that differs from its source spec's slug is a structure error; a loose plan.md outside docs/plans/ is exempt from both.

The file-plan ground is the working tree as it is now, not any commit; in a project that declares a code link, the files check walks planned paths against the code root's working tree, and a failing link refuses the lint with exit 2. Read-only and model-free: it never writes, never reads the extraction cache and never falls back to the extraction model, so a plan the deterministic parser cannot read reports its structural errors and stops. Exits 1 when at least one finding is an error, 0 otherwise (warnings alone do not fail). An invalid config, a malformed bound or a user overlay that carries assignments included, exits 2.

Side effects: none of phax's own; a registered plan auditor is spawned once with the projection on stdin, capped at 30s.

Arguments

<plan>

Path to the plan.md

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax plans lint docs/plans/2609101200-foo-plan.md
phax plans lint docs/plans/2609101200-foo-plan.md --json

phax plans overview

  • Usage: phax plans overview [--json] <plan>

Lays a plan out before it runs. For each phase in plan order it shows the model, effort and mode, the acceptance role (an acceptance phase and the phase that passes it, or none), the planned files to create and edit grouped by architecture part, and the test lines. It ends with the coverage of the source spec's acceptance criteria: each criterion with the phases and loops whose test lines name it (phase-02 in-phase ×2 when two lines of a phase and loop name it), then the criteria no line names. Cost is not shown; phax plans estimate keeps that.

The plan is read by the deterministic parser phax plans lint uses; no model reads it and no model session starts. It runs in any plan status, reads the plan and the source spec's JSON sidecar (from docs/specs/archive/ when the spec has moved there), and writes nothing. A plan under docs/plans/ is first validated like any artifact.

Parts: when phax.json registers an architecture provider, it runs once with the plan's planned files to create and edit (the whole repository when there are none). Each file is shown under every part whose globs match it, in the report's order, and the files no part holds are shown under (no part). Without a provider the planned files are shown as they are, and the header says so. A provider that fails or is refused is not an error: the overview degrades to the planned files, prints one line on stderr, Warning: architecture provider failed: <message>, and exits 0.

Coverage: a plan without a source spec prints no criterion coverage. A source spec with no JSON sidecar, one that is not found, a sidecar that does not read, or a source-spec that is not a spec path under docs/specs/ (never read) prints the one line phax plans lint reports for it, and no coverage. A loose plan.md whose frontmatter does not decode says so in its header and in that one line, and reads no source spec.

A plan the deterministic parser cannot read, including one with a test line off the format, prints one line on stderr naming the plan and phax plans lint <plan>, and exits 1: lint says what is wrong. A plan that fails artifact validation prints the plan and that validation error on one line and exits 1; a plan file that cannot be read prints the read failure and exits 1.

--json prints the overview as one versioned plan-overview document on stdout, its $schema first; a warning reaches stderr as a note line. It carries the same content as the text: frontmatter.kind is decoded (with status), none or undecodable (with problem); architecture.kind is parts, none or failed; each phase has its acceptanceRole (acceptance with passedBy, passing with acceptancePhase, or none), its placement (a list of { part, files } ending with the { part: null } entry of the unplaced files) and its testLines; coverage.kind is criteria (one entry per naming line), no-source-spec, frontmatter-undecodable or no-criterion-ids (with a reason).

Exit codes: 0 for an overview, a degraded architecture included; 1 for a plan that cannot be read, does not parse or fails artifact validation; 2 for an invalid phax.json.

Side effects: none of its own; the architecture provider is spawned once when one is configured.

Arguments

<plan>

Path to the plan.md

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax plans overview docs/plans/2609101200-foo-plan.md
phax plans overview docs/plans/2609101200-foo-plan.md --json

phax plans estimate

  • Usage: phax plans estimate [--no-probe] [--json] <plan>

Estimate a plan's API-list cost and whether it fits the subscription windows now. Reports P10/P50/P90 in API-list dollars for each phase and for the run, then a verdict on the Claude subscription windows left right now.

History: the estimate is calibrated from this machine's cost ledgers. Only this repository's kept runs are sized (each phase by its planned-file bytes), and recent runs weigh more, with a half-life of 30 days. An estimate needs at least 60 sized phases; below that the verdict is thin-history and no estimate is printed. Every kept run with no ledger first gets one, as phax cost backfill writes it, and a line on stderr says how many were written; the report counts the kept runs still without one (a locked run is skipped).

Windows: by default, one minimal Claude Code probe on the cheapest Claude model reads the five-hour and seven-day windows from its rate-limit event. The probe gets a fixed prompt and never sees the plan; it spends one small request. --no-probe uses the last rate-limit sample in the cost ledgers instead, with no request; usage since that sample is not counted. phax never reads Claude Code's credentials or its OAuth usage endpoint. Each window's dollar capacity is recalibrated from the ledgers of the last 28 days.

Verdict: fits (no pause even at P90), risky (fits at P50, a pause is possible at P90), wait (a pause is expected at P50), thin-history (fewer than 60 sized phases), no-subscription (Claude Code authenticates with an API key), windows-unavailable (the windows could not be read; the reason is given) or uncalibrated (a window or the burn rate had no recent samples). An interactive phase is sized from its first and closing turns alone, from at least 3 past interactive phases with turn entries, repriced at its model and weighted by recency; it has its own row at its place in the plan, and mode: interactive in --json. A phase on a hold is part of a run, never sized. Never estimated: plan extraction, the plan auditor and the interactive code review; a phase routed to Codex or Mistral Vibe, or to a Claude model with no list price, is named and left out of the run total; the compliance review is named when it cannot be estimated.

The plan is read by the deterministic parser phax plans lint uses; no model reads it. A plan under docs/plans/ is first validated like any artifact. --json prints the report as one JSON document on stdout; warnings go to stderr.

Exit codes: 0 for any verdict; 1 for a plan the deterministic parser cannot read; 2 for an invalid phax.json, model-routing.json or providers.json; 10 for a corrupt run registry; 12 when the plan fails artifact validation.

Side effects: writes cost-ledger.json in each kept run folder that has none, as phax cost backfill does; without --no-probe, one Claude Code request.

Arguments

<plan>

Path to the plan.md

Flags

--no-probe

Use the last rate-limit sample in the cost ledgers instead of a one-message Claude Code probe

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax plans estimate docs/plans/2609101200-foo-plan.md
phax plans estimate docs/plans/2609101200-foo-plan.md --no-probe --json

phax records

  • Usage: phax records <SUBCOMMAND>

Manage phax run records

phax records init

  • Usage: phax records init [--force] [--json]

Configure records for this project (transcript, destination, auto-push)

Flags

--force

Reconfigure records even if already configured

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax records sync

  • Usage: phax records sync [--replay] [--json]

Fetch the records remote and bring the local records branch level with it

Flags

--replay

Replay local-only records onto the remote tip when the records branch has diverged

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax records status

  • Usage: phax records status [--json]

Show pending (unpushed) records, by run and phase

Flags

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax records list

  • Usage: phax records list [--run <id>] [--json]

List records present: phase records by run, phase, and verified surfaces; review entries by run and review; authoring and decision records by id and artifact

Flags

--run <id>

Only show records for this run id

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

phax records explain

  • Usage: phax records explain [FLAGS] <sha>

Explains a commit from its record. For a phase, the gates line is followed by each gate attempt with its duration, then each step's command, surface, result and duration, then the protected-paths check when it ran (a duration under a second in milliseconds): time unknown marks a time a record written before times were kept does not hold, not run a skipped acceptance step, and steps unknown an attempt whose step record is absent or unreadable. The commit is a phase commit, a declared interactive phase's commit (Phase-Id with Interactive-Phase), or a held phase's review commit, which carries Run-Id and Held-Phase and resolves to the held phase's record. A headless artifact commit resolves through its Authoring-Id, a decide commit through its Decision-Id and a revise commit through its Revision-Id, read from the last paragraph of its message only, so an amendment line shaped like a trailer never addresses another record. The output adds the stop's lines: its mode, cause, outcome, the person who closed it, the review commit, and each recorded session with its provider, model, origin and its transcript's sha256, or the reason it is missing. A stop's record never carries the transcript itself: interactive transcripts stay in the run folder whatever records.transcript says.

A run-level review entry's own commit on phax/records/v1 (Run-Id and Review trailers) is a record, not a source commit: explain names the run and the review and prints the git show that reads the review's file, and exits 0.

Arguments

<sha>

Commit sha in the source repository (a phase commit or an artifact commit)

Flags

--prompt

Print the full prompt

--diff

Print the full diff

--transcript

Print the full transcript

--gates

Print the gate check logs, each followed by its gate request

--briefs

Print the phase's brief records (brief-NN.json) in number order

--json

Answer in JSON: the output on stdout, messages as JSON lines on stderr

Examples

phax records explain 3f9c2a1
phax records explain 3f9c2a1 --gates