---
title: Codex
description: Install GitKB skills and project instructions for Codex, with optional home and hook integration.
---

# GitKB with Codex

GitKB's Codex integration installs reusable workflows and a project instruction entry point. Connect the MCP server separately to give Codex access to the KB tools.

## Scaffold project guidance

After [initializing your KB](/docs/getting-started/quick-start/), preview and install the integration:

```bash
git-kb init codex --dry-run
git-kb init codex
```

The scaffold creates:

```text
.kb/skills/                 # Canonical GitKB workflow skills
.codex/
├── skills/                 # Links to .kb/skills/<name>
└── instructions/
    ├── codex-rules.md
    └── gitkb-process.md
AGENTS.md                   # GitKB workflow section and .kb/AGENTS.md pointer
```

The root `AGENTS.md` supplies the project entry point. The installer preserves existing content while adding its GitKB section. Skills include `remote-sync` alongside code-intelligence and task workflows; see [Agent Harnesses & Skills](/docs/reference/agent-harnesses/) for the inventory.

## Connect MCP

Register the stdio server:

```bash
codex mcp add gitkb -- git-kb mcp
codex mcp list
```

Codex stores MCP settings in its `config.toml`. Run sessions in the project so GitKB finds the intended `.kb/`, or set `GITKB_ROOT` explicitly in the server configuration. See [MCP Setup](/docs/getting-started/mcp-setup/) and the [official OpenAI MCP documentation](https://developers.openai.com/codex/mcp).

## Optional home installation

To expose the integration through your Codex home, run:

```bash
git-kb init codex --install-home
```

This uses `$CODEX_HOME` when set, otherwise `~/.codex`. Use `--copy` when you want copied assets instead of symlinks. Preview either operation with `--dry-run`.

## Optional hooks

Install GitKB's Codex plugin bundle explicitly when you want its code-intelligence hooks:

```bash
git-kb init codex --install-hooks --dry-run
git-kb init codex --install-hooks
```

This writes the plugin bundle under `.codex/plugins/gitkb/` and registers it with Codex. Restart Codex, then review the installed hooks with `/hooks`, as the installer instructs. The bundle includes MCP configuration; inspect existing server entries when combining it with a manual MCP setup.

## Example workflow

The same commands are available through the CLI or corresponding MCP tools:

```bash
git-kb context --compact --code-refs
git-kb board --json
git-kb checkout tasks/auth-refactor
git-kb workspace path tasks/auth-refactor --json
git-kb code callers authenticate --json
# Edit the task's workspace file to record findings and verification.
git-kb commit -m "Record auth refactor verification" tasks/auth-refactor --json
```

Keep the task's scope, acceptance criteria, and actual verification results together so another session can continue from the evidence.

## Next steps

- [Claude Code](/docs/getting-started/claude-code/) — Claude integration
- [Agent Workflows](/docs/guides/agent-workflows/) — Session and task workflow
- [Code Intelligence](/docs/core-concepts/code-intelligence/) — Symbols, calls, and impact
- [CLI Reference](/docs/cli-reference/) — `init codex` options
