Repository navigation
Keep Claude's MCP approval keys out of the Codex hooks file - #15
Open
anessbelbati wants to merge 1 commit into
Open
anessbelbati wants to merge 1 commit into
anessbelbati wants to merge 1 commit into
Conversation
Setup wrote the same JSON to .claude/settings.json and .codex/hooks.json,
including enableAllProjectMcpServers and enabledMcpjsonServers. Codex accepts
only "description" and "hooks" at the top of a hooks file, and with any other
key it loads no hooks from the file at all:
failed to parse hooks config .../.codex/hooks.json: unknown field
`enableAllProjectMcpServers`, expected `description` or `hooks` at
line 2 column 30
So the context hook never ran under Codex, and every prompt went out without
the Video FS context. Measured with Codex 0.160.1 against a stand-in model
server, on macOS and on Linux: 0 hooks loaded from the file as written and
no context in the model request; with the two keys gone, 1 hook loaded, it
ran, and the context was in the request.
The two keys now go into Claude's file only. Setup also removes them from a
.codex/hooks.json that is the desktop's own earlier output, under the same
ownership test enableProjectMcpServers already uses, so an existing project
recovers the next time it is opened. A file the user wrote is left alone.
This was referenced Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this fix, and what changes for the user?
Setup builds
.claude/settings.jsonand.codex/hooks.jsonwith the same function, so both getenableAllProjectMcpServersandenabledMcpjsonServers, which only Claude Code reads. Codex accepts onlydescriptionandhooksat the top of a hooks file, and with any other key it loads no hooks from it:So under Codex the context hook never runs, on macOS too, and every prompt goes out without the Video FS context.
The two keys now go into Claude's file only. Setup also removes them from a
.codex/hooks.jsonthe app wrote earlier, so an existing project recovers when it's opened again. A hooks file the user wrote is left alone.How was it tested?
Real Codex against a stand-in model server, in a project prepared by
setupAgentProject:.codex/hooks.jsonCodex 0.160.1 on Oct 7 and 0.162.0 on Oct 9 (run: https://github.com/anessbelbati/impractical-video/actions/runs/37915846873), started with
--dangerously-bypass-hook-trustin place of a user who approved the project's hooks, as the README asks. Claude Code still gets the context and the video-fs tools. A new test covers the cleanup, and the compatibility test now checks the file has no top-level key besideshooks.CI (
verify), unchanged, passes on this branch on today's main: https://github.com/anessbelbati/impractical-video/actions/runs/38231933543Any remaining limitations or migration steps?
timeoutsetup writes, so that prompt went out without the context. In other runs the hook took 1.4 s and 0.3 s.