con un clic
agent-chat-history
// 按 YYYY-MM-DD 在 Windows/macOS/Linux 检索本机聊天与 Agent 会话历史(Claude Code 项目 jsonl、Codex CLI history.jsonl、Cursor workspaceStorage 与 state.vscdb);可只导出用户提示词。用户要查看或导出某日记录、按天筛 jsonl/SQLite、只抽提示词、排查历史丢失或做只读审计时使用。
// 按 YYYY-MM-DD 在 Windows/macOS/Linux 检索本机聊天与 Agent 会话历史(Claude Code 项目 jsonl、Codex CLI history.jsonl、Cursor workspaceStorage 与 state.vscdb);可只导出用户提示词。用户要查看或导出某日记录、按天筛 jsonl/SQLite、只抽提示词、排查历史丢失或做只读审计时使用。
Expose the AI's visible inner monologue during work. Use when the session should allow short public asides in the format `▎InnerOS:...` alongside the main task output.
Expose the AI's visible inner monologue during work. Use when the session should allow short public asides in the format `▎InnerOS:...` alongside the main task output.
Expose the AI's visible inner monologue during work. Use when the session should allow short public asides in the format `▎InnerOS:...` alongside the main task output.
Use when the user explicitly asks to analyze their own prompt history, build a user profile, distill personality/work traits, or summarize communication preferences from provided prompts or local agent chat history.
Use when the user explicitly asks to analyze their own prompt history, build a user profile, distill personality/work traits, or summarize communication preferences from provided prompts or local agent chat history.
Expose the AI's visible inner monologue during work. Use when the session should allow short public asides in the format `▎InnerOS:...` alongside the main task output.
| name | agent-chat-history |
| description | 按 YYYY-MM-DD 在 Windows/macOS/Linux 检索本机聊天与 Agent 会话历史(Claude Code 项目 jsonl、Codex CLI history.jsonl、Cursor workspaceStorage 与 state.vscdb);可只导出用户提示词。用户要查看或导出某日记录、按天筛 jsonl/SQLite、只抽提示词、排查历史丢失或做只读审计时使用。 |
| disable-model-invocation | true |
YYYY-MM-DD:进入 skill 根目录 agent-chat-history/,运行下方命令;需要给下游贴结果时优先 --json。YYYY-MM-DD(本地时区日界),再问是否只要提示词、是否限定某一客户端。--prompts-only(可加 --include-claude-global-history);只要路径/文件线索 → 默认列表模式,必要时加 --sqlite-keys。--claude-scan all;仍不对则读 references/storage-paths.md 核对自定义安装路径。不要先把本文件整篇读进上下文。 在仓库或已安装 skill 的 agent-chat-history/ 下执行:
python scripts/query_history.py --date YYYY-MM-DD
python 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。
state.vscdb 已知 key 启发式抽取,版本变更后可能漏项或混入非纯用户句。history.jsonl 行内 ts(Unix 秒);无 ts 的行不会进入结果。CODEX_HOME、CLAUDE_CONFIG_DIR、Cursor --user-data-dir、Flatpak/Snap):脚本只覆盖常见布局,须对照 storage-paths.md 自行定位后再查。| 客户端 | 要点 |
|---|---|
| Claude Code | ~/.claude/projects/**/*.jsonl + 可选 history.jsonl;列表模式用 mtime 落在本地日 |
| Codex | history.jsonl 行内 ts(Unix 秒)落在本地日 |
| Cursor | workspaceStorage/<hash>/ 目录 mtime + state.vscdb;--sqlite-keys 仅列表模式下列 key |
路径与 DB key 随版本变化;未开启持久化或清理缓存可能导致无命中。只读;勿删改他人数据。