Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
---
title: Codex
description: Use OpenKnowledge with Codex.
icon: custom/Codex
---
OpenKnowledge works with Codex through MCP plus an installed skill.
## Install
<McpInstall editor="Codex" />
## Trust the project
The user-level entry `ok init` writes to `~/.codex/config.toml` is not affected by project trust, so with the default setup the agent already sees the tools. Trust matters if you registered project-level only, or want the project skill and `.codex/config.toml` entry active: Codex loads project-scoped `.codex/` layers only in a project you have trusted. The CLI asks the first time you run `codex` there, but `codex exec` cannot ask and older builds may not remember the answer.
<Callout type="warn">
Trust is not scoped to the MCP entry: a trusted project loads its whole `.codex/` layer, meaning project config, hooks, and exec policies, which widen what commands Codex runs without asking, and Codex applies the decision at the Git repository root, so every nested `.codex/` directory in that repo is trusted too. `ok init` commits `.codex/config.toml` and `.codex/skills/` so the repo is ready for teammates, which means a knowledge base you cloned carries a `.codex/` layer someone else wrote. Read it before trusting it.
</Callout>
If you're scripting with `codex exec`, run `codex` interactively in the project once and answer the prompt; on current builds that persists the decision for later non-interactive runs. If the tools still don't appear after you answered the prompt, or you can't run `codex` interactively at all (CI, cron), mark the project trusted by hand in `~/.codex/config.toml` (or `$CODEX_HOME/config.toml` when `CODEX_HOME` is set):
```toml
[projects.'/absolute/path/to/your/repo']
trust_level = "trusted"
```
Use the absolute path of the Git repository root; Codex matches the key exactly. The key is a TOML literal string, so a Windows path needs no escaping: `[projects.'C:\Users\you\repo']`. See OpenAI's [advanced configuration](https://developers.openai.com/codex/config-advanced) docs.
## Open with AI
From the editor, **Open with AI ▸ Codex** dispatches the current file, folder, or project to Codex in one click. Entry points include the sidebar's right-click menu (file / folder / empty space), the **File → Open with AI** menu, and the Command Palette. You can also hand the current doc to Codex from the bottom **Ask AI** composer.
Codex receives a short prompt asking it to open the target in OpenKnowledge's web preview. The agent then grounds the rest of the conversation through MCP. See [Editor → Open with AI](/docs/features/editor#open-with-ai) for the full UX.
## Verify
Open the project in Codex and ask:
<VerifyExec />
If you don't see the tool, check that the project is trusted first, then restart Codex. If it's still missing and `ok init` reported your config was `left unchanged`, the reason in parentheses says why `~/.codex/config.toml` (or `$CODEX_HOME/config.toml` if set) was left untouched. For config problems, fix the file and re-run `ok init`; for `no format-preserving writer available`, your config isn't the problem — OpenKnowledge can't rewrite the file safely on this platform, so add an `open-knowledge` entry to `mcp_servers` by hand (command: `ok mcp`).
OpenKnowledge Beta registers as `open-knowledge-beta` instead; see [Beta uses its own entry](/docs/reference/what-open-knowledge-writes#beta-uses-its-own-entry).
## Scheduled runs
The ChatGPT desktop app runs Codex on a schedule from its **Scheduled** view. Tasks run unattended under your default sandbox, against your local project or an isolated background worktree, and the app must be running for tasks that need local files. See OpenAI's [scheduled tasks](https://learn.chatgpt.com/docs/automations) docs. Codex CLI has no scheduler of its own; use [`codex exec`](https://learn.chatgpt.com/docs/non-interactive-mode) from OS cron instead. Described as of August 2026, while the ChatGPT and Codex surfaces are still changing quickly.
The meeting-sync prompt in [Ingest meetings](../workflows/meeting-ingestion.mdx#automatically-on-a-schedule) works verbatim as a scheduled task.