A backup-first Codex skill for keeping local Codex state fast, clean, and recoverable.
A backup-first Codex skill for keeping local Codex state fast, clean, and recoverable.
When Codex starts feeling heavy after weeks of chats, terminals, logs, worktrees, and project history, this gives you a calm way to inspect what is going on and reduce local drag.
This skill helps you organize local state without losing context.
The rule is simple:
Make handoffs first. Archive, don't delete. Apply changes only when you are ready.
--apply --repair-thread-metadata-bloat; shortens oversized SQLite display title/preview metadata after backup. The transcript stays intact.Use this if Codex has started feeling slower after heavy use, especially if you:
By default, this skill only reports. It does not write files, create backups, move folders, or change local Codex state until you explicitly ask it to.
It helps Codex:
Ask Codex:
Use $keep-codex-fast to inspect my Codex local state and recommend a safe maintenance plan.Codex should show you what it found first. Then you decide what to hand off, what to keep active, and what can be archived.
Before archiving old active chats, create handoff documents for any repo/session you may want to continue.
A handoff is a small continuity note. It captures:
That lets you archive the heavy chat and start a fresh Codex thread from the handoff.
Copy this into each active repo chat you care about:
…After handoffs exist for the chats you care about, use this:
Use $keep-codex-fast to apply safe Codex maintenance.
Before changing anything, confirm that important active repo chats have handoff docs or do not need them.
Then back up first, archive instead of deleting, move stale worktrees, rotate large logs, prune dead config references, and verify the result.
If Codex is currently running, do not mutate local state. Tell me to close Codex first.Some Codex builds can store a full first user prompt as both the thread title and the list preview. When those fields grow into hundreds of thousands of characters, thread navigation can become sluggish even before a large chat is opened.
The script reports title and preview payload size in report mode and normal apply mode. It does not trim this metadata unless you explicitly opt in:
python scripts/keep_codex_fast.py --apply --repair-thread-metadata-bloatWith that flag, after backing up and only when Codex is not running, it trims active SQLite title/preview metadata to bounded display values. It also appends repaired titles to session_index.jsonl, which matches current Codex name-update storage.
This does not remove the actual conversation transcript. The full rollout JSONL remains available unless you separately archive the session.
The repair manifest stores the old full title/preview values so you can restore them. Keep the backup folder private, especially thread-metadata-repairs.jsonl and restore-thread-metadata.py.
If you are using the skill normally, this repair does not happen automatically. Treat it as an extra recommendation only when the report shows unusually large title/preview metadata.
Recurring maintenance should be a reminder, not an automatic apply.
Why: an automation cannot know whether you created handoffs for chats you still care about. It should inspect and remind you, but not archive, move, prune, rotate, normalize, delete, or mutate anything by itself.
Copy this into Codex:
…Ask Codex:
Install the keep-codex-fast skill from https://github.com/vibeforge1111/keep-codex-fastOr clone/copy this folder into your Codex skills directory as keep-codex-fast.
Most users can stay inside Codex and use the prompts above. The script is here for people who want to run it directly.
Report only. This is read-only and privacy-safe by default:
python scripts/keep_codex_fast.pyShow raw thread IDs, chat titles, paths, and process paths only when you need detail:
python scripts/keep_codex_fast.py --detailsCreate backups only, without moving or changing local state:
python scripts/keep_codex_fast.py --backup-onlyBackup folders can contain private local Codex metadata. Keep them on your machine, and do not publish or share them unless you have reviewed what is inside.
Apply core maintenance actions. This does not trim thread title/preview metadata:
python scripts/keep_codex_fast.py --apply --archive-older-than-days 10 --worktree-older-than-days 7Optionally repair oversized title/preview metadata only when the report recommends it:
python scripts/keep_codex_fast.py --apply --repair-thread-metadata-bloatWait for Codex to exit before applying:
python scripts/keep_codex_fast.py --apply --wait-for-codex-exitThe skill can safely handle:
logs_2.sqlite* filesconfig.toml\\?\C:\... path mismatches in local SQLite text fieldsstate_5.sqlite, only with --repair-thread-metadata-bloatIt does not permanently delete chats, logs, or worktrees. It moves them into archive folders and writes backup/restore artifacts before applying changes.
No open issues yet, or sync has not completed.