Summary
- Only use when the user explicitly invokes /search-history (or $search-history in Codex).
- Never auto-invoke.
- Claude Code / Codex CLI のローカルチャット履歴(JSONL)をキーワードで横断検索し、該当するセッションと会話断片を提示する。履歴ファイルは読み取り専用で扱う。
efoo-team/skills
Only use when the user explicitly invokes /search-history (or $search-history in Codex).
npx skills add efoo-team/skills --skill search-history
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Show what happened in recent past sessions on this project as a clean timeline. Use when the us…
11.6K installsList recent git commits linked to agent sessions, optionally filtered by branch or repo. Use wh…
11.4K installsUnified wiki-history-ingest entrypoint for conversation/session sources. Use this when the user…
3K installsIngest Claude Code conversation history into the Obsidian wiki. Use this skill when the user wa…
2.8K installsIngest Codex CLI conversation history into the Obsidian wiki. Use this skill when the user want…
2.4K installsIngest Hermes agent history into the Obsidian wiki. Use this skill when the user wants to mine …
2.3K installsOther skills from efoo-team/skills · top by installs.
npx skills add efoo-team/skills
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
main
Parsed from SKILL.md frontmatter.
Files included with this skill beyond the listing page.
SKILL.md
5,975 B
SUMMARY.md
348 B
Claude Code および Codex CLI のローカル履歴ファイル(JSONL)からキーワード検索を行い、該当するセッションと会話断片を提示する。両ツールの履歴を対等な検索対象として扱う。
このスキルの起動時に渡される引数を以下のように分解する。
引数は任意とし、キーワードが渡されていない場合はユーザーにキーワードの入力を求める。対象ツールの指定がない場合は両方(--all)を検索する。
Claude Code と Codex CLI の履歴を対等に扱う。それぞれ以下のインデックスとセッション本体を持つ。
~/.claude/history.jsonl- 各行: {"display": "...", "timestamp": <unix_ms>, "project": "...", "sessionId": "..."}
~/.claude/projects/<encoded-path>/<sessionId>.jsonl- encoded-path はプロジェクトのフルパスの / や . 等の非英数字を - に変換したもの(例: /Users/foo/myapp → -Users-foo-myapp、github.com → github-com)。検索は find + grep で行うため、この規則からパスを再構成する必要はない - 各行: {"type": "user"|"assistant"|..., "message": {"role": "...", "content": "..."}, "timestamp": "...", "sessionId": "..."}
~/.codex/history.jsonl- 各行: {"sessionid": "...", "ts": <unixsec>, "text": "..."}
~/.codex/sessions/YYYY/MM/DD/rollout-<timestamp>-<uuid>.jsonl- 各行: {"type": "sessionmeta"|"responseitem", "timestamp": "...", "payload": {"role": "user"|"developer"|"assistant", "content": [...]}} - sessionmeta 行に cwd、modelprovider、cli_version 等のメタ情報
grep で絞り込んでから必要最小限を読む。大量のファイルを一括読み込みしない引数を解析し、検索キーワード・対象ツール・日数を確定させる。
~/.claude/history.jsonl から keyword を含む行を grep -i で抽出し、該当する sessionId と project を取得~/.claude/projects/ 配下の JSONL ファイルを find + grep -l で keyword にマッチするセッションファイルを特定~/.codex/history.jsonl から keyword を含む行を grep で抽出し、該当する session_id を取得--days に基づき ~/.codex/sessions/YYYY/MM/DD/ の対象ディレクトリを絞り込むgrep -rl でキーワードマッチするファイルを特定session_meta 行から cwd と timestamp を抽出しコンテキスト情報を付加マッチ結果を以下のフォーマットで提示する。ファイルが大量の場合は上位 20 件に絞る。
## 検索結果: "[keyword]"
### 検索条件
- 対象: Claude Code / Codex CLI / 両方
- 期間: 直近 N 日間
- ヒット数: Claude X 件 / Codex Y 件
### Claude Code セッション
#### 1. [プロジェクト名] - [日時]
- **Session ID**: `xxxx-xxxx-xxxx`
- **ファイル**: `~/.claude/projects/.../<id>.jsonl`
- **マッチ箇所**:
> [keyword を含む会話の抜粋(前後の文脈付き)]
### Codex CLI セッション
#### 1. [作業ディレクトリ] - [日時]
- **ファイル**: `~/.codex/sessions/YYYY/MM/DD/rollout-....jsonl`
- **マッチ箇所**:
> [keyword を含む会話の抜粋(前後の文脈付き)]
### ヒント
- Claude セッション再開: `claude --resume <sessionId>`
- Codex セッション再開: `codex resume <sessionId>`(直近のセッションは `codex resume --last`。`--resume` というフラグは存在しない)
- 詳細確認: 該当 JSONL ファイルを直接参照
grep で絞り込んでから必要最小限を読む