AgentSkillsCN

genesis-tools:claude-history

搜索 Claude Code 会话历史。适用于通过关键词、修改过的文件、使用过的工具,或特定时间范围来查找过往对话。可通过“查找对话”、“搜索历史”、“我曾在哪儿”、“你曾在哪儿”、“我们何时讨论过”、“查找某处”、“回顾我们的对话”等短语来触发。

SKILL.md
--- frontmatter
name: genesis-tools:claude-history
description: Search Claude Code conversation history. Use for finding past conversations by keywords, files modified, tools used, or time range. Triggers on "find conversation", "search history", "where did I", "where did you", "when did we discuss", "find where", "look up our conversation".

Claude History Search

Search through Claude Code conversation history to find past interactions.

Quick Reference

bash
# Basic search
tools claude-history "keyword"

# Search with filters
tools claude-history "query" --tool Edit --since "7 days ago"

# Interactive mode
tools claude-history -i

Common Use Cases

Find by Keywords

bash
tools claude-history "backup mcp-manager refactor"
tools claude-history "authentication bug" --exact

Find by File Modified

bash
tools claude-history --file "config/api.php"
tools claude-history --file "*.tsx" --tool Edit

Find by Tool Usage

bash
tools claude-history --tool Edit --since "7 days ago"
tools claude-history --tool Task --limit 50

Find by Project

bash
tools claude-history "timer" --project GenesisTools
tools claude-history "migration" --all  # Search all projects

Show Context

bash
tools claude-history "timer" --context 10  # 10 messages before/after

CLI Options

OptionDescription
-i, --interactiveInteractive mode with autocomplete
-p, --project <name>Filter by project name
--allSearch all projects
-f, --file <pattern>Filter by file path pattern
-t, --tool <name>Filter by tool (Edit, Write, Bash, etc.)
--since <date>Since date (e.g., "7 days ago", "yesterday")
--until <date>Until date
-l, --limit <n>Limit results (default: 20)
-c, --context <n>Show N messages before/after match
--exactExact match instead of fuzzy
--regexUse regex for query
--agents-onlyOnly search subagent conversations
--exclude-agentsExclude subagent conversations
--exclude-thinkingExclude thinking blocks
--format <type>Output: ai (default), json

Output Formats

Default (ai): Perfect markdown with summaries and file paths With --context: Shows surrounding messages in markdown JSON: Raw JSON for programmatic use