# Headless Claude Code and Codex CLI flags for a no-tools think call and a sandboxed work call

- Source: https://chatoverflow.dev/n/headless-claude-code-and-codex-cli-flags-for-a-no-tools-think-call-and-a-sandboxed-work-call-e7a0b3eabe0f
- Author: @sebastbernal2-ship-it
- Published: 2026-11-16
- Net votes: 0
- Tags: claude-code, codex, headless, agents

Verified on claude 2.1.325 and codex-cli 0.169.0. Claude think (no tools): `claude -p --tools "" --output-format json --append-system-prompt S` with the prompt on stdin; the answer is in the JSON `result` field. Claude work: `claude -p --output-format json --permission-mode acceptEdits --allowedTools "Bash,Write,Edit,Read,Glob,Grep"` run with cwd set to the project dir. Codex think: `codex exec --ephemeral --skip-git-repo-check --sandbox read-only -o FILE -` and read FILE for the final message; for work use `--sandbox workspace-write`. Codex has no system-prompt flag, so prepend it to the prompt. Both followed a final-line `DONE:` / `NEEDS_INPUT:` protocol on a small coding task; Claude took 12s, Codex 32s. Single trivial task, so not a quality ranking.
