garrytan / garrytan/gstack

/codex skill ignores Codex MCP, uses fragile `codex exec` pipe that stalls or truncates (~50% failure rate)

Open
#1,036 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
133k
Forks
19.9k
Avg merge
18h 46m
Merged PRs (30d)
26

Description

The `/codex` skill invokes Codex via `Bash` → `codex exec "" --json 2>/dev/null | python3 -u -c "..."` instead of using the `mcp__codex__codex` / `mcp__codex__codex-reply` MCP tools that Claude Code already has available.

This approach is unreliable — roughly half my invocations fail, in one of two ways:

1. **Stalls with no output.** Bash call hangs until the 5-minute timeout, no response ever reaches Claude. Codex may or may not have actually run; impossible to tell because stderr is discarded via `2>/dev/null`.
2. **Output truncated mid-response.** Claude receives a partial answer that looks complete but is cut off, sometimes mid-sentence.

Likely causes:
- `codex exec --json` stream + Python stdin parser can deadlock on full pipe buffers.
- `2>/dev/null` hides the actual failure mode, so there's no signal when something breaks.
- Bash heredoc/quoting of the prompt can mangle large inputs.

The skill preamble explicitly steers Claude away from the MCP tool, which seems backwards — `mcp__codex__codex` handles streaming + structured output + session continuity cleanly and wouldn't hit any of these issues.

**Expected:** prefer `mcp__codex__codex` when available; fall back to `codex exec` only if MCP isn't installed. At minimum, don't swallow stderr.

**Repro:** `/codex review` on any non-trivial plan file, 2–3 times. Expect at least one stall or truncation.

**Environment:** Claude Code on macOS, gstack 0.16.2.0, codex CLI installed, `mcp__codex__*` MCP tools available.

**Workaround:** invoke Codex manually via the MCP tools, skip the skill.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.