claude-history-ingest
Original:🇺🇸 English
Translated
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, or past conversation logs.
8installs
Sourcear9av/obsidian-wiki
Added on
NPX Install
npx skill4agent add ar9av/obsidian-wiki claude-history-ingestTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →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 router ().
wiki-history-ingest/wiki-history-ingest claudeBefore You Start
- Read to get
.envandOBSIDIAN_VAULT_PATH(defaults toCLAUDE_HISTORY_PATH)~/.claude - Read at the vault root to check what's already been ingested
.manifest.json - Read at the vault root to know what the wiki already contains
index.md
Ingest Modes
Append Mode (default)
Check for each source file (conversation JSONL, memory file). Only process:
.manifest.json- Files not in the manifest (new conversations, new memory files, new projects)
- Files whose modification time is newer than their in the manifest
ingested_at
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 or if the user explicitly asks.
wiki-rebuildClaude Code Data Layout
Claude Code stores everything under . Here is the actual structure:
~/.claude/~/.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.jsonKey data sources ranked by value:
- Memory files () — Pre-distilled, already wiki-friendly. These contain the user's preferences, project decisions, and feedback. Gold.
projects/*/memory/*.md - Conversation JSONL () — Full conversation transcripts. Rich but noisy.
projects/*/*.jsonl - Session metadata () — Tells you which project, when, and what CWD.
sessions/*.json
Step 1: Survey and Compute Delta
Scan and compare against :
CLAUDE_HISTORY_PATH.manifest.json# Find all projects
Glob: ~/.claude/projects/*/
# Find memory files (highest value)
Glob: ~/.claude/projects/*/memory/*.md
# Find conversation JSONL files
Glob: ~/.claude/projects/*/*.jsonlBuild an 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 projects, Y conversations, Z memory files. Delta: A new, B modified."
Step 2: Ingest Memory Files First
Memory files are already structured with YAML frontmatter:
markdown
---
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
- type → feeds into an entity page about the user, or concept pages about their domain
user - type → feeds into skills pages (workflow patterns, what works, what doesn't)
feedback - type → feeds into entity pages for the project
project - type → feeds into reference pages pointing to external resources
reference
The index file in each project is a quick summary — read it first to decide which individual memory files are worth reading in full.
MEMORY.mdStep 3: Parse Conversation JSONL
Each JSONL file is one conversation session. Each line is a JSON object:
json
{
"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, may be an array of content blocks:
contentjson
{
"content": [
{"type": "thinking", "text": "..."},
{"type": "text", "text": "The actual response..."},
{"type": "tool_use", "name": "Read", "input": {...}}
]
}What to extract from conversations:
- Filter to and
type: "user"entries onlytype: "assistant" - For assistant entries, extract blocks (skip
textandthinking— those are noise)tool_use - The field tells you which project this conversation belongs to
cwd - The project directory name (e.g., ) tells you the project path
-Users-name-Documents-projects-my-app
Skip these:
- — internal agent progress updates
type: "progress" - — file state tracking
type: "file-history-snapshot" - Subagent conversations (under subdirectories) — unless the user specifically asks
subagents/
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 encodes the original path — decode it to get a clean project name:
~/.claude/projects/-Users/Documents/projects/my-Project → myproject
-Users/Documents/projects/Another-app → anotherappProject-specific vs. global knowledge
| What you found | Where it goes | Example |
|---|---|---|
| Project architecture decisions | | |
| Project-specific debugging | | |
| General concept the user learned | | |
| Recurring problem across projects | | |
| A tool/service used | | |
| Patterns across many conversations | | |
For each project with content, create or update the project overview page at — named after the project, not . Obsidian's graph view uses the filename as the node label, so makes every project show up as in the graph. Naming it gives each project a distinct, readable node name.
projects/<name>/<name>.md_project.md_project.md_project<name>.mdImportant: 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 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. 's cheap retrieval path reads this field to avoid opening page bodies.
summary:wiki-queryMark provenance per the convention in (Provenance Markers section):
llm-wiki- 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 liberally to synthesized patterns, generalizations across sessions, and "what the user really meant" interpretations.
^[inferred] - Use when the user changed their mind across sessions or when assistant and user contradicted each other and the resolution is unclear.
^[ambiguous] - Write a frontmatter block on every new/updated page summarizing the rough mix.
provenance:
Step 6: Update Manifest, Journal, and Special Files
Update .manifest.json
.manifest.jsonFor each source file processed (conversation JSONL, memory file), add/update its entry with:
- ,
ingested_at,size_bytesmodified_at - :
source_typeor"claude_conversation""claude_memory" - : the decoded project name
project - and
pages_createdlistspages_updated
Also update the section of the manifest:
projectsjson
{
"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
}
}Create journal entry + update special files
Update and per the standard process:
index.mdlog.md- [TIMESTAMP] CLAUDE_HISTORY_INGEST projects=N conversations=M pages_updated=X pages_created=Y mode=append|fullPrivacy
- 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 for more details on the data structures.
references/claude-data-format.md