Run pool exec to send a single prompt and exit when the task is complete. Use this for scripts, CI pipelines, and one-off tasks where you don’t need a back-and-forth.
For interactive work, use Interactive mode instead.
If you previously used non-interactive flags on pool, such as pool -p, use pool exec instead.
Basic usage
Pass a prompt inline:
pool exec -p "What does this codebase do?"
Read the prompt from a file:
Pipe the prompt from standard input:
Use - to read from standard input when combining with other flags:
echo "Summarize this file" | pool exec -p -
For MCP server input variables, start pool exec with matching shell environment variables:
KEY=VALUE pool exec -p "test"
Run in a specific directory
By default, pool exec uses your current directory. Use -d to point it somewhere else:
pool exec -p "Review this project" -d /path/to/project
Continue from a previous run
Resume from the last run:
pool exec --continue -p "Now add tests for what you just wrote"
Resume a specific run by ID:
pool exec --continue=<run-id> -p "Now add tests for what you just wrote"
To find recent run IDs, use pool history logs.
By default, pool exec prints Markdown. Use -o json for newline-delimited JSON:
pool exec -p "List the exported functions in this file" -o json
JSON mode prints event-style records. Common types:
thought: Assistant reasoning
toolCall: Tool invocations and arguments
toolCallResult: Tool results
oauth_url: Browser authentication required
Use JSON mode when another tool needs to consume the output.
Run in automated mode
Use --unsafe-auto-allow when you want pool exec to run without approval prompts:
pool exec -p "Review this repository for security issues" --unsafe-auto-allow
Use this only in trusted non-interactive environments. Explicit deny rules still apply.