glhf — Conversation History Search
Search your Claude Code conversation history using hybrid search (text + semantic).
How to run it (read this first)
Figure out the search query yourself, then run glhf search — never run it empty and never bounce the question back to the user.
- Explicit
/glhf <query>→ use$ARGUMENTSas the query:glhf search "$ARGUMENTS" --compact - Auto-triggered from the conversation →
$ARGUMENTSis empty. Derive concise search terms from what the user is trying to recall (the topic, error text, command, or project they referenced) and run the search with those. Do not ask them to restate it.
Example: user says "what was that cargo alias I set up?" → run glhf search "cargo alias" -t Bash --compact. Then read the hits and answer; chain into glhf session <id> --summary if you need fuller context.
Quick Examples
# Find past solutions
glhf search "authentication" --compact
# Find commands you've run
glhf search "docker" -t Bash --compact
# Filter by project and time
glhf search "bug" -p myapp --since 1w --compact
# Find errors
glhf search "failed" --errors --compact
# Check recent sessions
glhf recent -l 10
# Get session overview then dive deeper
glhf session abc123 --summary
glhf session abc123 --limit 30
Commands
| Command | Purpose |
| --------- | ------------------------------------- |
| search | Find content across all sessions |
| session | View a specific session's content |
| recent | List recent sessions |
| status | Show index stats |
| index | Update index (incremental by default) |
Search Flags
| Flag | Purpose |
| ---------------- | --------------------------------------------------- |
| --compact | One-line output, fewer tokens |
| -l/--limit | Max results to return (default 10) |
| -t/--tool | Filter by tool (Bash, Read, Edit, Grep, etc.) |
| -p/--project | Filter by project name (substring match, . = cwd) |
| --since | Time filter (1h, 2d, 1w, or date) |
| --errors | Only show error results |
| --json | Machine-readable JSON output |
Session Flags
| Flag | Purpose |
| -------------- | ------------------------------------ |
| --summary | Show session summary without content |
| -l/--limit | Show only first N messages |
| --json | Machine-readable JSON output |
Recommended Patterns
Find past solutions:
glhf search "problem description" --compact
glhf search "specific keyword" --compact
glhf session <id> --summary
Recall commands:
glhf search "git rebase" -t Bash --compact
glhf search "cargo" -t Bash --since 1w --compact
Find errors:
glhf search "error" --errors --since 1d --compact
Browse recent work:
glhf recent -l 10
glhf recent -p myproject
Tips
- Always use
--compact— significantly reduces output tokens - Chain commands: search, find session ID in output, then
glhf session <id> --summaryfor full context - Use
-p .to filter to current project - Use
--jsonwhen piping to other tools or processing programmatically - Index is incremental —
glhf indexonly re-processes changed files. Use--fullto rebuild,--skip-embeddingsfor text-only indexing - Search shows staleness hints — if the index is behind, it prints how many files changed. Run
glhf indexto update