@@ -28,7 +28,7 @@ These are requirements, not suggestions:
2828 history and can be undone. ` weaver init ` sets this up for you.
29292 . ** Weaver is installed as a package, never copied into your book.** The AI
3030 that works on your book cannot change the tool.
31- 3 . ** You work with an AI that can run commands,** such as Claude Code. Chat
31+ 3 . ** You work with an AI that can run commands,** such as Claude Code or local Codex . Chat
3232 windows that can't run Weaver aren't supported.
33334 . ** Your original files are never changed.** Import reads them; export writes
3434 new files.
@@ -41,23 +41,25 @@ book, and it tells you in plain words what to fix.
4141The AI edits prose; the author decides. Author commands (` approve ` , ` reject ` ,
4242` undo ` , ` rule ` , ` proposal ` , ` state:accept ` , ` release ` , ` import ` , and ` guard seal ` ) refuse in
4343Claude Code and Codex shells. The author page still works when an AI launches it.
44- Claude Code edit and shell hooks block protected settings and records, author
44+ Claude Code and Codex edit and shell hooks block protected settings and records, author
4545commands, Git history/config writes, tool installation changes, and requests to
4646the local author page. Ordinary prose edits, notes, checks, and reads stay available.
4747
4848` weaver init ` and ` weaver hooks install ` install the hooks and permission rules.
49- The rules use ` Bash(npx weaver approve:*) ` and the equivalent forms for every
49+ Claude's rules use ` Bash(npx weaver approve:*) ` and the equivalent forms for every
5050author command (bare ` weaver ` , ` npx ` , ` npx --no-install ` , and ` npx.cmd ` ).
5151` Edit(/.claude/**) ` and ` Edit(/quality/**) ` are anchored to the book's project
5252settings, apply to all built-in edit tools, and leave reads available. These use
5353the documented [ Claude Code permission syntax] ( https://code.claude.com/docs/en/permissions ) .
5454Pre-hooks return the documented [ deny decision] ( https://code.claude.com/docs/en/hooks#pretooluse-decision-control ) .
55- Permission bypass is disabled in the installed project settings.
55+ Claude permission bypass is disabled in the installed project settings.
56+ Codex uses project hooks and forbidden command-prefix rules; see [ Hosts] ( #hosts )
57+ for the required one-time trust step.
5658
5759At hand-over, PickBits runs ` weaver guard seal ` from an author shell. It records
5860CRLF-normalized SHA-256 fingerprints in ` .weaver/guard.json ` and commits that
5961seal with an approval trailer. It covers both book Claude settings files
60- (including an absent local file), ` CLAUDE.md ` , ` AGENTS.md ` , ` project.json ` , and
62+ (including an absent local file), ` .codex/** ` , ` CLAUDE.md ` , ` AGENTS.md ` , ` project.json ` , and
6163every file under ` quality/ ` . Rulings live separately in ` continuity/rulings.json `
6264and do not invalidate the seal. Intentional settings changes require review and
6365resealing; sealing commits only the seal, leaving other pending work untouched.
@@ -271,7 +273,7 @@ style findings are listed by ID in `check` and `approve` output.
271273
272274## Claude Code hooks
273275
274- Run ` weaver hooks install --root ./my-book ` to merge Weaver's PreToolUse and
276+ Run ` weaver hooks install --host claude -- root ./my-book ` to merge Weaver's PreToolUse and
275277PostToolUse hooks into ` .claude/settings.json ` . The pre-hook supplies the
276278editorial rules and rule messages before scene edits, and the post-hook checks
277279the edited scene and blocks only when a blocking rule fires. Hooks fail open on
@@ -327,7 +329,7 @@ npx weaver state:accept --through 3-2 --root ./my-book
327329npx weaver facts build --root ./my-book
328330```
329331
330- For an interactive Claude Code session, print one packet and submit its answer:
332+ For an interactive Claude Code or Codex session, print one packet and submit its answer:
331333
332334``` bash
333335npx weaver packet state --scene 1-1 --root ./my-book
@@ -340,11 +342,89 @@ quotes from elsewhere are rejected, including after the single repair round.
340342` continuity/facts.json ` is deterministic derived state: it keeps facts in scene
341343order and records the first scene that establishes each normalized value.
342344
343- The host defaults to Claude Code (` claude -p --output-format text ` ) and can be
344- set in ` project.json ` with ` host.command ` , ` host.args ` , ` host.concurrency ` , and
345- ` host.timeout_seconds ` . Weaver removes ` ANTHROPIC_API_KEY ` from the child
346- environment, so host runs use the user's Claude subscription rather than
347- silently billing an API key. A missing host is a doctor warning, not a block.
345+ ## Hosts
346+
347+ Claude Code and Codex are supported for local book work, including local Codex
348+ sessions in the ChatGPT desktop app. The AI edits prose; the author approves,
349+ rejects, rules on findings, accepts story state, and releases the book.
350+
351+ Claude Code remains the default (` claude -p --output-format text ` ). Choose
352+ Codex in ` project.json ` :
353+
354+ ``` json
355+ {
356+ "hosts" : [" claude" , " codex" ],
357+ "host" : {
358+ "kind" : " codex" ,
359+ "reasoning_effort" : " medium" ,
360+ "timeout_seconds" : 600 ,
361+ "concurrency" : 2 ,
362+ "args" : []
363+ }
364+ }
365+ ```
366+
367+ ` hosts ` lists the hosts the author uses; it defaults to both. Doctor blocks
368+ missing or inactive guards only for those hosts. ` host.kind ` selects the packet
369+ runner. Override it for one call with ` --host claude ` or ` --host codex ` on
370+ ` run --book --run ` , ` review ` , ` repair ` , or ` state bootstrap ` . The Jobs page has
371+ the same selector, initially set to the project choice. An override does not
372+ change the project file. When switching kinds, it uses that host's executable
373+ and arguments instead of carrying the other host's command across.
374+
375+ ` host.command ` can select a custom executable. Claude's ` args ` replace its
376+ default arguments; Codex's ` args ` are extra ` exec ` options, such as
377+ ` ["--model", "a-model-you-can-use"] ` . Codex receives the packet on stdin, runs
378+ read-only with ` --ephemeral ` and ` --skip-git-repo-check ` , and writes its final
379+ answer with ` -o ` into a temporary directory. Weaver consumes only that file,
380+ cleans it after the attempt, and uses the same validation, repair, and retry
381+ pipeline for either host. Reasoning effort defaults to ` medium ` ; the chosen
382+ model must support the configured level.
383+
384+ Weaver strips ` ANTHROPIC_API_KEY ` , ` OPENAI_API_KEY ` , and ` CODEX_API_KEY ` from host
385+ processes. Codex packet calls select the OpenAI provider and require ChatGPT
386+ login. Custom provider credential settings are outside this supported login
387+ path; do not configure API providers for Weaver packets.
388+
389+ For a fresh machine:
390+
391+ 1 . Install Node.js 22 or newer, Git, Weaver, and the host CLI(s) you use. Run
392+ ` claude ` and finish sign-in for Claude Code. Run ` codex login ` , choose
393+ ChatGPT, and verify with ` codex login status ` for Codex.
394+ 2 . Create the book with ` weaver init <folder> ` , which installs both sets of
395+ guards. For an existing book, run ` npx weaver hooks install --host both `
396+ from its folder. Use ` --host claude ` or ` --host codex ` to repair just one.
397+ The installer merges unrelated configuration and is safe to repeat.
398+ 3 . For Claude Code, open the book folder, accept its workspace trust prompt,
399+ and restart an existing session so it loads ` .claude/settings.json ` .
400+ 4 . For Codex, open a ** local** session in the book folder and trust the folder.
401+ Type ` /hooks ` , review and trust each Weaver hook, then restart Codex to load
402+ the project command rules. New or changed hook definitions require review
403+ again. ` AGENTS.md ` is discovered automatically; Weaver leaves it unchanged.
404+ 5 . Run ` npx weaver doctor ` . On Windows, interactive writing needs a writable
405+ workspace: use ` codex --sandbox workspace-write ` if doctor reports read-only
406+ mode. Packet calls stay read-only. PickBits seals the installed book settings
407+ at hand-over with ` npx weaver guard seal ` from the author's own terminal.
408+
409+ Claude uses pre/post edit and shell hooks plus permission denials. Codex uses
410+ ` .codex/hooks.json ` and ` .codex/rules/weaver.rules ` . Its patch handler checks
411+ every file and move destination, reconstructs scene edits in memory, and uses
412+ the same blocking-rule regression comparison as Claude. Remaining blocking
413+ findings and advisory voice warnings are returned after editing. If a patch
414+ cannot be reconstructed, that rule check fails open; path guards still run.
415+
416+ Codex 0.160.1 supports project command rules, so ** no global installation is
417+ needed** . The optional ` --user-rules ` flag explicitly also installs the rules
418+ under ` $CODEX_HOME/rules/weaver.rules ` (normally ` ~/.codex/rules ` ). Those global
419+ rules affect other projects too. Normal installation never changes either
420+ host's global configuration or trusts hooks for you.
421+
422+ These are pattern-based guardrails running as the same operating-system user,
423+ not an isolation boundary. Shell disguises, other tools, or direct changes can
424+ get around them. Doctor, the settings seal (including ` .codex/** ` ), and approved
425+ history make covered changes visible. Codex's local hooks are not supported in
426+ Work Cloud with local computer access; use a local Codex session for this
427+ workflow. See [ verified Codex CLI facts and limits] ( docs/codex-host.md ) .
348428
349429## Your own checks
350430
@@ -435,7 +515,7 @@ settings-seal checks.
435515| ` reject ` | Save and restore one chapter's pending edits |
436516| ` undo ` | Revert the most recent approval with a new Git commit |
437517| ` history ` | Show approvals and undos (` --json ` supported) |
438- | ` hooks install ` | Install or merge Claude Code scene-edit hooks |
518+ | ` hooks install ` | Install or merge Claude Code and Codex guards (both by default) |
439519| ` state:status ` | Show current and stale derived-state records |
440520| ` state bootstrap ` | Build story-so-far packets, optionally run them through the host |
441521| ` state:accept ` | Stamp reviewed narrative state through a scene |
0 commit comments