Skip to content
Agentmart
Submit a tool

cc-history

Query Claude Code conversation history (JSONL transcripts under ~/.claude/projects/) with shell and jq.

Skill by gcharang

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/gcharang-cc-history

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Query Claude Code conversation history (JSONL transcripts under ~/.claude/projects/) with shell and jq. Use when the user asks about past sessions - finding a conversation, token usage, tool calls, skill invocations, subagent activity, or one branch of a conversation.

Use cases: agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/cc-history

What's inside

Skill name
cc-history
Description
Query Claude Code conversation history (JSONL transcripts under ~/.claude/projects/) with shell and jq. Use when the user asks about past sessions - finding a conversation, token usage, tool calls, skill invocations, subagent activity, or one branch of a conversation.
License
MIT
Instructions
267 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • body: contains an absolute path from the author's machine

Files (3)

  • CLAUDE.md
  • README.md
  • SKILL.md

SKILL.md (first lines)

# Claude Code History Analysis

Reference documentation for querying and analyzing Claude Code's conversation history. Use shell commands and jq to extract information from JSONL conversation files.

## Directory Structure

```
~/.claude/projects/{encoded-path}/
  |-- {session-uuid}.jsonl          # Main conversation
  |-- {session-uuid}/
      |-- subagents/
      |   |-- agent-{hash}.jsonl    # Subagent conversations
      |-- tool-results/             # Large tool outputs
```

## Project Path Resolution

The project directory is `<home>/.claude/projects/<slug>`. To form `<slug>`, replace
every character of the absolute working directory other than an ASCII letter or digit
with `-`. Write the result as `<project dir>` in the commands below.

Examples:

- `/Users/bill/.claude` -> `-Users-bill--claude`
- `/Users/bill/git/myproject` -> `-Users-bill-git-myproject`

## Message Types

| Type              | Description                                   |
| ----------------- | --------------------------------------------- |
| `user`            | User input messages                           |
| `assistant`       | Model responses (thinking, tool_use, text)    |
| `system`          | System messages                               |
| `queue-operation` | Background task notifications (subagent done) |

## Message Structure

Each line in a JSONL file is a message object:

```json
{
  "type": "assistant",
  "uuid": "abc123",
  "parentUuid": "xyz789",
  "timestamp": "2025-01-15T19:39:16.000Z",
  "sessionId": "session-uuid",
  "message": {
    "role": "assistant",
    "content": [...],
    "usage": {
      "input_tokens": 20000,
      "output_tokens": 500,
      "cache_read_input_tokens": 15000,
      "cache_creation_input_tokens": 5000
    }
  }
}
```

Assistant message content blocks:

- `type: "thinking"` - Model thinking (has `thinking` field)
- `type: "tool_use"` - Tool invocation (has `name`, `input` fields)
- `type: "text"` - Text response (has `text` field)

## Common Queries

### Find Conversations

```bash
# List by modification time (most recent first)
ls -lt "<project dir>"/*.jsonl

# Find by date
ls -la "<project dir>"/*.jsonl | grep "Jan 15"

# Find by content
grep -l "search term" "<project dir>"/*.jsonl
```

### Extract Messages

```bash
# Get message by line number (1-indexed)
sed -n '42p' file.jsonl | jq .

# Get message by uuid
jq -c 'select(.uuid=="abc123")' file.jsonl

# All user messages
jq -c 'select(.type=="user")' file.jsonl

# All assistant messages
jq -c 'select(.type=="assistant")' file.jsonl
```

### Tool Call Analysis

```bash
# List all tool calls
jq -c 'select(.type=="assistant") | .message.content[]? | select(.type=="tool_use") | {name, input}' file.jsonl

# Count tool calls by name
jq -c 'select(.type=="assistant") | .message.content[]? | select(.type=="tool_use") | .name' file.jsonl | sort | uniq -c | sort -rn

# Find specific tool calls
jq -c 'select(.type=="assistant") | .message.content[]? | select(.type=="tool_use" and .name=="Bash")' file.jsonl
```

### Skill Invocation Detection

Pattern: `python3? -m skills\.([a-z_]+)\.` — matches both legacy `python3 -m skills.X` and uv-era `uv run python -m skills.X` invocations (the `?` makes the `3` optional so plain `python -m` also matches).

```bash
# Find all skill invocations (both forms)
grep -oE "python3? -m skills\.[a-z_]+" file.jsonl | sort -u

# Find conversations using a specific skill
grep -lE "python3? -m skills\.planner\." "<project dir>"/*.jsonl

From gcharang/claude-config, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 21, 2026 (8 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from gcharang

Cite this page

cc-history skill. Agent Mart. https://agentmart.dev/skills/gcharang-cc-history (last updated 2026-10-24)