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.5 $0.00038 $0.00394
Sonnet 5.5 $0.00019 $0.00197
Haiku 4.5 $0.00009 $0.00098

Measured 3mo ago against content hash 42e8f8214f38, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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.md、references/query-examples.md。

Gotchas(易错点)

  • Cursor:从 state.vscdb 已知 key 启发式抽取,版本变更后可能漏项或混入非纯用户句。
  • Codex:依赖 history.jsonl 行内 ts(Unix 秒);无 ts 的行不会进入结果。
  • 非默认数据目录(CODEX_HOME、CLAUDE_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. 3mo 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 1mo ago), licensed Apache-2.0. It adds 94 tokens to every session and 985 once invoked, about $0.0004 per session on Opus 5.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

agent-chat-history compared with skills from other repositories

agent-chat-history next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-chat-historySummerSec/SumSec-SkillsSkill81mo agoApache-2.0A94Claude Code
install-openviking-memoryvolcengine/OpenVikingSkill43ktodayAGPL-3.0A191Claude Code, Codex
openviking-context-databasevolcengine/OpenVikingSkill43ktodayAGPL-3.0A95Claude Code, Codex
openviking-memoryvolcengine/OpenVikingSkill43ktodayAGPL-3.0A86Claude Code, Codex
ov-experience-memoryvolcengine/OpenVikingSkill43ktodayAGPL-3.0A78Claude Code, Codex
experience_loadervolcengine/OpenVikingSkill43ktodayAGPL-3.0A21Claude Code, Codex
add-rulesvolcengine/OpenVikingSkill43ktodayAGPL-3.0A42Claude Code, Codex