agent-chat-history

agent-chat-history is a skill for Claude Code from SummerSec/SumSec-Skills. It costs 94 tokens per session (985 once invoked), scanned A, a copy of agent-chat-history, Apache-2.0.

A local search tool for finding chat and coding-agent session history by calendar date on Windows, macOS, and Linux. It can inspect Claude Code, Codex CLI, and Cursor history files.

In plain words
What is it for?
Use it to find or export conversations from a specific day, inspect history for one client, extract your prompts, or perform a read-only history audit.
Why use it?
It avoids manually searching JSONL and SQLite files when you need an old conversation or want to check whether history is missing. It can also return only your prompts or structured JSON.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

Part of the dev-tools plugin — 10 skills shipped together

Good fit Use it to find or export conversations from a specific day, inspect history for one client, extract your prompts, or perform a read-only history audit.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/summersec/sumsec-skills/agent-chat-history
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add SummerSec/SumSec-Skills --skill agent-chat-history
Clone the repo
git clone --depth 1 https://github.com/SummerSec/SumSec-Skills

Made for: Claude Code.

Or install dev-tools, the plugin that ships this one along with the rest of its 10 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-chat-history

README.md
[![agentmods](https://agentmods.dev/badge/skills/summersec/sumsec-skills/agent-chat-history/github.svg)](https://agentmods.dev/skills/summersec/sumsec-skills/agent-chat-history)
Your own site
<a href="https://agentmods.dev/skills/summersec/sumsec-skills/agent-chat-history"><img src="https://agentmods.dev/badge/skills/summersec/sumsec-skills/agent-chat-history/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-chat-history

Your own site · 80×15
<a href="https://agentmods.dev/skills/summersec/sumsec-skills/agent-chat-history"><img src="https://agentmods.dev/badge/skills/summersec/sumsec-skills/agent-chat-history.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 985 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 91% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00094 $0.00985
Opus 5 $0.00047 $0.00492
Sonnet 5 $0.00019 $0.00197
Haiku 4.5 $0.00009 $0.00098

Measured 11d ago against content hash 42e8f8214f38, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

agent-chat-history scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/query_history.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

91% identical to agent-chat-history — 10 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

dev-tools/skills/agent-chat-history/SKILL.md · 58 lines

What it actually says

agent-chat-history:本地 Agent 历史对话按日检索(中文)

执行顺序(Agent 照做)

  1. 已有日期 YYYY-MM-DD:用 ${CLAUDE_SKILL_DIR} 定位脚本并运行下方命令;若当前环境不支持该变量,再进入 skill 根目录 agent-chat-history/ 执行;需要给下游贴结果时优先 --json
  2. 没有日期:只问用户一句,确认要查询的 YYYY-MM-DD(本地时区日界),再问是否只要提示词、是否限定某一客户端。
  3. 任务匹配:只要用户提示词 → --prompts-only(可加 --include-claude-global-history);只要路径/文件线索 → 默认列表模式,必要时加 --sqlite-keys
  4. 无命中或偏少:提示尝试 --claude-scan all;仍不对则读 references/storage-paths.md 核对自定义安装路径。

优先:固定日期用脚本(省 token)

不要先把本文件整篇读进上下文。 优先直接执行脚本:

python "${CLAUDE_SKILL_DIR}/scripts/query_history.py" --date YYYY-MM-DD
python "${CLAUDE_SKILL_DIR}/scripts/query_history.py" --date YYYY-MM-DD --prompts-only --json

常用参数(完整表与 JSON 形状见 references/query-history-script.md):

参数 含义
--date 必填,本地日历日 YYYY-MM-DD
--prompts-only 只提取用户侧提示词(Cursor 为启发式,可能不全
--json 结构化输出,便于原样贴回或只摘 prompts 数组
--mode all(默认)或 claude / codex / cursor 只查一类

路径规则与手工命令见 references/storage-paths.mdreferences/query-examples.md

Gotchas(易错点)

  • Cursor:从 state.vscdb 已知 key 启发式抽取,版本变更后可能漏项或混入非纯用户句。
  • Codex:依赖 history.jsonl 行内 ts(Unix 秒);无 ts 的行不会进入结果。
  • 非默认数据目录CODEX_HOMECLAUDE_CONFIG_DIR、Cursor --user-data-dir、Flatpak/Snap):脚本只覆盖常见布局,须对照 storage-paths.md 自行定位后再查。

何时仍需要读正文 / references

  • 要在 SQLite 里深挖 JSON 或新版本 key 名。
  • 用户只描述「上周某次」等模糊时间:先澄清日期再跑脚本。

摘要(三客户端)

客户端 要点
Claude Code ~/.claude/projects/**/*.jsonl + 可选 history.jsonl;列表模式用 mtime 落在本地日
Codex history.jsonl 行内 ts(Unix 秒)落在本地日
Cursor workspaceStorage/<hash>/ 目录 mtime + state.vscdb--sqlite-keys 仅列表模式下列 key

边界

路径与 DB key 随版本变化;未开启持久化或清理缓存可能导致无命中。只读;勿删改他人数据。

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 58 lines · 94 tokens per session scan A 42e8f8214f38

Subscribe to this mod's changes

agent-chat-history is a skill published in the GitHub repository SummerSec/SumSec-Skills (8 stars, last pushed 26d ago), licensed Apache-2.0. It adds 94 tokens to every session and 985 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to agent-chat-history, differing in 10 lines, and is treated as a copy.

Related

Other skills, from other repositories

j-space

Use this skill to establish and operate the model's inner workspace — the J-space — for any task that needs more than fluent output: multi-step or chained reasoning, planning, long-horizon and agentic work, competition-level problems, complex debugging, keeping many parts of a deliverable globally consistent, holding…

Tiger3807861189/J-Space-Cognition-Suite-V3.7 · 144 tokens

install-openviking-memory

Install and configure the OpenViking long-term memory plugin for OpenClaw via natural conversation. Once installed, the plugin automatically captures facts from chats and recalls relevant context before each reply (auto-capture + auto-recall, cross-session). Covers prerequisites, install through OpenClaw's plugin…

volcengine/OpenViking · 191 tokens

openviking-context-database

Use OpenViking from OpenClaw through @openviking/openclaw-plugin: long-term memory, session archives, resource and Agent Skill import, semantic recall, recall trace debugging, and externalized tool-result recovery. Prefer this skill when the user wants to use, query, debug, or operate OpenViking context from an…

volcengine/OpenViking · 95 tokens

ov-experience-memory

Retrieve and apply OpenViking Experience memories through the Agent runtime's generic OpenViking search and read tools. Use before or during executable, multi-step, or tool-based work such as coding, file or data changes, configuration, deployment, workflow execution, and failure recovery when prior operational…

volcengine/OpenViking · 78 tokens

openviking-memory

Recall and persist long-term memory through the OpenViking MCP tools. Use at the start of any substantive task (coding, configuration, debugging, multi-step or tool-based work) to retrieve relevant prior knowledge with find/search/read, and during or after work to persist durable facts, preferences, decisions, and…

volcengine/OpenViking · 86 tokens

experience_loader

Load relevant OpenViking experience memories via case-linked experience candidates before solving a task.

volcengine/OpenViking · 20 tokens