Repository navigation
Description
Client or integration
Claude Code
Area
CLI
Summary
OpenCodex leaves its generated global Claude Code subagent definitions under ~/.claude/agents/ocx-*.md after the Claude Code integration has been disconnected or disabled. In particular, ~/.claude/agents/ocx-claude-opus-5-5.md remains visible to native Claude Code sessions that do not use the OpenCodex proxy.
The generated agent description instructs the dispatcher to pass model: "haiku" as a placeholder, relying on the proxy's <!-- ocx-route: ... --> directive to select the real target. Without the proxy, that placeholder is not inert: Claude Code may actually select Haiku instead of the intended Opus model. This can silently degrade work performed by a native session.
Deleting the generated file manually is only a temporary workaround: running an OpenCodex update recreates the agent files even while the Claude Code integration remains disconnected. This makes it difficult to use OpenCodex and standalone Claude Code independently on the same machine.
Expected: Disconnecting or disabling Claude Code integration should remove OpenCodex-owned global agent definitions, or otherwise ensure that native Claude Code never loads proxy-dependent agent definitions. Updates and routine maintenance should honor the disabled state and not recreate them. User-authored agents must remain untouched.
Related: #6358 describes the unsafe model: "haiku" placeholder in non-proxied sessions, but does not cover the disconnect/update lifecycle; it was auto-closed for not following the issue template.
Reproduction
- Connect Claude Code through OpenCodex and configure a featured subagent targeting Claude Opus 5.5 so OpenCodex generates
~/.claude/agents/ocx-claude-opus-5-5.md. - Disconnect or disable the Claude Code integration in OpenCodex.
- Observe that the generated
ocx-*.mdfile remains under the global Claude Code agents directory. - Launch native
claudewithout the OpenCodex proxy. The generated agent is still discoverable; its description can lead Claude Code to passmodel: "haiku", resulting in a real Haiku invocation instead of the intended model. - Manually delete
~/.claude/agents/ocx-claude-opus-5-5.md. - Update OpenCodex while leaving the integration disabled. Observe that the generated file is recreated.
Steps reflect the reported behavior; exact CLI commands for disconnect/update may vary with the installation.
Version
Not supplied (observed on an installed OpenCodex version; please confirm exact version).
Operating system
Not supplied (global Claude Code agent directory ~/.claude/agents/).
Provider and model
Native Anthropic Claude Code; generated ocx-claude-opus-5-5 agent; unexpected Haiku fallback.
Logs or error output
No explicit error: silent model misrouting. Inspect ~/.claude/agents/ocx-claude-opus-5-5.md before/after disabling the integration and after updating OpenCodex.
Screenshots and supporting files
Not available.
Redacted configuration
Claude Code integration was previously enabled and later disconnected/disabled. Specific configuration was not provided.
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
fix(claude): reconcile agents only when the toggle turns Claude off
fix(claude): prune generated agents when the Claude integration is tu…
lidge-jun commentedon Oct 30, 2026
Fixed by #7993, merged into
devasa022a67fd8152045268405145d73ef696ff5afdd. Turning Claude Code off with the dashboard integration toggle now prunes the OpenCodex-generated~/.claude/agents/ocx-*.mddefinitions right away, so nativeclaudesessions stop seeing proxy-only agents and theirhaikuplaceholder. Only regular files carryinggenerated-by: opencodexare removed; user-authored agents are never touched. Turning it off again also removes definitions an older version left behind.On the regeneration claim: no current startup, launch, system-env, roster or update path writes these files while
claudeCode.enabledorinjectAgentsisfalse. Every one goes throughinjectClaudeAgentDefs, which prunes in that state. The leftover files came from the toggle never reconciling. If they reappear on a version that includes this fix while Claude Code is off, please reopen with the exact command that recreated them.