Overview
Test your documentation by giving Claude Code and Codex real tasks that depend on it in a clean sample project, read where each agent went wrong, and revise the docs on a branch before rerunning the same tasks.
Problem or Objective
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- Claude Code · Codex CLI · Git
- Prerequisites
- Claude Code with its non-interactive -p mode (most surfaces require a Claude subscription or Anthropic Console account), Codex CLI signed in with a ChatGPT plan or an API key, a set of tasks with checks, and a throwaway sample project.
How It Works
Write five to ten realistic tasks a developer would do with your product using only the docs, each with a check that shows success (a test passes, a command prints the expected output). Make a clean sample project that contains your published docs as files and nothing else about the product. Run each task through Claude Code non-interactively with -p from a small script, saving the output of every run to a file, and run the same tasks in Codex CLI in its own copy of the project. Read the saved runs: note where an agent searched for something the docs never say, followed an outdated example or guessed a parameter. Group those notes by docs page, then ask Claude Code to draft revisions to those pages on a separate branch, quoting the confusion each change addresses. Have the docs owner review the changes, then rerun the same tasks on the revised docs and compare which checks now pass. Keep the task list and checks so the loop can be repeated after each release.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Claude Code, Codex CLI.
- Connect the toolsConnect the tools this workflow relies on: Claude Code, Codex CLI, Git.
- Check the prerequisitesClaude Code with its non-interactive -p mode (most surfaces require a Claude subscription or Anthropic Console account), Codex CLI signed in with a ChatGPT plan or an API key, a set of tasks with checks, and a throwaway sample project.
- Gather your detailsCollect what the prompt asks for: Folder with the saved runs, File listing the tasks and checks, Docs folder, Branch for the revisions.
- Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at code.claude.com before you rely on it.
Practical Starter Prompt: Find where the docs confused the agents
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
Read the saved agent runs in [Folder with the saved runs] for the tasks in [File listing the tasks and checks]. For each failed or slow run, note the step where the agent went wrong and which page in [Docs folder] it was relying on. Group the notes by page. Then, on a new branch named [Branch for the revisions], draft revisions only to those pages, and for each change quote the confusion it addresses. Do not change product code, delete pages or merge anything; I will have the docs owner review the branch before we rerun the tasks.Run the tasks in a throwaway sample project. Have the docs owner review the branch, then rerun the same tasks and compare the checks before merging.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. Anthropic's documentation says Claude Code can run non-interactively with the -p flag and is available as a CLI for scripts and CI/CD. The Codex CLI README describes signing in with a ChatGPT plan to use Codex locally. Neither source describes documentation testing, so how much the revised docs help depends on how realistic the tasks and checks are.
Limitations and Considerations
An agent getting stuck is a signal, not proof that a page is wrong; a person who knows the product decides every change. Run the tasks in a throwaway project: a -p session without --bare runs the project's hooks and connects its MCP servers, even in a folder you have never trusted. Each run uses your plan or API usage, so start with a small task set. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Visit Website (opens in a new tab)code.claude.com
Related Videos
About anthropics/claude-code
The SECRET Claude Code Upgrade That Has Everyone Going Nuts (Full Guide) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)About openai/codex
Meet the New Codex CLI (opens in a new tab)
Published by the project’s official channel.
Watch on YouTube (opens in a new tab)About anthropics/claude-code
The only Claude Code guide you'll ever need (Opus 4.5) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- Run Claude Code programmatically - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 26 Nov 2026, 17:27 UTC
What this source supports
- Add the -p (or --print ) flag to any claude command to run it non-interactively.
- It's available as a CLI for scripts and CI/CD, or as Python and TypeScript packages for full programmatic control.
- Without --bare , a -p session runs the hooks in a project's .claude/settings.json and connects the servers in its .mcp.json , even in a folder you've never trusted.
- openai/codex README (opens in a new tab)
Project documentation · github.com · Undated · Source checked 25 Nov 2026, 11:59 UTC
What this source supports
- We recommend signing into your ChatGPT account to use Codex as part of your Plus, Pro, Business, Edu, or Enterprise plan.
- Overview - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 11:57 UTC
What this source supports
- Most surfaces require a Claude subscription or Anthropic Console account.


