Codex Chat History Cleanerのロゴ

Codex Chat History Cleaner

コミュニティ
xuanzhe1996
codex-chat-history-cleaner

Safely inspect and clean local Codex chat history, archived sessions, search-index remnants, and self-referential cleanup traces. Use when a user asks why deleted or archived Codex chats still appear in search, wants to delete local chat records, scrub current-session references to old chats, or prepare a privacy-preserving cleanup workflow for sharing.

概要

公開者xuanzhe1996
リポジトリcodex-chat-history-cleaner
スキル名codex-chat-history-cleaner
スター
29
フォーク
7
同梱ファイル
3
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 3個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    xuanzhe1996がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Codex Chat History Cleaner」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/xuanzhe1996/codex-chat-history-cleaner/tree/main
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/xuanzhe1996/codex-chat-history-cleaner.git \
  .claude/skills/codex-chat-history-cleaner
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCodex Chat History Cleanerを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にCodex Chat History Cleanerを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Codex Chat History Cleanerは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Codex Chat History Cleaner

Core Rule

Treat Codex chat cleanup as destructive local-state maintenance. Start with a dry run, identify every storage surface, explain what will be removed, and request approval before executing any deletion outside the current writable workspace.

Do not print private titles, paths, user names, or full thread IDs into the current conversation when the user's goal is search cleanup. Printing the matching text can make the current session become the new search hit.

Storage Surfaces

Check these local Codex locations under CODEX_HOME or ~/.codex:

  • state_*.sqlite: thread metadata; threads.archived=1 means archived, not deleted.
  • sessions/**/rollout-*.jsonl: normal chat transcript files.
  • archived_sessions/**/rollout-*.jsonl: archived transcript files.
  • session_index.jsonl: lightweight search/list index.
  • generated_images/ and related artifact directories: optional per-thread artifacts.
  • logs_*.sqlite: diagnostic logs; inspect only if deleted sessions still appear after the primary stores are clean.

Workflow

  1. Locate CODEX_HOME.
  2. Run scripts/clean_codex_history.py --dry-run to inventory databases, session files, archived files, and index records.
  3. Choose selectors:
    • Use --all-archived for archived sessions.
    • Use --ids <id-prefix-or-id> when thread IDs are known.
    • Use --title-contains <text> sparingly; avoid echoing sensitive titles in chat.
    • Use --all-except-current --current-thread-id <id> only when the user asks to remove all historical search results while preserving the active thread.
  4. Run another dry run with the selectors and review counts.
  5. Execute only after approval: add --execute.
  6. Verify with the same dry-run command and a direct SQLite count/list query that avoids printing sensitive strings.
  7. Tell the user to restart Codex if UI search still displays stale cached results.

Self-Referential Search Hits

If old titles still appear after deletion, inspect whether the current cleanup conversation contains command output or assistant text that repeated those old titles. In that case, scrub the current rollout-*.jsonl with --scrub-file <path> and selectors. Prefer ID selectors or encoded/local-only patterns to avoid reintroducing sensitive terms into chat.

Example:

bash
python3 scripts/clean_codex_history.py \
  --codex-home "$HOME/.codex" \
  --scrub-file "$HOME/.codex/sessions/YYYY/MM/DD/rollout-THREAD.jsonl" \
  --ids THREAD_PREFIX \
  --dry-run

Then execute with --execute after approval.

Bundled Script

Use scripts/clean_codex_history.py for deterministic cleanup. It defaults to dry-run mode and creates timestamped backups before changing SQLite databases or index files unless --no-backup is passed.

Useful commands:

bash
# Inventory only
python3 scripts/clean_codex_history.py --codex-home "$HOME/.codex" --dry-run

# Delete archived records and files after approval
python3 scripts/clean_codex_history.py --codex-home "$HOME/.codex" --all-archived --execute

# Delete all non-current threads after approval
python3 scripts/clean_codex_history.py --codex-home "$HOME/.codex" \
  --all-except-current --current-thread-id THREAD_ID --execute

Privacy Before Sharing

Before publishing this skill, read references/privacy.md. Do not include real usernames, absolute local paths, conversation titles, thread IDs, screenshots, database rows, generated images, auth files, or logs.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Codex Chat History Cleaner」では何ができますか?

Safely inspect and clean local Codex chat history, archived sessions, search-index remnants, and self-referential cleanup traces. Use when a user asks why deleted or archived Codex chats still appear in search, wants to delete local chat records, scrub current-session references to old chats, or prepare a privacy-preserving cleanup workflow for sharing.

TypingMindでCodex Chat History Cleanerを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Codex Chat History Cleanerはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCodex Chat History Cleanerをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/xuanzhe1996/codex-chat-history-cleaner/tree/mainを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Codex Chat History Cleanerを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Codex Chat History Cleanerで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCodex Chat History Cleanerを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Codex Chat History Cleaner」は無料ですか?

xuanzhe1996がGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇