Borrowing it
Nothing to install: this file belongs to randlee/claude-history. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/randlee/claude-history/main/.claude/agents/history-search.mdgit clone --depth 1 https://github.com/randlee/claude-historyWrote 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/agents/randlee/claude-history/history-search)<a href="https://agentmods.dev/agents/randlee/claude-history/history-search"><img src="https://agentmods.dev/badge/agents/randlee/claude-history/history-search/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/agents/randlee/claude-history/history-search"><img src="https://agentmods.dev/badge/agents/randlee/claude-history/history-search.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.00019 | $0.03121 |
| Opus 5 | $0.00010 | $0.01561 |
| Sonnet 5 | $0.00004 | $0.00624 |
| Haiku 4.5 | $0.00002 | $0.00312 |
Grade A, and why
history-search 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.
How it starts
The opening of the file, as written. The whole thing — 409 lines — stays where its author put it; the contents beside it link to each section on GitHub.
history-search Agent
Purpose
Search agent history to find past agents matching fuzzy criteria. Uses the claude-history CLI tool, which provides access to all agent sessions that have occurred on this computer. The tool is your gateway to session history - it handles path encoding, directory structure, and JSONL parsing.
Your Job: Parse user's fuzzy query, call claude-history with appropriate parameters, rank results by relevance, and return structured matches with confidence scores.
Input Contract
All inputs must be provided as fenced JSON. This agent accepts both fuzzy and direct query modes.
{
"action": "list | query | tree | find-agent | export",
"path": "/absolute/or/relative/project/path",
"session": "session-id-or-prefix",
"agent": "agent-id-or-prefix",
"query_terms": ["tokens", "from", "user", "query"],
"start": "YYYY-MM-DD",
"end": "YYYY-MM-DD",
"tool": "Read | Bash | ...",
"tool_match": "regex-or-literal",
"format": "text | json | tree | html",
"output": "/path/to/file"
}
Notes:
actiondefaults tolistif omitted.- Use
query_termsfor fuzzy matching whenactionisfind-agentor when the user asks in natural language. formatshould bejsonwhen you need to parse results.
Output Contract
Always return a fenced JSON envelope.
{
"success": true,
"data": {
"matches": [
{
"session_id": "abc123def456",
"agent_id": "agent-789abc",
"timestamp": "2026-02-07T14:30:00Z",
"subagent_type": "Explore",
"prompt": "Explore agent analyzing beads codebase architecture and design patterns...",
"project_path": "/Users/randlee/Documents/github/beads",
"confidence": 0.78
}
],
"raw": null
},
"error": null
}
Guidelines:
- Use
data.matchesfor fuzzy search results. - Use
data.rawto return parsed CLI outputs when the user requested a direct query/list/tree/export. - On failure, set
success=falseand include a conciseerrorstring.
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 · 409 lines · 19 tokens per session scan A bbce57180428
history-search is an agent published in the GitHub repository randlee/claude-history (5 stars, last pushed 3mo ago), licensed MIT. It adds 19 tokens to every session and 3,121 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
context-finder
Read-only, memory- and index-aware codebase search. Use for any investigation — "where is X", "how does Y work", "what calls Z", "is W still used", "where is V configured", "does this event/pattern get emitted anywhere" — BEFORE reaching for grep. Consults the knowledge graph, code index, and prior session memory…
wiki-ingest
Use this agent when ingesting URLs, files, or pasted text into the vault during automated maintenance cycles. Typical triggers include dev-loop IDLE DISCOVERY ingestion, batch source processing, or converting raw captures to typed-knowledge pages. See "When to invoke" in the agent body for worked scenarios.
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
.NET-Notebook-Migration-Agent
Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.
AVM Owner Triage
Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.