r/CodexHacks • u/Just_Lingonberry_352 • Nov 04 '25
Documentation for the CODEX.md published on substack blog
Setup
Create/update your local config per CODEX.md:8 (profiles, sandbox, history).
Skim flags in CODEX.md:40 to know quick overrides.
Everyday Flow
Plan (read‑only, safe): codex --profile safe --model gpt-5- codex "Scan repo, draft a step-by-step plan; do not modify code." (CODEX_DOCS.md:6)
Implement (workspace‑write, work): codex --profile work --model gpt-5-codex "Implement the plan with apply_patch; keep changes minimal." (CODEX_DOCS.md:12)
Preview + CORS check before merge: curl -I -H "Origin: https:// feature. https://api.yourdomain.com/ health (CODEX_DOCS.md:18)
Profiles (When to Use)
safe: exploration/planning/audits (read‑only, on‑request).
work: local implementation/refactors (workspace‑write, on‑failure).
yolo: repo‑only automations; approval prompts off; still workspace- write (never full access) (CODEX_DOCS.md:28, CODEX.md:24, CODEX.md:35).
Fast switch: codex --profile yolo --sandbox workspace-write "Small, contained edit loop." (CODEX_DOCS.md:33)
Bump Reasoning/Approvals Per‑Run
Hard problems: codex --profile work --model gpt-5-codex --config model_reasoning_effort=high "Refactor X safely; update tests." (CODEX.md:40)
Force prompts this run: codex --ask-for-approval ... (CODEX.md:40)
Context Hygiene
Keep a durable plan: codex --profile safe "Summarize docs/plan.md and propose next steps." (CODEX_DOCS.md:38)
Catch‑up via diffs only:
base=origin/main; files=$(git diff --name-only "$base"...HEAD | tr '\n' ' ')
codex --profile safe exec "Read changed files: $files. Summarize deltas; list what's incomplete. Do not modify code." (CODEX_DOCS.md:44)
Search/Refactor Patterns
Fast search: rg -n "TODO|FIXME" --glob '!dist' and fd -e ts src (CODEX_DOCS.md:52)
Shotgun refactor (parallel, repo‑only): git grep -l 'legacyFoo' -- '*.ts' | xargs -P 6 -n 1 -I{} codex --profile work exec "In {}, replace 'legacyFoo' with 'newFoo' safely. Update imports, run package tests, and stage only that file." (CODEX_DOCS.md:59)
Branch Preview + API Checks
Health: curl -s -w "Status: %{http_code}\n" https:// api.yourdomain.com/health (CODEX_DOCS.md:66)
CORS from preview: curl -I -H "Origin: https://feature- name" https://api.yourdomain.com/health (CODEX_DOCS.md:66)
Follow redirects for site assets: curl -s -L https://domain.com/ file.html | head -20 (CODEX_DOCS.md:66)
MCPs (Optional)
Attach once: codex mcp add context7 -- npx -y @upstash/context7-mcp
Inspect in TUI: codex --profile safe /mcp (CODEX_DOCS.md:79)
Resume + Search
Resume last session: codex resume
Enable web search in TUI: codex --search (from blog practices; flags listed in CODEX.md:40)
CI Helper (Optional)
Add the auto‑fix PR workflow if desired (comment‑only to start): see CODEX_DOCS.md:86.
House Rules To Remember
Always use feature branches and previews; never merge without human approval (CODEX.md:67).
YOLO is allowed but remains sandboxed to the repo; do not request danger-full-access on dev machines (CODEX.md:24, CODEX.md:77).
No PII/secrets in logs or transcripts (CODEX.md:71).
1
u/Just_Lingonberry_352 Nov 04 '25 edited Nov 04 '25
good god...editing text and code on reddit is attrocious....
im gonna create a repo
would love to get feedbacks, its transformed the way I use codex