--- disable-model-invocation: true name: reindex description: Regenerate Cortex's deterministic memory index from current node files. metadata: cortex-canonical: commands/reindex.md codex-status: supported chatgpt-work-status: supported --- # Cortex: reindex This is a thin host adapter. Starting from this loaded `SKILL.md` file, walk upward to the nearest directory containing `AGENTS.md`, `commands/reindex.md`, and `scripts/cortex_cli.py`; call it ``. Do not assume the current working directory is the Cortex repository. If no such root is readable, stop. Read `/AGENTS.md`, `/commands/reindex.md`, `/references/core-contract.md`, and the current host's column (Claude Code, Cowork, Codex, or ChatGPT Work) in `/references/capability-matrix.md` completely before acting. The command file is the workflow authority. If those sources conflict, stop and report the conflict instead of inventing behavior. ## Invocation On Claude, use the text following `/reindex`; on Codex, use the text following `$reindex`; in ChatGPT Work, use the user's text after selecting Cortex or this skill with `@`. Natural-language activation is also allowed when the request clearly matches the description. ## Host binding 1. Resolve `` through the shared `scripts/lib/config_root.py` precedence chain. On filesystem-capable hosts, `/hooks/session_start.py --print-root` is available. In cloud Work, call `cortex_status`; the MCP bridge resolves the same chain on the machine that owns the memory. Do not create a host-specific pointer. 2. Require `filesystem.read` for memory access. On Claude Code, Codex, or Local Work, the resolved root must be inside the host's readable/writable roots as appropriate; Cowork requests its directory grant. In cloud Work, use `cortex_recall` and `cortex_search`; never claim direct access to device files. 3. Bind every optional operation through `references/capability-matrix.md`. Skip unavailable connectors, web search, scheduling, artifacts, or delegation exactly as that capability's degrade rule says. 4. Treat model-tier names in the canonical workflow as cost/latency intent. Use a host-available low-cost/fast model when possible; otherwise run inline and disclose the degradation. ## Mutation boundary For every local write under `/memory/`, shell out to `/scripts/cortex_cli.py` or import the existing implementation from `/scripts/lib/`. In cloud Work, use `cortex_configure` only for a confirmed first-run pointer setup; for memory mutations use only `cortex_add_note`, `cortex_update_section`, `cortex_reindex`, and `cortex_refresh_hot`. Show the exact proposed change and obtain confirmation before setting `user_confirmed=true`. Replacing an existing pointer requires a separate confirmation before `force_pointer=true`. The bridge intentionally has no move, delete, append-line, or whole-file-write tool; preview or skip those steps. Never hand-edit memory files and never reimplement locking, atomic replacement, index generation, or hot-cache generation. If the canonical step has no deterministic CLI/library path, show a proposed change or skip that step; do not turn prose into an unreviewed write. Session-end hooks are best-effort reminders, never proof that `/remember` completed. ## Adapter status: supported The canonical workflow is supported on Codex under the capability binding below. The operation is implemented by cortex_cli.py reindex. The workflow is supported in ChatGPT Work through the bounded Cortex MCP tools. End with a concise account of what was read, what changed, which optional capabilities were unavailable, and which partial steps were left unapplied.