πŸ“¦ gentritbiba / history-context

File-based history search for Claude Code. Find which sessions edited specific files and retrieve conversation context.

β˜… 0 stars β‘‚ 0 forks πŸ‘ 0 watching
πŸ“₯ Clone https://github.com/gentritbiba/history-context.git
HTTPS git clone https://github.com/gentritbiba/history-context.git
SSH git clone git@github.com:gentritbiba/history-context.git
CLI gh repo clone gentritbiba/history-context
Gentrit Biba Gentrit Biba Initial release: history-context plugin for Claude Code 0913467 2 months ago πŸ“ History
πŸ“‚ master View all commits β†’
πŸ“ .claude-plugin
πŸ“ agents
πŸ“ cli
πŸ“ commands
πŸ“ hooks
πŸ“ skills
πŸ“„ install.sh
πŸ“„ README.md
πŸ“„ README.md

history-context

File-based history search for Claude Code. Find which sessions edited specific files and retrieve conversation context.

Why This Plugin?

Unlike semantic search (episodic-memory), this plugin uses Claude Code's native file-history tracking to know exactly which sessions edited which files. No git commits needed, works immediately.

Features

  • File-to-session mapping: Find all sessions that edited a specific file
  • Instant results: Uses a cached index of file-history, not full-text search on every query
  • Full context retrieval: Read conversation content with key decisions
  • Session IDs: Returns complete UUIDs for reference

Installation

From GitHub

# Add the marketplace
/plugins marketplace add gentritbiba/history-context

# Install the plugin
/plugins install history-context

That's It!

On first session start, the plugin automatically:

  • Copies the CLI tool to ~/.claude/commands/
  • Builds the file-history index
To manually rebuild the index later:
~/.claude/commands/claude-history.py index --rebuild

Usage

Via Skill (Automatic)

The file-history skill triggers automatically when you:

  • Ask about past work on a specific file
  • Want to understand why code was written
  • Reference "what we did before" on a feature

Via Slash Command

/file-history src/components/AuthForm.tsx

Via Agent

Use Task tool with subagent_type="history-context"
Prompt: "Find context for [file/feature]"

Via CLI

# Find sessions that edited a file
~/.claude/commands/claude-history.py file "AuthForm.tsx"

# Search conversations for a topic
~/.claude/commands/claude-history.py search "authentication"

# Get session details
~/.claude/commands/claude-history.py session <id> --read

# Rebuild index
~/.claude/commands/claude-history.py index --rebuild --stats

How It Works

  • Indexes file-history: Scans ~/.claude/file-history/ to build fileβ†’session mapping (cached for speed)
  • Maps sessions to projects: Cross-references with ~/.claude/projects/
  • Reads conversations: Extracts messages from session .jsonl files
  • Returns structured context: Summary, decisions, session IDs, paths

Why "Instant Results"?

  • First run/rebuild: Scans all file-history and builds an index at ~/.claude/file-session-index.json
  • Subsequent queries: Reads from cached index (~5ms) instead of scanning all files (~500ms+)
  • Auto-refresh: Cache rebuilds if older than 1 hour

vs episodic-memory

Aspecthistory-contextepisodic-memory
Query typeFile-specificSemantic/conceptual
AccuracyExact (file tracking)Fuzzy (embedding search)
SpeedIndexedFull search
Best for"What sessions touched this file?""How did we handle auth patterns?"
Use history-context when you have a specific file or feature in mind. Use episodic-memory for broad conceptual searches across all projects.

License

MIT