> ## Documentation Index
> Fetch the complete documentation index at: https://docs.specpilot.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex

> What SpecPilot writes for OpenAI Codex: two instruction files and nine prompt files you copy to your home folder.

Choose Codex when SpecPilot asks which AI IDE you use, or pass `--ide codex` to `specpilot init` or `specpilot add-specs`.

## Files

| File | What it is |
| - | - |
| `CODEX_INSTRUCTIONS.md` | Instructions for Codex: project overview and how the `.specs/` folder is used |
| `.github/copilot-instructions.md` | The rules file SpecPilot also writes for Copilot |
| `.codex/prompts/specpilot-*.md` | The nine commands as prompt files |
| `.gitattributes` | Lines that let git merge `tasks.md` and `prompts.md` from two branches without conflicts. Added to an existing file. |

## Commands

Codex finds prompts only in `~/.codex/prompts/` in your home folder, so copy the files there yourself:

```bash theme={null}
mkdir -p ~/.codex/prompts && cp .codex/prompts/specpilot-*.md ~/.codex/prompts/
```

Copy them again after Regenerate All or `specpilot backfill` updates them. What each command does: [Commands and skills](https://docs.specpilot.dev/concepts/commands-and-skills.md).

## Connect the local MCP

Add SpecPilot to `~/.codex/config.toml` in your home folder. See [Connect your AI IDE](https://docs.specpilot.dev/mcp/connect.md).

## Files you already have

SpecPilot never changes a file that already exists: it keeps it and lists it at the end. Run `specpilot backfill` to add missing SpecPilot sections to it.

## Keep them current

After you upgrade SpecPilot, run Regenerate All in the App (see [Regenerate commands and skills](https://docs.specpilot.dev/app/regenerate.md)) or `specpilot backfill`. Command files you edited are kept.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.