用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Aradotso/codex-skills --skill keep-codex-fast-maintenance命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
GPT-5.6 jailbreak framework with context reconstruction, tamper engine, and cloud audit bypass for security research
GPT-5.6 context engineering framework for security research, bypassing refusals through three-layer defense (context reconstruction, real-time tampering, cloud audit routing)
GPT-5.6 jailbreak framework using context reconstruction, real-time tamper engine, and file routing to bypass safety mechanisms for security research
基于 SOC 职业分类
正在显示 SKILL.md
| name | keep-codex-fast-maintenance |
| description | Safely inspect, backup, and maintain local Codex state to keep performance fast and clean |
| triggers | ["inspect my Codex local state","clean up old Codex sessions","make Codex faster","create handoff documents before archiving","archive old Codex chats safely","backup Codex state","maintain Codex performance","check for Codex bloat"] |
Skill by ara.so — Codex Skills collection.
A backup-first maintenance 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's going on and reduce local drag without losing context.
Make handoffs first. Archive, don't delete. Apply changes only when you are ready.
All operations are read-only by default. Nothing is mutated until you explicitly use --apply.
Clone or copy this repository into your Codex skills directory:
cd ~/.codex/skills # or your Codex skills path
git clone https://github.com/vibeforge1111/keep-codex-fast.git
Or ask Codex directly:
Install the keep-codex-fast skill from https://github.com/vibeforge1111/keep-codex-fast
--repair-thread-metadata-bloat flag; trims oversized SQLite title/preview metadata after backupBasic inspection report:
python scripts/keep_codex_fast.py
Detailed inspection with thread IDs, titles, and paths:
python scripts/keep_codex_fast.py --details
Create backups only without changing local state:
python scripts/keep_codex_fast.py --backup-only
Important: Backup folders contain private local Codex metadata. Keep them on your machine and do not share publicly.
Apply core maintenance (archives sessions, moves worktrees, rotates logs):
python scripts/keep_codex_fast.py --apply
Customize retention periods:
python scripts/keep_codex_fast.py --apply \
--archive-older-than-days 10 \
--worktree-older-than-days 7
Wait for Codex to exit before applying:
python scripts/keep_codex_fast.py --apply --wait-for-codex-exit
Only use when the report shows unusually large title/preview metadata:
python scripts/keep_codex_fast.py --apply --repair-thread-metadata-bloat
This trims oversized SQLite title/preview fields that can slow chat navigation. The actual conversation transcript remains intact.
Before archiving any important active chats, create handoff documents. These let you archive heavy chat history and start fresh threads without losing context.
Paste this into each active repo chat you want to preserve:
Create a comprehensive handoff document for this repo/session before I archive Codex history.
Include:
- repo/path and branch
- current goal
- what we already completed
- files touched or investigated
- commands/tests already run
- known errors, warnings, or failing checks
- open decisions
- constraints, user preferences, and do-not-touch areas
- the next 3-7 concrete steps
Also include a reactivation prompt I can paste into a fresh Codex chat so it can continue from this handoff without relying on the old chat context.
Save the handoff in a sensible repo-local place like docs/codex-handoffs/YYYY-MM-DD-topic.md unless this repo already has a better handoff location.
Use $keep-codex-fast to inspect my Codex local state and recommend a safe maintenance plan.
After reviewing the report:
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.
Use $keep-codex-fast to create a recurring Codex maintenance reminder.
Schedule it weekly if I use Codex heavily, or biweekly if that seems safer.
The reminder should:
- run the keep-codex-fast report first
- never pass --apply or run mutating maintenance automatically
- never archive, move, prune, rotate, normalize, delete, or mutate local Codex state
- remind me to create comprehensive handoff docs and reactivation prompts for active repo chats before any manual apply
- summarize active session size, archived session size, extended path candidates, old session candidates, worktree candidates, log size, and top Node/dev processes
- report heavy Node/dev processes without killing them
- tell me that manual apply should only happen after I confirm handoffs exist or are not needed and Codex is closed
# Create backup snapshot before applying any changes
python scripts/keep_codex_fast.py --backup-only
# Review what will change
python scripts/keep_codex_fast.py --details
# Apply changes with custom retention
python scripts/keep_codex_fast.py --apply \
--archive-older-than-days 14 \
--worktree-older-than-days 10
logs_2.sqlite* files rotated\\?\C:\...) normalized--repair-thread-metadata-bloatstate_5.sqliteThe script uses sensible defaults. Override via command-line flags:
# Default thresholds
ARCHIVE_OLDER_THAN_DAYS = 7
WORKTREE_OLDER_THAN_DAYS = 7
LOG_SIZE_THRESHOLD_MB = 100
# Override example
python scripts/keep_codex_fast.py --apply \
--archive-older-than-days 14 \
--worktree-older-than-days 10
#!/usr/bin/env python3
"""
Custom Codex maintenance wrapper
"""
import subprocess
import sys
from pathlib import Path
from datetime import datetime
def run_maintenance(dry_run=True):
"""Run Codex maintenance with custom settings"""
# Create timestamped log
log_dir = Path.home() / ".codex" / "maintenance-logs"
log_dir.mkdir(exist_ok=True)
log_file = log_dir / f"maintenance-{datetime.now():%Y%m%d-%H%M%S}.log"
# Build command
cmd = [
sys.executable,
"scripts/keep_codex_fast.py",
]
if not dry_run:
cmd.append("--apply")
cmd.extend([
"--archive-older-than-days", "14",
"--worktree-older-than-days", "10",
])
else:
cmd.append("--details")
# Run with logging
print(f"Running maintenance (dry_run={dry_run})...")
print(f"Logging to: {log_file}")
with open(log_file, "w") as f:
result = subprocess.run(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True
)
f.write(result.stdout)
print(result.stdout)
result.returncode ==
__name__ == :
()
run_maintenance(dry_run=):
sys.exit()
response = ()
response.lower() == :
()
run_maintenance(dry_run=)
:
()
Close Codex before applying changes:
# Wait for Codex to exit automatically
python scripts/keep_codex_fast.py --apply --wait-for-codex-exit
# Or manually close Codex first
Backups contain full session data and metadata. Clean old backups manually:
# List backups
ls -lh ~/.codex/backups/ # or wherever backups are stored
# Remove old backups (review first!)
find ~/.codex/backups -type d -mtime +30 -exec rm -rf {} +
When the report shows large title/preview metadata:
Warning: Found threads with title/preview metadata > 10KB
Consider using --repair-thread-metadata-bloat
Apply the repair:
python scripts/keep_codex_fast.py --apply --repair-thread-metadata-bloat
Keep the repair manifest private. It contains the original full title/preview text.
If you need to restore state after applying changes:
restore-instructions.txt within backuprestore-thread-metadata.pyThe script reports heavy Node/dev processes but never kills them:
# Just inspect processes
python scripts/keep_codex_fast.py --details
You decide whether to stop processes manually.
--applyfrom pathlib import Path
import sys
# Add keep-codex-fast to path
skill_path = Path(__file__).parent / "keep-codex-fast"
sys.path.insert(0, str(skill_path / "scripts"))
from keep_codex_fast import (
inspect_codex_state,
create_backup,
apply_maintenance,
)
# Use as library
state = inspect_codex_state()
print(f"Active sessions: {state['active_session_count']}")
print(f"Total size: {state['total_size_mb']:.1f}MB")
# Create backup before custom operation
backup_path = create_backup()
print(f"Backup created: {backup_path}")