You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,6 @@ You can also use Codex with an API key, but this requires [additional setup](./d
62
62
63
63
Codex CLI supports [MCP servers](./docs/advanced.md#model-context-protocol-mcp). Enable by adding an `mcp_servers` section to your `~/.codex/config.toml`.
64
64
65
-
66
65
### Configuration
67
66
68
67
Codex CLI supports a rich set of configuration options, with preferences stored in `~/.codex/config.toml`. For full configuration options, see [Configuration](./docs/config.md).
@@ -71,16 +70,20 @@ Codex CLI supports a rich set of configuration options, with preferences stored
71
70
72
71
Codex keeps a lightweight, per‑repository memory of key actions to help you recall decisions and changes in each project. Entries are written locally to `<repo>/.codex/memory/memory.jsonl` after tool use (shell exec, MCP tool calls) and patch application. The file is plain JSONL so you can search, back up, or clear it easily. See [Per‑repo memory](./docs/config.md#per-repo-memory-local) for details.
73
72
73
+
For backend choices (JSONL vs SQLite) and maintenance commands, see [memory backends](./docs/memory-backends.md).
74
+
74
75
Toggle per run (TUI or exec): add `--memory off` to disable, or `--memory on` to force‑enable. You can also set `CODEX_PER_REPO_MEMORY=0|1`.
75
76
76
77
Durable memory and smarter preamble
78
+
77
79
- Durable items: In addition to action logs (exec, tool, change), Codex records durable items you and Codex can reuse across turns:
78
80
-`pref`: your preferences and decisions (e.g., “Prefer Ruff + Black”).
79
81
-`summary`: short outcomes/facts captured on task completion.
80
82
-`decision`: approval checkpoints and key decisions.
81
83
- Smarter preamble: On new sessions, Codex injects a short “project memory” preamble built from recent `pref` and `summary` items. It deduplicates, merges tags, caps counts, and enforces a length limit so your prompt stays concise.
82
84
83
85
TUI: memory slash commands
86
+
84
87
- Add preference: `/memory add Use Ruff + Black`
85
88
- List recent durable: `/memory list 10`
86
89
- Search durable: `/memory search ruff`
@@ -89,6 +92,7 @@ TUI: memory slash commands
89
92
- Help: `/memory help`
90
93
91
94
What gets logged automatically (TUI)
95
+
92
96
- On task complete: a `summary` durable item with a compact preview of the last assistant message (kept brief).
93
97
- On approval request: a `decision` durable item noting the request (exec/patch).
|`inherit`| string |`all`| Starting template for the environment:<br>`all` (clone full parent env), `core` (`HOME`, `PATH`, `USER`, …), or `none` (start empty). |
394
-
|`ignore_default_excludes`| boolean |`false`| When `false`, Codex removes any var whose **name** contains `KEY`, `SECRET`, or `TOKEN` (case-insensitive) before other rules run. |
|`inherit`| string |`all`| Starting template for the environment:<br>`all` (clone full parent env), `core` (`HOME`, `PATH`, `USER`, …), or `none` (start empty). |
393
+
|`ignore_default_excludes`| boolean |`false`| When `false`, Codex removes any var whose **name** contains `KEY`, `SECRET`, or `TOKEN` (case-insensitive) before other rules run. |
395
394
|`exclude`| array<string> |`[]`| Case-insensitive glob patterns to drop after the default filter.<br>Examples: `"AWS_*"`, `"AZURE_*"`. |
396
395
|`set`| table<string,string> |`{}`| Explicit key/value overrides or additions – always win over inherited values. |
397
396
|`include_only`| array<string> |`[]`| If non-empty, a whitelist of patterns; only variables that match _one_ pattern survive the final step. (Generally used with `inherit = "all"`.) |
@@ -566,60 +565,62 @@ Options that are specific to the TUI.
566
565
567
566
## Config reference
568
567
569
-
| Key | Type / Values | Notes |
570
-
| --- | --- | --- |
571
-
|`model`| string | Model to use (e.g., `gpt-5`). |
572
-
|`model_provider`| string | Provider id from `model_providers` (default: `openai`). |
573
-
|`model_context_window`| number | Context window tokens. |
574
-
|`model_max_output_tokens`| number | Max output tokens. |
575
-
|`approval_policy`|`untrusted`|`on-failure`|`on-request`|`never`| When to prompt for approval. |
576
-
|`sandbox_mode`|`read-only`|`workspace-write`|`danger-full-access`| OS sandbox policy. |
577
-
|`sandbox_workspace_write.writable_roots`| array<string> | Extra writable roots in workspace‑write. |
578
-
|`sandbox_workspace_write.network_access`| boolean | Allow network in workspace‑write (default: false). |
Codex records a lightweight, per-repository memory of key actions to help you and external tools recall decisions and changes made in a project. This data is written locally to your repo and never leaves your machine.
622
621
622
+
For backend options and maintenance commands, see [memory backends](./memory-backends.md).
623
+
623
624
- Location: `<repo>/.codex/memory/memory.jsonl` (one JSON object per line)
624
625
- Scope: Automatically associated with the repository that contains `.git/` or `.codex/`.
625
626
- When entries are added:
@@ -635,11 +636,13 @@ Example (one line):
635
636
```
636
637
637
638
Notes
639
+
638
640
- This store is local-only and intended for project memory/history.
639
641
- Clearing: delete or truncate the file at `<repo>/.codex/memory/memory.jsonl`.
640
642
- Backups/exports: copy the JSONL file anywhere (each line is an entry).
641
643
642
644
Toggle
645
+
643
646
- Per run (both TUI and exec): pass `--memory off` to disable or `--memory on` to force-enable.
0 commit comments