openai / openai/codex-plugin-cc

/codex:status, /codex:transfer, /codex:cancel, /codex:result fail the Bash permission check — inline `!`…`` body is unmatchable

Open Beginner friendly
#600 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
33.3k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

Summary

Four commands invoke the companion script through an inline !`…` body. Claude
Code's Bash permission matcher receives that line as raw markdown — backticks, the
leading !, and the quoted script path included — and cannot reconcile it with any
permission rule. The commands hard-fail instead of prompting, and no user
settings.json change can fix it
, because the string being matched is not a shell
command.

The plugin's other four commands (review, adversarial-review, rescue, setup)
instruct Claude to call the Bash tool instead, and they work correctly. That
difference is the whole bug.

Error
Error: Shell command permission check failed for pattern
"!`node "/Users/<user>/.claude/plugins/cache/openai-codex/codex/1.0.6/scripts/codex-companion.mjs" status ""`":
Claude requested permissions to use Bash, but you haven't granted it yet.
Reproduce
  1. Install the codex plugin (v1.0.6).
  2. Run /codex:status.
  3. It fails as above. /codex:adversarial-review succeeds in the same session.
Affected files

commands/status.md, commands/transfer.md, commands/cancel.md, commands/result.md — each line 8:

!`node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" <subcommand> "$ARGUMENTS"`
Root cause

Known Claude Code limitation — anthropics/claude-code#16389. Two compounding
problems, both quoted from that issue:

  1. Raw markdown parsing — "the permission check includes markdown code fence
    markers, indicating the command isn't properly extracted from the markdown
    before validation."
  2. Quoted path mismatch — "the actual command wraps the script path in quotes
    for shell safety, but permission patterns don't account for these quotes."

The issue was closed as not planned on the Claude Code side, with the resolution
applied in the plugin instead (anthropics/claude-code#16632): "Migrates the
initialization from a Markdown-formatted code block to a functional Bash tool call…
The previous implementation used a !-prefixed code block, which the Claude Code
engine treats as a display-only suggestion or a legacy command format."

So the fix belongs here, not in Claude Code.

Suggested fix

Replace the inline body with an explicit Bash tool instruction — the same shape
review.md and adversarial-review.md already use, and the same remedy Anthropic
applied in #16632. The existing allowed-tools: Bash(node:*) frontmatter already
permits it, so no frontmatter change is needed:

-!`node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" status "$ARGUMENTS"`
+Run this with the Bash tool (the `allowed-tools` frontmatter above permits it),
+then follow the instructions below:
+
+```bash
+node "${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs" status "$ARGUMENTS"
+```

Verified locally against v1.0.6: all four commands work after this change (a
/reload-plugins or restart is needed to pick it up, since command definitions are
cached per session).

Environment
  • Claude Code 2.1.222
  • codex plugin 1.0.6 (marketplace openai-codex, autoUpdate: true)
  • macOS (darwin 25.6.0)

Happy to open a PR with the four-file change if useful.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Update commands/status.md, commands/transfer.md, commands/cancel.md, and commands/result.md at the affected command body, using review.md and adversarial-review.md as the working pattern. Replace the inline ! command with an explicit Bash tool instruction, then reload the plugin and run all four commands to confirm they no longer fail the permission check.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.