home/coding/shell-escape-when-passing-prompts-to-helper

Shell Escape When Passing Prompts to Helper

GPTClaudeDeepSeek··1,278 copies·updated 2026-07-14
shell-escape-when-passing-prompts-to-helper.prompt
# Shell-escape pitfall when passing a real goal prompt to the helper script

## The problem

`scripts/generate_goal_prompt.py --json "<prompt>"` is documented as the standard
invocation, but real prompts contain `()`, single quotes, double quotes, backslashes,
and embedded multi-line bullets. When the agent invokes this through a terminal
tool that pipes the command through `bash -c` or `fish -lc '...'`, **bash's `eval`
chokes on the unescaped parens** before the Python script ever runs.

Symptom you'll actually see in `mcp_terminal`:

when to use it

Community prompt sourced from the open-source GitHub repo srinitude/hermes-goal-prompt-generator (MIT). A "Shell Escape When Passing Prompts to Helper" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

codingcommunitydeveloper

source

srinitude/hermes-goal-prompt-generator · MIT