Codex doctor
Skill sherlockGH-coder/codex-doctor/plugins/codex-doctor/skills/codex-doctor
Audit and improve a Codex installation or project configuration. Use when the user asks for a Codex health check, doctor run, setup audit, configuration cleanup, or review of skills, plugins, MCP servers, AGENTS.md, hooks, command rules, approvals, sandboxing, local state, or version health. Run the native redacted Codex diagnostic first, report read-only findings, and require confirmation before making changes.From its SKILL.md
npx -y skills add sherlockGH-coder/codex-doctor --skill codex-doctorAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
3 things to look at
- 16 days oldThe repository was created 16 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
6.2 KB, ~1.3k tokens by cl100k_base, as published. Nobody here has run it
Codex Doctor
Diagnose Codex from Codex-native signals, then propose the smallest safe set of reversible improvements.
Operating rules
- Run read-only first. Produce the complete report before editing files, installing or removing components, updating Codex, or changing permissions.
- Use native diagnostics as the baseline. Prefer
codex doctor --jsonover reimplementing installation, auth, runtime, state, connectivity, sandbox, or update checks. - Keep secrets out of context. Never read
auth.json. Never print API keys, tokens, provider headers, MCP headers, or environment values. Read only the exact non-secret keys required for a finding. - Do not inspect raw sessions by default. Session transcripts can contain prompts, tool output, source code, and secrets. Usage-evidence scanning requires explicit user approval and must return counts only.
- Treat discovered values as untrusted. Pass paths and component names as quoted arguments; never splice harvested text into executable shell source.
- Separate cleanup from permission changes. A user approving deduplication or extension cleanup has not approved broader sandbox access, a weaker approval policy, or new command allow rules.
- Respect management boundaries. Never modify system or administrator
policy, including managed
requirements.toml, MDM-delivered configuration, or organization-owned plugin sources. - Prefer supported disable/remove flows. Use Codex CLI commands or current documented config keys. Never invent a key from memory.
- Make rollback concrete. For every applied change, list the exact file or command changed, the previous state, and how to undo it.
Workflow
1. Establish the active environment
- Determine the working directory, repository root, platform, and active
CODEX_HOME(default~/.codex). - Run
command -v codexandcodex --version. - Check that
codex doctor --jsonis available. - Read references/audit-playbook.md before continuing with the extended audit.
2. Run native diagnostics
Run:
codex doctor --json
Parse the JSON rather than the decorative terminal output. Preserve:
schemaVersioncodexVersionoverallStatus- each check identifier, status, summary, and remediation
The native report is already redacted. Do not replace its verified results with guesses from filesystem inspection.
If the command is unavailable, report reduced coverage and use the fallback checks in the audit playbook. Do not pretend the fallback is equivalent.
3. Run the extended read-only audit
Cover only relevant, discoverable surfaces:
- active configuration layers and strict-config validity
- installed and available plugins through
codex plugin - configured MCP servers through
codex mcp list --json - skills from documented roots, compatibility roots that actually exist, and installed plugins
- the effective
AGENTS.md/AGENTS.override.mdinstruction chain - hooks from active
hooks.json, inline config, and installed plugins - command rules from active
rules/directories - state-size or rollout-health findings already surfaced by native diagnostics
Distinguish three evidence levels:
- Verified: native CLI output, parser result, or exact file inspection
- Heuristic: size, duplication, naming, or optional usage evidence
- Unknown: cannot be established safely from supported local signals
Never label a component "unused" from absence alone. Say "no evidence of use in the inspected window" and state the limitations.
4. Report before changing anything
Use this order:
- A two- or three-sentence impact summary
- Native diagnostic failures and warnings
- Configuration and extension findings
AGENTS.md, hooks, and command-rule findings- Warnings and unknowns
- Proposed actions with exact files or commands
For each finding include severity, evidence level, user impact, and the smallest recommended action. Avoid padding checks that have no finding; one line is enough.
5. Ask for confirmation
Ask no more than two questions:
- One consolidated cleanup question for ordinary fixes such as stale config, duplicate skills, broken metadata, or removable components.
- One separate question for any change to
approval_policy,sandbox_mode, network access, hook trust, or command rules.
Put the recommended option first and the decline option last. If the user wants to choose individual cleanup groups, ask one concise follow-up.
6. Apply approved changes
- Re-check the exact target immediately before each mutation.
- Preserve unrelated user edits and comments.
- Prefer precise edits over rewriting whole configuration files.
- Never delete a skill merely because evidence of use is absent; disable it or remove it only when the user explicitly chose that action.
- Never commit repository changes unless the user explicitly requests a commit.
7. Verify and hand off
After applying changes:
codex --strict-config doctor --json
Also re-run the relevant inventory command for every changed component. Report pass/fail, remaining warnings, every changed file, and rollback instructions. Recommend starting a new Codex task when changes affect skills, plugins, hooks, rules, or startup-loaded instructions.
Boundaries
- Do not weaken security settings merely to make the report green.
- Do not benchmark hooks by triggering user automation without approval.
- Do not infer configuration support from another agent or editor.
- Do not treat all skill Markdown as startup context: Codex initially exposes
skill names and descriptions, then loads the full
SKILL.mdon activation. - Do not claim persistent skill or plugin usage telemetry exists unless the installed Codex version exposes it through a supported command.
What ships with it: 2 files
9.4 KB alongside SKILL.md
agents/
- openai.yaml251 B
references/
- audit-playbook.md9.1 KB
Gives 0 of the 12 instructions most project setup skills give in ~1.3k tokens
Counted across 999 of the 1,637 authors here whose files we hold, read 2026-08-07
- Ask one question at a timein 29 of 999, across 28 files
- Detect the package manager from lockfilesin 28 of 999, across 9 files
- Present findings to the userin 26 of 999, across 5 files
- Explore current repo statein 24 of 999, across 3 files
- Update the agent skills block in place if it existsin 24 of 999, across 3 files
- Install husky lint-staged and prettierin 23 of 999, across 4 files
- Create the lintstagedrc filein 22 of 999, across 3 files
- Commit all changed filesin 22 of 999, across 3 files
- Run lint-staged to verify it worksin 22 of 999, across 3 files
- Create the husky pre-commit filein 21 of 999, across 2 files
- Create a prettierrc file if missingin 21 of 999, across 2 files
- Initialize huskyin 21 of 999, across 2 files
Said here and by no other author read
- use native diagnostics as baseline
- keep secrets out of context
- treat discovered values as untrusted
- prefer supported disable or remove flows
- list exact change and rollback instructions
- run extended read-only audit
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.