Repository navigation
fix: set up Claude Code and Codex from your project folder - #136
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00b1fa31c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ( | ||
| hasExistingCodebaseContext && | ||
| !jsonValuesEqual(existingServers['codebase-context'], generatedCodebaseContext) | ||
| ) { |
There was a problem hiding this comment.
Allow reruns to refresh stale installer paths
When the npm cache, package installation, or Node executable moves, rerunning init generates a different absolute command or entrypoint, but this guard rejects the existing installer-created entry rather than refreshing it; the equivalent Codex path also throws. Consequently, the recovery documented in docs/client-setup.md:120 cannot repair the now-broken configuration without manual deletion or editing. Recognize and update previously generated entries, or document the required removal instead.
AGENTS.md reference: AGENTS.md:L112-L112
Useful? React with 👍 / 👎.
[Medium impact] The changes affect setup for Claude Code and Codex projects. Fix the Codex conflict check before merging; setup can turn a valid existing config into an invalid one. FindingsSummaryChanges Claude Code and Codex setup from HTTP registration commands to project files that launch the installed server.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["init"] --> B["Choose client and project"]
B --> C{"Client"}
C -->|Claude Code| D["Generate .mcp.json"]
C -->|Codex| E["Generate .codex/config.toml"]
C -->|Cursor or OpenCode| F["Generate HTTP config"]
D --> G["Check existing settings"]
E --> G
F --> G
G -->|Conflict found| H["Leave file unchanged"]
G -->|No conflict found| I["Write project config"]
I --> J["Client starts Node with server path and project"]
Reviews (1) · Last reviewed commit: "Merge the setup fix with current release..." · Reviewed by Greptile |
| const dottedEntry = new RegExp( | ||
| `^\\s*${mcpServersKey}\\s*\\.\\s*${codebaseContextKey}\\s*\\.`, | ||
| 'm' | ||
| ); |
There was a problem hiding this comment.
Setup breaks existing Codex configs
_buildMergedCodexContent misses a valid root-level entry such as mcp_servers.codebase-context = { command = "old", args = [] }. The dottedEntry check requires another dot after codebase-context, and the other checks do not match this form.
Setup then appends [mcp_servers.codebase-context] and writes the file. This defines the same table twice, so Codex can no longer load the config. Recognize this form and reject the conflict before writing. Add a test that checks the original file stays unchanged.
| `--yes` writes the config without prompts. Run `init` without flags to choose a client interactively and optionally add project instructions. Cursor and OpenCode still use HTTP and need a separately running server. | ||
|
|
||
| Existing settings are kept. If a different Codebase Context entry is already present, setup leaves the file unchanged and reports the conflict. Restart the client after setup and approve the server if asked. The first use builds the code index. Rerun setup if the Codebase Context installation moves, because the config uses its installed location. |
There was a problem hiding this comment.
Setup advice contradicts itself
The rewritten section recommends the new setup commands, but line 132 still says the wizard limitations “are still present in the 2.4.0 source.” Those limitations included missing flags and broken Claude/Codex registration—the behavior this PR replaces.
Remove that stale warning or narrow it to the remaining Cursor/OpenCode HTTP requirement so readers get one clear setup recommendation.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Setup pointed Claude Code and Codex at an HTTP server that was not running.
It now writes a project config that starts the installed server and selects the current folder automatically.
Existing settings are preserved, and conflicting server entries are left unchanged.
Tested: failing config and startup tests before the fix; setup tests, build, type checks, lint and formatting.