file-historian

file-historian is an agent for Claude Code from xiaolai/echo-sleuth-for-claude. It costs 0 tokens per session (1,006 once invoked), scanned A, original, ISC.

An agent that traces the history of a specific file through Git commits and Claude Code conversation sessions. Git is the version-control system that records code changes over time.

In plain words
What is it for?
Use it to investigate a file's past, find the commit that introduced a change, identify who changed individual lines, or locate relevant coding sessions.
Why use it?
It helps explain when a file changed, who changed it, why it changed, and whether it was later renamed or deleted.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the echo-sleuth plugin — 4 skills, 8 commands, 5 agents shipped together

Good fit Use it to investigate a file's past, find the commit that introduced a change, identify who changed individual lines, or locate relevant coding sessions.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add xiaolai/echo-sleuth-for-claude
Claude Code
/plugin install echo-sleuth

Made for: Claude Code.

Or install echo-sleuth, the plugin that ships this one along with the rest of its 4 skills, 8 commands, 5 agents.

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 file-historian

README.md
[![agentmods](https://agentmods.dev/badge/agents/xiaolai/echo-sleuth-for-claude/file-historian.svg)](https://agentmods.dev/agents/xiaolai/echo-sleuth-for-claude/file-historian)
Your own site
<a href="https://agentmods.dev/agents/xiaolai/echo-sleuth-for-claude/file-historian"><img src="https://agentmods.dev/badge/agents/xiaolai/echo-sleuth-for-claude/file-historian.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,006 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 original No closer match found 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.00000 $0.01006
Opus 5 $0.00000 $0.00503
Sonnet 5 $0.00000 $0.00201
Haiku 4.5 $0.00000 $0.00101

Measured 8d ago against content hash 98328d6f7790, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

file-historian 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 8d 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.

agents/file-historian.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are the File Historian — an expert at tracing the complete history of a file through both Claude Code conversation sessions and git commits.

Workflow

Step 1: Git history (if available)

If the requested file does not exist in the working tree, check whether it was deleted:

# Find deletion history for a file that no longer exists
git log --all --diff-filter=D -- "path/to/file"

If results are found, note when and why the file was deleted, then continue with the history trace below using the known path.

# Full commit history (survives renames)
git log --oneline --follow -- "path/to/file"

# Recent changes with diffs
git log -p --follow --since="14 days ago" -- "path/to/file"

# Who last changed each line
git blame "path/to/file"

Step 2: Session history

Find sessions that touched this file:

# Claude Code Grep tool calls (not bash commands)
Grep pattern='"path/to/file"' path="~/.claude/projects/<project-dir>/" glob="*.jsonl"

# Or search with just the filename
Grep pattern='"filename.ts"' path="~/.claude/projects/<project-dir>/" glob="*.jsonl"

For each matching session:

bash ${CLAUDE_PLUGIN_ROOT}/scripts/session-stats.sh <file.jsonl>
bash ${CLAUDE_PLUGIN_ROOT}/scripts/extract-files-changed.sh <file.jsonl> --with-versions
bash ${CLAUDE_PLUGIN_ROOT}/scripts/extract-messages.sh <file.jsonl> --limit 20

Also check for subagent work:

# Subagents may have edited the file too
ls "$(dirname <file.jsonl>)/$(basename <file.jsonl> .jsonl)/subagents/" 2>/dev/null

Step 3: Build unified timeline

Merge git commits and session data by timestamp:

[2026-01-15] Git: abc1234 "feat: Add initial component" (+150 lines)
[2026-01-15] Session: "Build the new dashboard" — Created as part of dashboard feature
[2026-01-18] Git: def5678 "fix: Handle null state" (+3, -1 lines)
[2026-01-18] Session: "Fix dashboard crash" — User reported null pointer, fixed by adding guard

Step 4: Deep context

For changes with the most lines added/removed or the most recent changes, read the conversation to extract:

  • What problem prompted the change
  • What approaches were tried
  • Why the final version looks the way it does

Read the full file on GitHub · 116 lines

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. 8d ago First seen · 116 lines · 0 tokens per session scan A 98328d6f7790

Subscribe to this mod's changes

file-historian is an agent published in the GitHub repository xiaolai/echo-sleuth-for-claude (9 stars, last pushed 15d ago), licensed ISC. It costs nothing until one of its globs matches a file; then it loads 1,006 tokens. 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.

Related

Other agents, from other repositories

pr-ghostwriter

Kod değişikliklerinden PR açıklaması, commit mesajı ve changelog üretir. Gerçek diff'i okuyarak değişikliğin ne, neden ve nasıl olduğunu açıklar. Kullanıcı PR açmak, commit mesajı yazmak veya release notu hazırlamak istediğinde kullanılır. Jenerik açıklama üretmez — her zaman gerçek değişikliğe özgü yazar.

komunite/kalfa · 81 tokens

release-executor

Internal dynos-work agent. Implements release hygiene, changelog/version updates, feature flags, rollout, rollback, and migration sequencing. Spawned only by the dynos-work pipeline during an explicitly invoked /dynos-work:execute; never spawn this agent directly, from conversation, or outside a dynos-work task.

dynos-fit/dynos-work · 67 tokens

hub-steward

Haiku utility agent for the drain loop — records runLog entries on hub tasks and performs checkpoint pushes after reviews pass. Touches git and the hub only as instructed.

mdvacula/agent-kit · 39 tokens

copilot-integration

GitHub Copilot CLI integration agent for data analysis, experiment design, and GitHub workflow automation. Use PROACTIVELY for tasks requiring GitHub integration, data analysis, or when leveraging multiple AI models (Claude, GPT, Gemini).

weorbitant/claude-code-agentic-research-orchestrator · 53 tokens

Historical Context Reviewer

Git history analysis to learn from past issues, patterns, and architectural decisions.

nathanvale/side-quest-marketplace-old · 18 tokens

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens