cc-history
Query Claude Code conversation history (JSONL transcripts under ~/.claude/projects/) with shell and jq.
Skill by gcharang
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.
About
Use cases: agent-building
Reviews
Write a reviewNo 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>"/*.jsonlFrom gcharang/claude-config, MIT.
More from gcharang/claude-config
- 0.570score
prompt-engineer
gcharang
Invoke IMMEDIATELY via script when user requests prompt optimization.
SkillAFreshness: AClaude Code +9 - 0.565score
incoherence
gcharang
Detect and resolve incoherence across documentation, code and specs.
SkillAFreshness: AClaude Code +9 - 0.565score
refactor
gcharang
Invoke IMMEDIATELY via script when user requests refactoring analysis, technical debt review, or code quality improvement.
SkillAFreshness: AClaude Code +9 - 0.559score
problem-analysis
gcharang
Invoke IMMEDIATELY via script when user requests problem analysis or root cause investigation.
SkillAFreshness: AClaude Code +9 - 0.559score
codebase-analysis
gcharang
Invoke IMMEDIATELY via script when user requests codebase understanding, architecture comprehension, or repository orientation.
SkillAFreshness: AClaude Code +9 - 0.559score
deepthink
gcharang
Invoke IMMEDIATELY via script when user requests structured reasoning for open-ended analytical questions.
SkillAFreshness: AClaude Code +9 - 0.556score
decision-critic
gcharang
Invoke IMMEDIATELY via script to stress-test decisions and reasoning.
SkillAFreshness: AClaude Code +9
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
- Repository
- github.com/gcharang/claude-config
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from gcharang
- 0.570score
prompt-engineer
gcharang
Invoke IMMEDIATELY via script when user requests prompt optimization.
SkillAFreshness: AClaude Code +9 - 0.565score
incoherence
gcharang
Detect and resolve incoherence across documentation, code and specs.
SkillAFreshness: AClaude Code +9 - 0.565score
refactor
gcharang
Invoke IMMEDIATELY via script when user requests refactoring analysis, technical debt review, or code quality improvement.
SkillAFreshness: AClaude Code +9 - 0.559score
problem-analysis
gcharang
Invoke IMMEDIATELY via script when user requests problem analysis or root cause investigation.
SkillAFreshness: AClaude Code +9 - 0.559score
codebase-analysis
gcharang
Invoke IMMEDIATELY via script when user requests codebase understanding, architecture comprehension, or repository orientation.
SkillAFreshness: AClaude Code +9 - 0.559score
deepthink
gcharang
Invoke IMMEDIATELY via script when user requests structured reasoning for open-ended analytical questions.
SkillAFreshness: AClaude Code +9
Cite this page
cc-history skill. Agent Mart. https://agentmart.dev/skills/gcharang-cc-history (last updated 2026-10-24)