Skip to content

Ar9av/obsidian-wiki / skills/claude-history-ingest

claude-history-ingest

Verified

Ingest Claude Code conversation/session history into Obsidian as distilled knowledge. Use for importing or mining past Claude sessions, .claude data, project/session history, or audit logs.

FileKindSize
SKILL.mdskill md22.8 KB
references/claude-data-format.mdmarkdown4.1 KB

references/claude-data-format.md

View on GitHub
# Claude Code Data Format — Detailed Reference

## Projects Directory

`~/.claude/projects/` contains one directory per project the user has opened with Claude Code. Directory names encode the absolute path:

```
/Users/name/Documents/projects/my-app → -Users/name/Documents/projects/my-app
```

To recover the original path: replace leading `-` with `/`, then replace remaining `-` cautiously (dashes also appear in directory names). The `cwd` field in session/conversation data gives you the canonical path.

### Conversation JSONL Files

Located at `~/.claude/projects/<project-dir>/<session-uuid>.jsonl`.

Each line is one event. Relevant event types:

| `type`                  | What it is                  | Worth reading?                           |
| ----------------------- | --------------------------- | ---------------------------------------- |
| `user`                  | User message                | Yes — this is what the user asked/said   |
| `assistant`             | Assistant response          | Yes — extract `text` blocks from content |
| `progress`              | Tool execution progress     | No — internal plumbing                   |
| `file-history-snapshot` | File state at session start | No — just file listings                  |

#### User message structure

```json
{
  "type": "user",
  "message": { "role": "user", "content": "the user's message as a string" },
  "timestamp": "2026-03-15T10:30:00.000Z",
  "sessionId": "uuid",
  "cwd": "/Users/name/Documents/projects/my-app"
}
```

#### Assistant message structure

```json
{
  "type": "assistant",
  "message": {
    "role": "assistant",
    "content": [
      { "type": "thinking", "text": "internal reasoning (skip this)" },
      { "type": "text", "text": "The actual visible response" },
      {
        "type": "tool_use",
        "id": "...",
        "name": "Read",
        "input": { "file_path": "..." }
      }
    ]
  },
  "timestamp": "2026-03-15T10:30:05.000Z"
}
```

**Extraction strategy:** Only pull `text` type blocks from assistant content arrays. The `thinking` blocks are internal reasoning and `tool_use` blocks are mechanical actions — neither adds wiki-worthy knowledge.

### Memory Files

Located at `~/.claude/projects/<project-dir>/memory/`.

Each memory file has YAML frontmatter:

```markdown
---
name: descriptive-name
description: one-line summary used for relevance matching
type: user|feedback|project|reference
---

The memory content. For feedback/project types, structured as:
rule/fact, then **Why:** and **How to apply:** lines.
```

**Memory types and their wiki value:**

| Type        | Contains                                 | Maps to wiki                                           |
| ----------- | ---------------------------------------- | ------------------------------------------------------ |
| `user`      | User's role, preferences, expertise      | Entity page about the user, or context for other pages |
| `feedback`  | Workflow corrections and confirmations   | Skills pages — "how to work effectively"               |
| `project`   | Active work, goals, decisions, deadlines | Entity pages for projects                              |
| `reference` | Pointers to external resources           | Reference pages                                        |

`MEMORY.md` in each memory directory is an index with one-line summaries. Read it first to triage.

### Session Metadata

Located at `~/.claude/sessions/<pid>.json`. Light metadata:

```json
{
  "pid": 12345,
  "sessionId": "uuid",
  "cwd": "/Users/name/Documents/projects/my-app",
  "startedAt": "2026-03-15T10:30:00.000Z",
  "kind": "interactive",
  "entrypoint": "cli"
}
```

Useful for building a timeline of when the user worked on what.

### Global History

`~/.claude/history.jsonl` — append-only log of all sessions. Use for timeline reconstruction.

## Processing Order

For maximum efficiency:

1. **MEMORY.md indexes** — Quick triage of what each project knows
2. **Individual memory files** — Pre-distilled knowledge, highest signal-to-noise
3. **Conversation JSONL** — Rich but verbose, process selectively
4. **Session metadata** — Only if you need timeline context
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall