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.
npx skills add SummerSec/SumSec-Skills --skill agent-chat-historygit clone --depth 1 https://github.com/SummerSec/SumSec-SkillsWrote 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.
[](https://agentmods.dev/skills/summersec/sumsec-skills/agent-chat-history)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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.
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.
What it actually says
agent-chat-history:本地 Agent 历史对话按日检索(中文)
执行顺序(Agent 照做)
- 已有日期
YYYY-MM-DD:用${CLAUDE_SKILL_DIR}定位脚本并运行下方命令;若当前环境不支持该变量,再进入 skill 根目录agent-chat-history/执行;需要给下游贴结果时优先--json。 - 没有日期:只问用户一句,确认要查询的
YYYY-MM-DD(本地时区日界),再问是否只要提示词、是否限定某一客户端。 - 任务匹配:只要用户提示词 →
--prompts-only(可加--include-claude-global-history);只要路径/文件线索 → 默认列表模式,必要时加--sqlite-keys。 - 无命中或偏少:提示尝试
--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 随版本变化;未开启持久化或清理缓存可能导致无命中。只读;勿删改他人数据。
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.
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.
- 11d ago First seen · 58 lines · 94 tokens per session scan A 42e8f8214f38
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.
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…
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…
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…
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…
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…
experience_loader
Load relevant OpenViking experience memories via case-linked experience candidates before solving a task.