home / skills / trevors / dot-claude / glhf

glhf skill

/skills/glhf

This skill helps you quickly locate past solutions and commands from Claude Code conversations using semantic and text search across sessions.

npx playbooks add skill trevors/dot-claude --skill glhf

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.9 KB
---
name: glhf
description: Search Claude Code conversation history to find past solutions, recall commands, and discover related work. Use when looking for previous implementations, finding commands you ran before, or exploring what was done in past sessions.
---

# glhf

Search your Claude Code conversation history using hybrid search (text + semantic).

## Quick Examples

```bash
# Find past solutions (semantic search)
glhf search "authentication" --mode semantic --compact

# Find commands you've run
glhf search "docker" -t Bash --compact

# Check recent sessions
glhf recent -l 10

# Get session overview then dive deeper
glhf session abc123 --summary
glhf session abc123 --limit 50
```

## Commands

| Command    | Purpose                              |
| ---------- | ------------------------------------ |
| `search`   | Find content across all sessions     |
| `session`  | View a specific session's content    |
| `related`  | Find sessions similar to a given one |
| `recent`   | List recent sessions                 |
| `projects` | List all indexed projects            |
| `status`   | Show index stats                     |
| `index`    | Rebuild the search index             |

## Key Search Flags

| Flag                | Purpose                                       |
| ------------------- | --------------------------------------------- |
| `--compact`         | One-line output, fewer tokens                 |
| `--mode semantic`   | Conceptual search (how to X, patterns)        |
| `--mode text`       | Exact keyword matching                        |
| `-t Bash`           | Filter by tool (Bash, Read, Edit, Grep, etc.) |
| `-p .`              | Filter to current project                     |
| `--since 1d`        | Time filter (1h, 2d, 1w, or date)             |
| `--errors`          | Only show error results                       |
| `--show-session-id` | Include session IDs for follow-up             |

## Recommended Patterns

**Find past solutions:**

```bash
glhf search "problem description" --mode semantic --compact
glhf search "specific keyword" --show-session-id --compact
glhf session <id> --summary
```

**Recall commands:**

```bash
glhf search "git rebase" -t Bash --compact
glhf search "cargo" -t Bash --since 1w --compact
```

**Find similar work:**

```bash
glhf recent -l 10
glhf related <session-id> --limit 5
```

**Debug past errors:**

```bash
glhf search "error" --errors --since 1d --compact
```

## Tips

1. **Always use `--compact`** - significantly reduces output tokens
2. **Use `--mode semantic`** for "how to" questions and conceptual searches
3. **Use `--mode text`** for exact keywords and error messages
4. **Chain commands**: search → get session ID → view summary → get full context
5. **Current project/session auto-excluded** when running inside Claude Code
6. **Use `-p .`** to filter to current project when you want to include it
7. **Use `glhf <command> --help`** for complete option documentation

Overview

This skill indexes and searches Claude Code conversation history with a hybrid text+semantic engine to help you rediscover past solutions, commands, and related sessions. It surfaces concise results and session IDs so you can quickly review or reopen prior work. Use it to recall exact commands, revisit implementation patterns, or find similar past projects.

How this skill works

The tool runs a hybrid search combining keyword matching and semantic vectors across all indexed Claude Code sessions. You can filter by tool type (Bash, Read, Edit, Grep, etc.), time range, project, and error-only results. Commands return session IDs and compact summaries so you can open a session or expand context as needed.

When to use it

  • When you need to find a past implementation or copy a prior solution.
  • When you want to recall commands you ran (e.g., git, docker, cargo).
  • When exploring similar sessions or related work to avoid duplicating effort.
  • When debugging recurring errors and you want prior troubleshooting steps.
  • When auditing recent activity across projects or sessions.

Best practices

  • Use --compact to get one-line, token-efficient results for fast scanning.
  • Prefer --mode semantic for conceptual, “how-to” or pattern searches; use --mode text for exact error messages or keywords.
  • Filter by tool with -t (e.g., Bash) to narrow results to command snippets.
  • Apply time filters (--since 1d, 1w, or specific date) to focus recent work.
  • Chain commands: search → capture session ID → session <id> --summary → session <id> --limit N for full context.

Example use cases

  • Find a prior authentication implementation: glhf search "authentication" --mode semantic --compact
  • Rediscover a command you ran: glhf search "docker" -t Bash --compact
  • Review recent sessions to catch up: glhf recent -l 10
  • Inspect a specific session quickly: glhf session abc123 --summary then glhf session abc123 --limit 50
  • Find sessions with errors from the last day: glhf search "error" --errors --since 1d --compact

FAQ

How do I get the session ID for follow-up?

Include --show-session-id in search results or use --compact and the tool will include session IDs when available.

When should I use --mode semantic vs --mode text?

Use semantic for conceptual searches and pattern discovery; use text for exact matches like error messages or precise keywords.