Skip to content

Commit 200b1a5

Browse files
Cannon07claude
andcommitted
docs: document Codex approval_policy + sandbox_mode in README
Without `approval_policy = "on-request"` and `sandbox_mode = "read-only"` in config.toml, Codex applies edits without prompting and the diff preview never blocks on the user's decision — defeating the point of the workflow. Bundle both alongside the existing `codex_hooks` flag in the Quick Start. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent c5ebb83 commit 200b1a5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,19 @@ require("code-preview").setup()
140140
1. Install the plugin and call `setup()`
141141
2. Open a project in Neovim
142142
3. Run `:CodePreviewInstallCodexCliHooks` — writes `.codex/hooks.json`
143-
4. Codex requires a feature flag to enable hooks. Create or edit `.codex/config.toml` (project-local) or `~/.codex/config.toml` (global) and add:
143+
4. Codex requires a feature flag to enable hooks, and the diff-preview workflow only makes sense when Codex asks before applying edits. Create or edit `.codex/config.toml` (project-local) or `~/.codex/config.toml` (global) and add:
144144

145145
```toml
146+
approval_policy = "on-request"
147+
sandbox_mode = "read-only"
148+
146149
[features]
147150
codex_hooks = true
148151
```
149152

150-
The installer warns you if this flag is missing. You can also re-check at any time with `:CodePreviewStatus` or `:checkhealth code-preview`, which both report whether the feature flag is detected.
153+
`approval_policy = "on-request"` and `sandbox_mode = "read-only"` ensure Codex prompts you before every edit, so the diff preview has time to open and you have time to review. Without them, Codex may apply changes without prompting and the preview window will never block on your decision.
154+
155+
The installer warns you if `codex_hooks` is missing. You can re-check at any time with `:CodePreviewStatus` or `:checkhealth code-preview`, which both report whether the feature flag is detected.
151156
5. Start Codex CLI in the project directory
152157
6. Ask Codex to edit a file — a diff opens automatically in Neovim
153158
7. Accept/reject in the CLI; the diff closes automatically on accept

0 commit comments

Comments
 (0)