OpenAI Codex · tool · fg-0497
codex exec exits 1 with 'Not inside a trusted directory and --skip-git-repo-check was not specified'
Not inside a trusted directory and --skip-git-repo-check was not specified.
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
Codex requires commands to run inside a Git repository as a guard against destructive changes, and the full-access flags do not lift that check.
Fix
Run inside a Git repository (git init works for scratch workspaces), or add --skip-git-repo-check in an environment you control.
Apply
codex exec --skip-git-repo-check --sandbox workspace-write "task"
Affects: Codex CLI codex exec, as of 2026-10
Sources
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp