Skip to content

codex-cli-runtime skill should instruct agents to use --prompt-file for shell-safe prompt passing #388

Description

@maureenius

Problem

The codex-cli-runtime skill instructs the codex:codex-rescue subagent to pass task prompts as positional arguments:

node "$CODEX_COMPANION" task "<raw arguments>"

When the prompt contains shell metacharacters (backticks, ${}, (), file paths), zsh interprets them before node receives the argument. This causes the Codex task to fail silently.

Observed errors

(eval):1: permission denied: app/services/results/serial_codes/destroy_service.rb
(eval):1: command not found: find_serial_code
(eval):1: no matches found: .record_limit(count)
(eval):1: parse error near `}'
(eval):1: parse error in command substitution

Root cause

The skill definition (skills/codex-cli-runtime/skill.md) only mentions positional argument passing. However, codex-companion.mjs already supports --prompt-file (line 614, readTaskPrompt function) and piped stdin (readStdinIfPiped).

Suggested fix

Update skills/codex-cli-runtime/skill.md to instruct agents to:

  1. Write the prompt to a temp file
  2. Pass it via --prompt-file /path/to/file instead of as a positional argument

This avoids shell metacharacter expansion entirely.

Environment

  • Claude Code 2.1.185
  • codex plugin 1.0.4
  • macOS (zsh)

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