AI AI Tools Guidebook
Home AI Tool Tutorials AI Use Cases Prompt Library About
🌐 中文
Home / #Codex

#Codex

Articles tagged with #Codex

Troubleshooting

Codex Committed to the Wrong Branch (or Straight to main)

Codex landed your work on main, on a leftover branch, or split it across two — because cloud tasks default to your repo's default branch and local worktrees collide. How to force clean per-task isolation, plus how to rescue commits that already landed wrong.

May 24, 2026 #Codex #AI coding
Troubleshooting

Codex Stalls on a Merge Conflict or Resolves It the Wrong Way

Codex hits conflict markers and stalls, picks the wrong side, or commits the markers into the file. Rebase in setup, an AGENTS.md stop-on-conflict rule, and a pre-commit hook fix it.

May 24, 2026 #Codex #agent
Troubleshooting

Codex Added a Package but the Lockfile Did Not Change

Codex edited package.json but never ran npm install, so package-lock.json diverges and npm ci fails. Fix it with setup.sh, a CI sync check, and AGENTS.md rules.

May 24, 2026 #Codex #agent
Troubleshooting

Codex Fix Passes Every Test but Breaks at Runtime

Codex's PR is green in CI but the app crashes after deploy. Why agent fixes that target the test surface miss the runtime, and the smoke-gate that closes the gap.

May 24, 2026 #Codex #AI coding
Troubleshooting

Codex Creates a Duplicate TypeScript Interface for One That Already Exists

Codex defines a fresh User or ApiResponse type when an identical one already lives in your repo. Make the agent search first using AGENTS.md, a types barrel, ripgrep, and a ts-morph CI check.

May 24, 2026 #Codex #agent
Troubleshooting

Codex Rewrote Git History You Did Not Want Touched (amend / rebase / force-push)

Codex ran git commit --amend, an interactive rebase, or force-pushed and rewrote shared history. Lock the agent to forward-only commits with AGENTS.md, the sandbox network toggle, and a GitHub ruleset.

May 24, 2026 #Codex #agent
Troubleshooting

Codex PR Description Says "Refactored Components" and Nothing Else

Codex emits a one-line PR body with no detail. Force a structured description (before/after, why, test plan) with a PR template, AGENTS.md, and a CI gate; plus the Codex Cloud button caveat.

May 24, 2026 #Codex #agent
Troubleshooting

Codex Says Tests Passed but Actually Skipped the Failures

Codex reports green tests but the failing cases were filtered out, marked .skip, or bailed early. How to force honest test reporting before merge.

May 24, 2026 #Codex #agent
Troubleshooting

Codex Stops Mid-Refactor on a Large Diff: How to Finish the Job

Codex hits a context limit mid-task and leaves a half-applied patch. Scope tasks to one verb, split into multi-PR plans, tune auto-compaction, and resume cleanly with config that works as of June 2026.

May 24, 2026 #Codex #agent
Troubleshooting

Stop Codex Writing componentWillMount and Other Deprecated APIs

Codex injects API patterns deprecated years ago because its training data lags. Lock it to modern APIs with AGENTS.md rules, the @typescript-eslint/no-deprecated lint rule, and current reference docs.

May 24, 2026 #Codex #agent
AI Tool Tutorials

Claude vs Codex for PM Tasks (June 2026): Which Saves More Time

Side-by-side on PRDs, JIRA grooming, and doc cleanup — with current pricing, models, and a 90-minute test you can run on your own week of work.

May 23, 2026 #Claude #Codex
Troubleshooting

Codex Agent Output Conflicts With Prettier

Codex writes a file, Prettier reformats it on save, and the diff explodes. Fix it by running the project's pinned Prettier inside the agent loop and aligning AGENTS.md style hints to .prettierrc.

May 23, 2026 #Codex #agent
Troubleshooting

Codex Agent Goes Out-of-Context on Long Repos

On 500k+ line repos Codex loses the thread halfway. Fix it by scoping the working set, pre-feeding directory summaries, and putting conventions in AGENTS.md so they survive compaction.

May 23, 2026 #Codex #agent
Troubleshooting

Codex Agent Silently Skips Files Containing Binary Data

Codex quietly drops PNGs, PDFs, sqlite DBs, and compiled artifacts from audits. Fix it by probing binaries (file + wc -c + sha256sum), allowlisting text extensions, and forcing a no-omit output schema.

May 23, 2026 #Codex #agent
Troubleshooting

Codex Agent Makes Too Many Redundant Tool Calls (Fix)

Codex re-reads the same file 8 times and re-greps the same query 5 times. Fastest fix: run /plan first, add an AGENTS.md repo map, and keep reasoning effort at medium. Full diagnosis below.

May 23, 2026 #Codex #agent
Troubleshooting

Codex Stops Mid-Task With No Error: Causes and Fixes

Codex halts halfway through a multi-step task with no error — usually context compaction, a sandbox/approval denial, or a premature stop signal. Diagnose by the last tool call, then resume with codex resume --last.

May 23, 2026 #Codex #agent
AI Tool Tutorials

Every Codex CLI Keyboard Shortcut (June 2026)

A verified Codex CLI keyboard shortcut reference: cancel and interrupt keys, newline with Ctrl+J, Ctrl+G external editor, Ctrl+R history search, Esc Esc to edit, Shift+Tab approval modes, and terminal fixes.

May 22, 2026 #AI coding #Codex
AI Tool Tutorials

Codex Skills and /skills: Built-in, Custom, and Team-Shared (2026 Guide)

How Codex Agent Skills work in June 2026: what a SKILL.md is, the exact .agents/skills/ load order, how /skills and $name invocation differ, and skill vs AGENTS.md vs MCP vs plugin.

May 22, 2026 #AI coding #Codex
Troubleshooting

Codex Can't Access a Private Repo: Fix the 3 Permission Layers

Codex shows "unable to clone" or "Repository not found"? Usually the ChatGPT Codex Connector GitHub App isn't installed on the org, the repo isn't in its allowlist, or your SSO/OAuth grant lapsed. Fix it in priority order.

May 21, 2026 #Codex #Troubleshooting
Troubleshooting

Codex Environment Setup Fails Before the Task Starts

Codex stalls at Setting up environment — usually a runtime mismatch, a private-registry token, or an install that blows past the cached container. The fast fixes, verified for June 2026.

May 21, 2026 #Codex #Troubleshooting
Troubleshooting

Codex PR Too Large to Merge

50 files, 1,500 lines, nobody will review it. Cap diff size with Codex Plan Mode, an AGENTS.md PR budget, and a CI gate — and split the one you already have.

May 21, 2026 #Codex #Troubleshooting
AI Tool Tutorials

Codex Beginner Guide: Sandboxed Cloud Coding Without the Pitfalls (2026)

How OpenAI Codex runs sandboxed cloud and CLI coding tasks in 2026: which ChatGPT plan you need, the GPT-5.5 default, the task-spec format that produces reviewable PRs, and the mistakes that bite first-time users.

May 17, 2026 #AI coding #Tutorial
AI Tool Tutorials

Codex Code Review Workflow: Catch Bugs Before Human PR Review

Set up OpenAI Codex as a pre-reviewer with the /review command, @codex review on GitHub, and AGENTS.md guidelines that produce P0/P1 findings.

May 17, 2026 #AI coding #Tutorial
AI Tool Tutorials

Audit Your Sitemap With Codex: A Step-by-Step Workflow

Use Codex CLI to spot-check sitemap correctness, freshness, and hreflang coverage against your real build output.

May 17, 2026 #Tutorial #SEO
Troubleshooting

Codex Audit Report Is Too Broad to Act On

Asked Codex to audit your project and got a 50-bullet report mixing typos with architecture? Re-scope to one dimension, cap output, force file:line, use /review's custom-instructions preset.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Cannot Finish a Patch Cleanly

Codex says "done" but leaves broken imports, half-converted types, and untouched call sites. Bind "done" to a verifier in AGENTS.md, then check the exit code yourself.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Duplicates Files Instead of Editing Existing Ones

Codex creates `utils.v2.ts` next to `utils.ts` instead of editing in place. The real cause is an apply_patch Update→Add fallback. Force in-place edits with AGENTS.md rules, git, and the right sandbox mode.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Fails to Run or Interpret Build Results

Codex skips the build, misreads it, or trusts a truncated tail. Fix it with exit-code checks, machine-readable verifiers, and a Stop hook gate — not prose summaries.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Fixes One Bug But Breaks Nearby Logic

The reported bug is gone, two adjacent features regressed. Cap blast radius, enumerate call sites, prefer caller-side guards over shared-util changes.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Ignores Your Project Structure: The AGENTS.md Fix

New files land in /src/ when your repo uses /app/; deps go to the root package.json in a monorepo; tests use a framework you don't have. Fix it with a root AGENTS.md, nested overrides, and canonical-example pointers — verified against Codex behavior, June 2026.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Makes Unsafe Assumptions

Codex uses a column, env var, or function signature it never read. Force a quote-before-write rule and run Codex read-only so it grounds every line in your real files.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Misses Project-Specific Conventions: Fix With AGENTS.md

Codex writes `getUserById` when your codebase uses `findUserById`. Codify each convention as rule + a canonical example file in AGENTS.md, then verify it loaded.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Patch Conflicts With Existing Code

Codex fails with "Invalid Context" or "No such file or directory" when applying a patch. Tell the two apart, then refresh state or restart the session.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Code Review Feels Too Shallow? Fix It

Codex review returns generic bullets like "consider error handling." Fix it with the built-in /review command, AGENTS.md review guidelines, and file:line-anchored prompts.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Code Does Not Match Your Codebase Style: The Fix

Functionally correct but reads like a stranger wrote it: async/await mixed with .then(), wrong import order, off comment style. Anchor Codex to a canonical file in AGENTS.md, then enforce the rest with lint.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Test Suggestions Are Too Generic

"Test the happy path and error path" is useless filler. Force Codex to bind tests to the real function signature, the actual types, edge cases, and bug history.

May 17, 2026 #Codex #Coding agent
Troubleshooting

Codex Output Doesn't Match Project Structure

Codex puts files in the wrong place or ignores your conventions. Constrain it with AGENTS.md, a sibling-file reference, and plan-first prompting.

May 17, 2026 #AI coding #Debug
Indie Dev & Website Building

Prompt Design for AI Website Building (Stop the Drift)

Keep coding agents on-spec across a multi-file build: a CLAUDE.md/AGENTS.md template, a 3-part per-task prompt, and the spec-file rules that matter as of June 2026.

May 15, 2026 #Indie dev #AI-assisted build
Indie Dev & Website Building

SEO Review of Your Site With Codex: Exact Prompts

Run a technical SEO review with Codex using copy-paste prompts for canonical, hreflang, title/meta, sitemap, and JSON-LD checks — plus shell commands that verify every finding.

May 15, 2026 #Indie dev #AI-assisted build
AI Tool Tutorials

Codex vs Claude Code: Which AI Coding Agent to Use (June 2026)

OpenAI Codex and Anthropic Claude Code are both agentic coding tools, but they run in different places and bill differently. A specific, up-to-date comparison with prices, models, and benchmarks.

May 12, 2026 #Claude #Codex
AI AI Tools Guidebook

A bilingual content site focused on AI tools and digital productivity.

Navigation

  • AI Tool Tutorials
  • AI Use Cases
  • Prompt Library
  • Indie Dev & Website Building
  • Troubleshooting
  • Official Resources & Docs

Legal

  • About
  • Contact
  • Privacy
  • Terms
  • Disclaimer
  • Editorial Policy
  • Affiliate Disclosure
  • RSS Feed
© 2026 AI Tools Guidebook. All rights reserved.