jpskill.com
🛠️ 開発・MCP コミュニティ

claude-history-ingest

Ingest Claude Code conversation history into the Obsidian wiki. Use this skill when the user wants to mine their past Claude conversations for knowledge, import their ~/.claude folder, extract insights from previous coding sessions, or says things like "process my Claude history", "add my conversations to the wiki", "what have I discussed with Claude before". Also triggers when the user mentions their .claude folder, Claude projects, session data, past conversation logs, local-agent-mode sessions, or audit logs.

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o claude-history-ingest.zip https://jpskill.com/download/22821.zip && unzip -o claude-history-ingest.zip && rm claude-history-ingest.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22821.zip -OutFile "$d\claude-history-ingest.zip"; Expand-Archive "$d\claude-history-ingest.zip" -DestinationPath $d -Force; ri "$d\claude-history-ingest.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して claude-history-ingest.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → claude-history-ingest フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
2

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

Claude History Ingest — 会話マイニング

ユーザーの過去の Claude Code 会話から知識を抽出し、Obsidian wiki に整理します。会話は豊富ですが乱雑です。あなたの仕事は、そこからシグナルを見つけ出し、コンパイルすることです。

このスキルは直接呼び出すことも、wiki-history-ingest ルーター (/wiki-history-ingest claude) を介して呼び出すこともできます。

開始する前に

  1. 設定の解決llm-wiki/SKILL.md の Config Resolution Protocol に従ってください (CWD を遡って .env~/.obsidian-wiki/config → プロンプト設定)。これにより OBSIDIAN_VAULT_PATHCLAUDE_HISTORY_PATH (デフォルトは ~/.claude) が得られます。
  2. ボールトのルートにある .manifest.json を読んで、すでに何が取り込まれているかを確認してください。
  3. ボールトのルートにある index.md を読んで、wiki に何が含まれているかを知ってください。

取り込みモード

追加モード (デフォルト)

各ソースファイル (会話 JSONL、メモリファイル) について .manifest.json を確認します。以下のみを処理します。

  • マニフェストにないファイル (新しい会話、新しいメモリファイル、新しいプロジェクト)
  • 変更時刻がマニフェストの ingested_at よりも新しいファイル

これは通常、ユーザーが数回の新しいセッションを実行し、その差分を取り込みたい場合に望ましい動作です。

フルモード

マニフェストに関係なくすべてを処理します。wiki-rebuild の後、またはユーザーが明示的に要求した場合に使用します。

Claude Code データレイアウト

Claude Code はデータを2つの場所に保存します。両方をスキャンしてください。

ソース 1: ~/.claude/ (CLI セッション)

~/.claude/
├── projects/                          # プロジェクトごとのディレクトリ
│   ├── -Users-name-project-a/         # パス由来の名前 (スラッシュ → ダッシュ)
│   │   ├── <session-uuid>.jsonl       # 会話データ (JSONL)
│   │   └── memory/                    # 構造化された記憶
│   │       ├── MEMORY.md              # 記憶インデックス
│   │       ├── user_*.md              # ユーザープロファイルの記憶
│   │       ├── feedback_*.md          # ワークフローフィードバックの記憶
│   │       └── project_*.md           # プロジェクトコンテキストの記憶
│   ├── -Users-name-project-b/
│   │   └── ...
├── sessions/                          # セッションメタデータ (JSON)
│   └── <pid>.json                     # {pid, sessionId, cwd, startedAt, kind, entrypoint}
├── history.jsonl                      # グローバルセッション履歴
├── tasks/                             # サブエージェントのタスクデータ
├── plans/                             # 保存された計画
└── settings.json

ソース 2: ~/Library/Application Support/Claude/local-agent-mode-sessions/ (デスクトップアプリのエージェントセッション)

Claude デスクトップアプリは、ローカルエージェントモードのセッションをここに保存します。構造は深くネストされています。

~/Library/Application Support/Claude/local-agent-mode-sessions/
└── <outer-uuid>/
    └── <inner-uuid>/
        ├── local_<session-uuid>.json          # セッションメタデータ
        └── local_<session-uuid>/
            ├── audit.jsonl                    # 監査ログ — ツール呼び出し、ファイル読み取り、コマンド実行
            └── .claude/
                └── projects/
                    └── <path-encoded-name>/   # ~/.claude/projects/ と同じパスエンコーディング
                        └── <uuid>.jsonl       # 会話トランスクリプト (CLI と同じ JSONL 形式)

すべてのローカルエージェントモードセッションを見つける方法:

# すべてのセッションメタデータファイルを見つける
find ~/Library/Application\ Support/Claude/local-agent-mode-sessions -name "local_*.json" -maxdepth 4

# すべての監査ログを見つける
find ~/Library/Application\ Support/Claude/local-agent-mode-sessions -name "audit.jsonl"

# すべての会話トランスクリプトを見つける
find ~/Library/Application\ Support/Claude/local-agent-mode-sessions -name "*.jsonl" -path "*/.claude/projects/*"

セッションメタデータ (local_<uuid>.json)sessionIdcwdstartedAtmodeltitle などのフィールドを持つ JSON ファイルです。トランスクリプトを開く前に、セッションのコンテキストを理解するためにこれを最初に読んでください。

監査ログ (audit.jsonl) — 各行は、ツール呼び出し (Read, Write, Bash, Edit)、ファイルアクセス、実行されたシェルコマンド、MCP 呼び出しなど、1つのエージェントアクションの JSON レコードです。エージェントが実際に何をしたかを理解するのに役立ちます。会話テキストだけよりも豊かなシグナルとなることがよくあります。フィールド: typetoolNameinputoutputtimestampsessionId

会話トランスクリプト (.claude/projects/.../<uuid>.jsonl) — CLI 会話 JSONL と同じ形式です。~/.claude/projects/*/*.jsonl と同じ方法で解析してください。

価値順にランク付けされた主要なデータソース (両方の場所を結合):

  1. メモリファイル (~/.claude/projects/*/memory/*.md) — 事前に整理されており、すでに wiki に適しています。貴重です。
  2. 会話 JSONL (両方の ~/.claude/projects/*/*.jsonl およびデスクトップアプリのトランスクリプト) — 完全な会話トランスクリプト。豊富ですがノイズが多いです。
  3. 監査ログ (デスクトップセッションの audit.jsonl) — 実行された内容のツール呼び出しレベルの記録。会話が希薄な場合でも、具体的なアクション、ファイルパターン、コマンドパターンを抽出するのに役立ちます。
  4. セッションメタデータ (sessions/*.json および local_*.json) — どのプロジェクト、いつ、どの CWD であったかを示します。

ステップ 1: 調査と差分の計算

両方のデータ場所をスキャンし、.manifest.json と比較します。

# --- ソース 1: CLI セッション (~/.claude) ---
# すべてのプロジェクトを見つける
Glob: ~/.claude/projects/*/

# メモリファイルを見つける (最も価値が高い)
Glob: ~/.claude/projects/*/memory/*.md

# 会話 JSONL ファイルを見つける
Glob: ~/.claude/projects/*/*.jsonl

# --- ソース 2: デスクトップアプリのローカルエージェントモードセッション ---
DESKTOP_SESSIONS="$HOME/Library/Application Support/Claude/local-agent-mode-sessions"

# セッションメタデータ
find "$DESKTOP_SESSIONS" -name "local_*.json" -maxdepth 4

# 監査ログ
find "$DESKTOP_SESSIONS" -name "audit.jsonl"

# 会話トランスクリプト
find "$DESKTOP_SESSIONS" -name "*.jsonl" -path "*/.claude/projects/*"

統合されたインベントリを構築し、各ファイルを分類します。

  • 新規 — マニフェストにない → 取り込みが必要
  • 変更済み — マニフェストにあるがファイルが新しい → 再取り込みが必要
  • 未変更 — マニフェストにあり、変更されていない → 追加モードではスキップ

ユーザーに報告します: 「X 個の CLI プロジェクト、Y 個のデスクトップセッションが見つかりました。メモリファイル: A。会話:

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Claude History Ingest — Conversation Mining

You are extracting knowledge from the user's past Claude Code conversations and distilling it into the Obsidian wiki. Conversations are rich but messy — your job is to find the signal and compile it.

This skill can be invoked directly or via the wiki-history-ingest router (/wiki-history-ingest claude).

Before You Start

  1. Resolve config — follow the Config Resolution Protocol in llm-wiki/SKILL.md (walk up CWD for .env~/.obsidian-wiki/config → prompt setup). This gives OBSIDIAN_VAULT_PATH and CLAUDE_HISTORY_PATH (defaults to ~/.claude)
  2. Read .manifest.json at the vault root to check what's already been ingested
  3. Read index.md at the vault root to know what the wiki already contains

Ingest Modes

Append Mode (default)

Check .manifest.json for each source file (conversation JSONL, memory file). Only process:

  • Files not in the manifest (new conversations, new memory files, new projects)
  • Files whose modification time is newer than their ingested_at in the manifest

This is usually what you want — the user ran a few new sessions and wants to capture the delta.

Full Mode

Process everything regardless of manifest. Use after a wiki-rebuild or if the user explicitly asks.

Claude Code Data Layout

Claude Code stores data in two locations. Scan both.

Source 1: ~/.claude/ (CLI sessions)

~/.claude/
├── projects/                          # Per-project directories
│   ├── -Users-name-project-a/         # Path-derived name (slashes → dashes)
│   │   ├── <session-uuid>.jsonl       # Conversation data (JSONL)
│   │   └── memory/                    # Structured memories
│   │       ├── MEMORY.md              # Memory index
│   │       ├── user_*.md              # User profile memories
│   │       ├── feedback_*.md          # Workflow feedback memories
│   │       └── project_*.md           # Project context memories
│   ├── -Users-name-project-b/
│   │   └── ...
├── sessions/                          # Session metadata (JSON)
│   └── <pid>.json                     # {pid, sessionId, cwd, startedAt, kind, entrypoint}
├── history.jsonl                      # Global session history
├── tasks/                             # Subagent task data
├── plans/                             # Saved plans
└── settings.json

Source 2: ~/Library/Application Support/Claude/local-agent-mode-sessions/ (Desktop app agent sessions)

The Claude desktop app stores local agent mode sessions here. The structure is deeply nested:

~/Library/Application Support/Claude/local-agent-mode-sessions/
└── <outer-uuid>/
    └── <inner-uuid>/
        ├── local_<session-uuid>.json          # Session metadata
        └── local_<session-uuid>/
            ├── audit.jsonl                    # Audit log — tool calls, file reads, commands run
            └── .claude/
                └── projects/
                    └── <path-encoded-name>/   # Same path-encoding as ~/.claude/projects/
                        └── <uuid>.jsonl       # Conversation transcript (same JSONL format as CLI)

How to find all local-agent-mode sessions:

# Find all session metadata files
find ~/Library/Application\ Support/Claude/local-agent-mode-sessions -name "local_*.json" -maxdepth 4

# Find all audit logs
find ~/Library/Application\ Support/Claude/local-agent-mode-sessions -name "audit.jsonl"

# Find all conversation transcripts
find ~/Library/Application\ Support/Claude/local-agent-mode-sessions -name "*.jsonl" -path "*/.claude/projects/*"

Session metadata (local_<uuid>.json) — JSON file with fields like sessionId, cwd, startedAt, model, title. Read this first to understand the session context before opening the transcript.

Audit log (audit.jsonl) — Each line is a JSON record of one agent action: tool calls (Read, Write, Bash, Edit), file accesses, shell commands executed, MCP calls. Useful for understanding what the agent actually did — often richer signal than the conversation text alone. Fields: type, toolName, input, output, timestamp, sessionId.

Conversation transcript (.claude/projects/.../<uuid>.jsonl) — Identical format to CLI conversation JSONL. Parse the same way as ~/.claude/projects/*/*.jsonl.

Key data sources ranked by value (both locations combined):

  1. Memory files (~/.claude/projects/*/memory/*.md) — Pre-distilled, already wiki-friendly. Gold.
  2. Conversation JSONL (both ~/.claude/projects/*/*.jsonl and desktop app transcripts) — Full conversation transcripts. Rich but noisy.
  3. Audit logs (audit.jsonl in desktop sessions) — Tool-call level record of what was done. Useful for extracting concrete actions, file patterns, and command patterns even when the conversation is sparse.
  4. Session metadata (sessions/*.json and local_*.json) — Tells you which project, when, and what CWD.

Step 1: Survey and Compute Delta

Scan both data locations and compare against .manifest.json:

# --- Source 1: CLI sessions (~/.claude) ---
# Find all projects
Glob: ~/.claude/projects/*/

# Find memory files (highest value)
Glob: ~/.claude/projects/*/memory/*.md

# Find conversation JSONL files
Glob: ~/.claude/projects/*/*.jsonl

# --- Source 2: Desktop app local-agent-mode sessions ---
DESKTOP_SESSIONS="$HOME/Library/Application Support/Claude/local-agent-mode-sessions"

# Session metadata
find "$DESKTOP_SESSIONS" -name "local_*.json" -maxdepth 4

# Audit logs
find "$DESKTOP_SESSIONS" -name "audit.jsonl"

# Conversation transcripts
find "$DESKTOP_SESSIONS" -name "*.jsonl" -path "*/.claude/projects/*"

Build a unified inventory and classify each file:

  • New — not in manifest → needs ingesting
  • Modified — in manifest but file is newer → needs re-ingesting
  • Unchanged — in manifest and not modified → skip in append mode

Report to the user: "Found X CLI projects, Y desktop sessions. Memory files: A. Conversations: B. Audit logs: C. Delta: D new, E modified."

Step 2: Ingest Memory Files First

Memory files are already structured with YAML frontmatter:

---
name: memory-name
description: one-line description
type: user|feedback|project|reference
---

Memory content here.

For each memory file:

  • Read it and parse the frontmatter
  • user type → feeds into an entity page about the user, or concept pages about their domain
  • feedback type → feeds into skills pages (workflow patterns, what works, what doesn't)
  • project type → feeds into entity pages for the project
  • reference type → feeds into reference pages pointing to external resources

The MEMORY.md index file in each project is a quick summary — read it first to decide which individual memory files are worth reading in full.

Step 3: Parse Conversation JSONL

Each JSONL file is one conversation session. Each line is a JSON object:

{
  "type": "user|assistant|progress|file-history-snapshot",
  "message": {
    "role": "user|assistant",
    "content": "text string"
  },
  "uuid": "...",
  "timestamp": "2026-03-15T10:30:00.000Z",
  "sessionId": "...",
  "cwd": "/path/to/project",
  "version": "2.1.59"
}

For assistant messages, content may be an array of content blocks:

{
  "content": [
    {"type": "thinking", "text": "..."},
    {"type": "text", "text": "The actual response..."},
    {"type": "tool_use", "name": "Read", "input": {...}}
  ]
}

What to extract from conversations:

  • Filter to type: "user" and type: "assistant" entries only
  • For assistant entries, extract text blocks (skip thinking and tool_use — those are noise)
  • The cwd field tells you which project this conversation belongs to
  • The project directory name (e.g., -Users-name-Documents-projects-my-app) tells you the project path

Skip these:

  • type: "progress" — internal agent progress updates
  • type: "file-history-snapshot" — file state tracking
  • Subagent conversations (under subagents/ subdirectories) — unless the user specifically asks

Step 3b: Parse Audit Logs (desktop sessions only)

For each audit.jsonl found under local-agent-mode-sessions/, read it line by line. Each line is a JSON record of one agent action:

{
  "type": "tool_call",
  "toolName": "Bash",
  "input": {"command": "npm test"},
  "output": "...",
  "timestamp": "2026-04-10T14:22:00Z",
  "sessionId": "..."
}

What to extract from audit logs:

  • File access patterns — which files does the agent repeatedly Read or Edit? These are the high-value files in the project. Note them as project references.
  • Shell commands — recurring Bash commands reveal the project's build/test/deploy workflow. Distill these into a skills/ page (e.g. "how this project is built and tested").
  • Tool call sequences — if the agent always does Read → Edit → Bash in a particular order, that's a workflow pattern worth capturing.
  • Error patterns — failed tool calls (non-zero exit codes, error outputs) reveal pain points, known rough edges, or recurring bugs.
  • MCP tool calls — calls to MCP tools reveal which external services and APIs the project integrates with.

Skip from audit logs:

  • Routine file reads with no pattern (e.g. reading config files once)
  • Tool outputs that are just noise (long stack traces, verbose logs) — summarize the error class, not the full output
  • Anything that looks like secrets, tokens, or credentials in command arguments or outputs

Cross-reference with the conversation transcript: The audit log tells you what happened; the conversation tells you why. When both are available for the same session, use them together — the audit log grounds the conversation in concrete actions.

Read the paired local_<uuid>.json session metadata before processing the audit log — it gives you cwd, startedAt, and title to contextualize the actions.

Step 4: Cluster by Topic

Don't create one wiki page per conversation. Instead:

  • Group extracted knowledge by topic across conversations
  • A single conversation about "debugging auth + setting up CI" → two separate topics
  • Three conversations across different days about "React performance" → one merged topic
  • The project directory name gives you a natural first-level grouping

Step 5: Distill into Wiki Pages

Each Claude project maps to a project directory in the vault. The project directory name from ~/.claude/projects/ encodes the original path — decode it to get a clean project name:

-Users/Documents/projects/my-Project   → myproject
-Users/Documents/projects/Another-app  → anotherapp

Project-specific vs. global knowledge

What you found Where it goes Example
Project architecture decisions projects/<name>/concepts/ projects/my-project/concepts/main-architecture.md
Project-specific debugging projects/<name>/skills/ projects/my-project/skills/api-rate-limiting.md
General concept the user learned concepts/ (global) concepts/react-server-components.md
Recurring problem across projects skills/ (global) skills/debugging-hydration-errors.md
A tool/service used entities/ (global) entities/vercel-functions.md
Patterns across many conversations synthesis/ (global) synthesis/common-debugging-patterns.md

For each project with content, create or update the project overview page at projects/<name>/<name>.mdnamed after the project, not _project.md. Obsidian's graph view uses the filename as the node label, so _project.md makes every project show up as _project in the graph. Naming it <name>.md gives each project a distinct, readable node name.

Important: Distill the knowledge, not the conversation. Don't write "In a conversation on March 15, the user asked about X." Write the knowledge itself, with the conversation as a source attribution.

Write a summary: frontmatter field on every new/updated page — 1–2 sentences, ≤200 chars, answering "what is this page about?" for a reader who hasn't opened it. wiki-query's cheap retrieval path reads this field to avoid opening page bodies.

Add confidence and lifecycle fields to every new page's frontmatter:

base_confidence: 0.42
lifecycle: draft
lifecycle_changed: <ISO date today>

On update, leave lifecycle and lifecycle_changed unchanged — only a human editor transitions lifecycle state.

Mark provenance per the convention in llm-wiki (Provenance Markers section):

  • Memory files are mostly extracted — the user wrote them by hand and they're already distilled. Treat memory-derived claims as extracted unless you're stitching together claims from multiple memory files.
  • Conversation distillation is mostly inferred. You're synthesizing a coherent claim from many turns of dialogue, often filling in implicit reasoning. Apply ^[inferred] liberally to synthesized patterns, generalizations across sessions, and "what the user really meant" interpretations.
  • Use ^[ambiguous] when the user changed their mind across sessions or when assistant and user contradicted each other and the resolution is unclear.
  • Write a provenance: frontmatter block on every new/updated page summarizing the rough mix.

Step 6: Update Manifest, Journal, and Special Files

Update .manifest.json

For each source file processed, add/update its entry with:

  • ingested_at, size_bytes, modified_at
  • source_type: one of "claude_conversation", "claude_memory", "claude_audit_log", "claude_desktop_session"
  • project: the decoded project name
  • pages_created and pages_updated lists

Also update the projects section of the manifest:

{
  "project-name": {
    "source_path": "~/.claude/projects/-Users-...",
    "vault_path": "projects/project-name",
    "last_ingested": "TIMESTAMP",
    "conversations_ingested": 5,
    "conversations_total": 8,
    "memory_files_ingested": 3,
    "desktop_sessions_ingested": 2,
    "audit_logs_ingested": 2
  }
}

Create journal entry + update special files

Update index.md and log.md per the standard process:

- [TIMESTAMP] CLAUDE_HISTORY_INGEST projects=N conversations=M desktop_sessions=D audit_logs=A pages_updated=X pages_created=Y mode=append|full

hot.md — Read $OBSIDIAN_VAULT_PATH/hot.md (create from the template in wiki-ingest if missing). Update Recent Activity with a one-line summary — e.g. "Ingested 5 Claude conversations across 2 projects; surfaced patterns in API design and testing strategy." Keep the last 3 operations. Update Active Threads if any ongoing project is now better understood. Update updated timestamp.

Privacy

  • Distill and synthesize — don't copy raw conversation text verbatim
  • Skip anything that looks like secrets, API keys, passwords, tokens
  • If you encounter personal/sensitive content, ask the user before including it
  • The user's conversations may reference other people — be thoughtful about what goes in the wiki

Reference

See references/claude-data-format.md for more details on the data structures.

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。