Skip to content

fix: set up Claude Code and Codex from your project folder - #136

Merged
PatrickSys merged 2 commits into
masterfrom
j11/init
Oct 16, 2026
Merged

PatrickSys merged 2 commits into
masterfrom
j11/init

Conversation

@PatrickSys

@PatrickSys PatrickSys commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T17:33:20.948209Z 00b1fa3 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/cli-init.ts
Comment on lines +265 to +268
if (
hasExistingCodebaseContext &&
!jsonValuesEqual(existingServers['codebase-context'], generatedCodebaseContext)
) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[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.

Findings

  1. P1 Setup breaks existing Codex configs ▶
  2. P2 Setup advice contradicts itself ▶

Summary

Changes Claude Code and Codex setup from HTTP registration commands to project files that launch the installed server.

  • Claude Code and Codex configs start the server for the selected project.
  • Setup keeps existing client settings and stops on conflicting server entries.

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"]
Loading

Reviews (1) · Last reviewed commit: "Merge the setup fix with current release..." · Reviewed by Greptile

Comment thread src/cli-init.ts
Comment on lines +341 to +344
const dottedEntry = new RegExp(
`^\\s*${mcpServersKey}\\s*\\.\\s*${codebaseContextKey}\\s*\\.`,
'm'
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Comment thread docs/client-setup.md
Comment on lines +118 to +120
`--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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

@PatrickSys
PatrickSys merged commit cfaa90b into master Oct 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant