session-history
Search and summarize Claude Code, Codex, and opencode session history. Use when the user wants to look at past conversations, find sessions about a topic, or…
от david-crespo★ 20 звёзд на GitHub
Установить session-history в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Session History
Search and summarize conversations from Claude Code, Codex, and opencode sessions.
If invoked with an argument, treat it as the search term, topic, or date to find across sessions.
Helper script
This skill includes claude-sessions.sh for common operations on Claude Code,
Codex, and opencode sessions. Use it instead of writing ad hoc jq/rg/sqlite
pipelines. Run it without arguments for usage. The script auto-detects session
format by the identifier (file path vs. opencode: prefix).
claude-sessions.sh dir [path] # session dir for a project
claude-sessions.sh list [--all | path] [--days N] # recent sessions
claude-sessions.sh search <term> [--all | path] [--days N] # find sessions by content
claude-sessions.sh bash <session> [filter] # extract Bash commands
claude-sessions.sh extract <session> <type> # type: user, assistant, bash, tools
claude-sessions.sh search-bash <term> [--all | path] [--days N]
# search + extract matching Bash commands
claude-sessions.sh search-extract <term> <type> [--all | path] [--days N]
# search + extract content by type
claude-sessions.sh summary [--all | path] [--days N] # per-session user-msg & tool-call counts, first user message
claude-sessions.sh tools-audit <session> [--mode M] [--summary|--json|--truncate N]
# per-tool-call audit with permissionMode & outcome (Claude Code only)
The script lives next to this skill file. Run it with its full path:
~/.claude/skills/session-history/claude-sessions.sh
Session file locations
Claude Code sessions are JSONL files stored per-project:
~/.claude/projects/-Users-david-oxide-<repo>/*.jsonl
~/.claude/projects/-Users-david-repos-<repo>/*.jsonl
The directory name is the absolute project path with all / replaced by -
(including the leading one, so it starts with -).
Sessions under the personal account (CLAUDE_CONFIG_DIR=~/.claude-personal)
live in the same layout under ~/.claude-personal/projects/. The script
searches both: dir prints one line per account that has sessions for the
project, and summary/header output labels personal sessions personal:.
Codex sessions are JSONL files stored by date:
~/.codex/sessions/YYYY/MM/DD/rollout-<timestamp>-<uuid>.jsonl
Codex also writes a sibling rollout for its approval-judge model ("guardian",
session_meta.payload.source is an object rather than "cli") next to each
real session; the script drops those from list/search/summary. Since
about 2026-08-10, user turns exist only as response_item messages with
role: user (no user_message events), and shell commands are embedded as
tools.exec_command({cmd: "..."}) calls inside custom_tool_call JavaScript.
The script handles both the old and new shapes.
opencode sessions are rows in a SQLite DB (not per-session files):
~/.local/share/opencode/opencode.db (tables: session, message, part)
Since they have no file path, they flow through the pipeline as a synthetic
opencode:<session_id> identifier. The DB is the single source of truth — it
holds the full history, including sessions from before opencode migrated off
its old JSON file storage, so the legacy storage/ JSON files are ignored.
With --all, commands include Claude Code, Codex, and opencode sessions.
Codex and opencode rows are distinguished by codex: / opencode: prefixes in
summary and header output. Like Codex, opencode sessions surface only with
--all, not when listing/searching a specific project path. tools-audit is
Claude Code only (no permissionMode concept in Codex/opencode).
Process
Use the helper script for all three session formats. Only fall back to raw jq/sqlite for unusual extraction needs.
Triage efficiently. Use
claude-sessions.sh searchto narrow down candidates before extracting full content.Summarize selectively. Extract only user messages first to understand the arc. Only extract assistant messages for the specific sessions the user cares about.
For counting questions ("how many user messages today?", "how active was I in this repo?"),
summaryalready emits(U N, T M)per session — sum those columns rather than writing ad hoc jq. TheUcount excludes tool-result messages; naivetype == "user"filters conflate the two.For multi-session narratives, establish chronological order using file timestamps or
session_metaentries, then read sessions in order to build the story.For large session files (>256KB), always use the helper script or
jqvia Bash rather than the Read tool.
Auditing tool calls by permission mode
When asked to audit auto-mode (or acceptEdits / bypassPermissions) tool calls — typically "what got
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- claude-sessions.sh
FAQ
Что делает скилл session-history?
Search and summarize Claude Code, Codex, and opencode session history. Use when the user wants to look at past conversations, find sessions about a topic, or reconstruct a debugging narrative.
Как установить скилл session-history?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл session-history запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…