Skip to content

codex:codex-rescue subagent has no way to get Bash permission in background mode — rescue.md should call companion directly #94

@fcsouza

Description

@fcsouza

Problem

When /codex:rescue --background is used, the rescue.md command spawns the codex:codex-rescue subagent in background mode.
Background agents cannot prompt the user for tool permissions, so the subagent's single Bash call is silently denied and it returns a permission error instead of running.

Passing mode: "bypassPermissions" when spawning the subagent does not resolve this, the mode is not respected in background execution.

Root Cause

The rescue.md command has allowed-tools: Bash(node:*), AskUserQuestion. This permits Bash in the command's own execution context, but Claude Code does not propagate allowed-tools to subagents the command spawns. The subagent starts without any inherited Bash access.

Suggested Fix

Since codex:codex-rescue is a one-liner forwarder that does nothing except call node .../codex-companion.mjs task ..., the subagent layer is unnecessary. rescue.md could call the companion script directly via its own Bash(node:*) permission and return the output verbatim — no subagent needed.

Workaround

Run the companion script directly from the main Claude context:

node "/Users/.../.claude/plugins/.../scripts/codex-companion.mjs" task --fresh "<task>"

Environment

- Claude Code with codex@openai-codex plugin
- macOS, Codex CLI 0.118.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions