Skip to content

feat: promote codex-rescue to ~/.claude/agents/ at setup time to support permissionMode #101

@fcsouza

Description

@fcsouza

Problem

Plugin subagents cannot use permissionMode — Claude Code intentionally ignores it for security reasons. This
means codex:codex-rescue cannot get Bash permission in background mode, where permission prompts are impossible
and auto-denied.

Related bug: #94

Proposed Solution

Update /codex:setup to copy plugins/codex/agents/codex-rescue.md into ~/.claude/agents/ with permissionMode: bypassPermissions added.

Regular agents in ~/.claude/agents/ fully support permissionMode, so the subagent would work correctly in background mode after setup.

Changes needed

  1. scripts/codex-companion.mjs — setup command copies the agent file to ~/.claude/agents/codex-rescue.md with
    permissionMode: bypassPermissions injected
  2. Add a version/hash check so re-running /codex:setup after a plugin update refreshes the copied file
    automatically
  3. /codex:setup output informs the user the agent was installed to ~/.claude/agents/

Tradeoff

Requires the user to run /codex:setup once to get the fix. Anyone who skips setup still has the broken plugin subagent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions