# Ki Housekeeping Codex

> Governs repository-scoped Codex session acquisition and later housekeeping. Use for "acquire Codex sessions", "import Codex sessions", "audit Codex sessions", "clean up Codex sessions", or "delete old Codex threads". It guides discover, list, faithful read, checkpoint, staging, harvest, and safe later cleanup for one exact physical repository; it performs no automatic retention and never substitutes for portable repository maintenance owned by ki-work-housekeeping.

- Skill: `knowledgeislands/ki-housekeeping-codex` (Agent Skill, multi-file: 16 files)
- Install (CLI): `npx skillmds@latest add knowledgeislands/ki-housekeeping-codex`
- Raw SKILL.md: https://api.skillmd.com/api/skills/knowledgeislands/ki-housekeeping-codex/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: knowledgeislands (https://skillmd.com/u/knowledgeislands)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/knowledgeislands/ki-housekeeping-codex

---


# Codex session acquisition and housekeeping

Govern saved Codex-session acquisition and later cleanup through a review-before-delete workflow. Read the [Codex state standard](references/standards-codex-state.md) for the identity, artifact, and deletion contract.

The skill is opt-in while its machine-readable binding uses the experimental Codex app-server. It reads a complete provider payload only for an explicit acquisition operation, never applies automatic retention, and never infers repository ownership from a parent path or symlink alias. The `ki-work-housekeeping` skill continues to own recurring repository-maintenance work.

## AI session acquisition

Use the provider-neutral lifecycle: **acquire → stage → harvest → durable knowledge → archive/delete source**. For one exact physical repository, `mcp-housekeeping-codex` exposes read-only `codex_sessions_discover`, `codex_sessions_list`, `codex_session_read`, and `codex_sessions_checkpoint` operations. `list` and `checkpoint` are content-minimised provenance; `read` is the faithful source payload.

The MCP does not write Knowledge Islands state. `ki space acquire codex import` will own inbound staging and incremental checkpoint persistence. Do not archive or delete a Codex session until acquisition, review, and harvesting have passed their later safety checkpoint.

## Operating modes

With no clear mode, explain the skill and its modes first; in an interactive session, then ask which mode and target to use. `help`, `-h`, and `?` explain and stop without starting app-server or changing state.

### Mode AUDIT

Read [the AUDIT procedure](references/mode-audit.md). It produces a content-minimised JSON review artifact on standard output and performs no deletion.

### Mode CONFORM

Read [the CONFORM procedure](references/mode-conform.md). It requires a previously reviewed artifact, exact root-thread selections, and the destructive confirmation phrase. It revalidates the complete selection before the first delete.

### Mode EDUCATE

Explain the exact-working-directory identity rule, active and archived inventory, descendant impact, review artifact, stable single-session CLI fallback, experimental app-server boundary, and permanent deletion consequence. Do not run AUDIT or CONFORM unless separately requested.

### Mode REFRESH

Read [the REFRESH procedure](references/mode-refresh.md). REFRESH writes only the canonical `ki-housekeeping-codex` source in `ki-agentic-harness`; when invoked from an installed copy, stop and redirect to the Harness.

## Runtime adapter

Run `bun scripts/app-server.ts --help` from this skill root for the public adapter contract. The MCP adapter exposes discovery, list, faithful read, and checkpoint in addition to the review/delete CLI; private protocol logic remains inside the same source module so its safety fixtures exercise the public behaviour directly.

## Off-ramps

- Recurring repository-owned maintenance work belongs to `ki-work-housekeeping`.
- Codex instruction and configuration token evidence belongs to `ki-tokenomics-codex`.
- Unsupported Codex cache and automatic retention stay out of scope.

