$npx -y skills add AlexAI-MCP/hermes-CCC --skill hermes-searchSearch across past conversation sessions, memory files, and project history to recall what was discussed, decided, or built in previous sessions.
| 1 | # hermes-search |
| 2 | |
| 3 | Search across past conversation sessions, memory files, and project files to recall what was discussed, decided, or built. This skill is the cross-session retrieval complement to `hermes-compress`, which writes the memory, and `hermes-memory`, which indexes it. |
| 4 | |
| 5 | ## Invocation |
| 6 | |
| 7 | ``` |
| 8 | /hermes-search "<query>" |
| 9 | /hermes-search --memory "<query>" |
| 10 | /hermes-search --project "<query>" |
| 11 | /hermes-search --recent <N> |
| 12 | ``` |
| 13 | |
| 14 | --- |
| 15 | |
| 16 | ## Subcommands |
| 17 | |
| 18 | ### `/hermes-search "<query>"` — Search All Memory |
| 19 | |
| 20 | Searches all available memory sources in order: |
| 21 | |
| 22 | 1. `~/.claude/projects/*/memory/*.md` — all project memory files |
| 23 | 2. `~/.claude/history.jsonl` — conversation history log (if accessible) |
| 24 | 3. Project files under the current working directory |
| 25 | 4. `MEMORY.md` index |
| 26 | |
| 27 | Returns a unified result list sorted by relevance. |
| 28 | |
| 29 | **How Claude executes this:** |
| 30 | |
| 31 | ```bash |
| 32 | # Memory files |
| 33 | grep -r --include="*.md" -l "<query>" ~/.claude/projects/*/memory/ |
| 34 | |
| 35 | # Within matched files, extract surrounding context |
| 36 | grep -n -A 3 -B 3 "<query>" <matched-file> |
| 37 | |
| 38 | # Project files (from cwd) |
| 39 | grep -r --include="*.md" --include="*.py" --include="*.ts" \ |
| 40 | --include="*.json" -l "<query>" . |
| 41 | |
| 42 | # history.jsonl (if present) |
| 43 | grep "<query>" ~/.claude/history.jsonl | head -20 |
| 44 | ``` |
| 45 | |
| 46 | --- |
| 47 | |
| 48 | ### `/hermes-search --memory "<query>"` — Memory Files Only |
| 49 | |
| 50 | Restricts search to `~/.claude/projects/*/memory/*.md`. Faster and more focused. Use this when you know the information was captured in a previous session via `hermes-compress` or `hermes-memory`. |
| 51 | |
| 52 | **How Claude executes this:** |
| 53 | |
| 54 | ```bash |
| 55 | grep -r --include="*.md" -n -A 3 -B 3 "<query>" \ |
| 56 | ~/.claude/projects/*/memory/ |
| 57 | ``` |
| 58 | |
| 59 | Returns: file path, line number, and 3 lines of surrounding context per match. |
| 60 | |
| 61 | --- |
| 62 | |
| 63 | ### `/hermes-search --project "<query>"` — Project Files Only |
| 64 | |
| 65 | Restricts search to the current working directory. Useful for recalling where a piece of code or config lives. |
| 66 | |
| 67 | **How Claude executes this:** |
| 68 | |
| 69 | ```bash |
| 70 | grep -r --include="*.md" --include="*.py" --include="*.ts" \ |
| 71 | --include="*.js" --include="*.json" --include="*.yaml" \ |
| 72 | -n -l "<query>" . |
| 73 | ``` |
| 74 | |
| 75 | Claude then reads the top 3 matched files and extracts the relevant sections. |
| 76 | |
| 77 | --- |
| 78 | |
| 79 | ### `/hermes-search --recent <N>` — Recent N Sessions Summary |
| 80 | |
| 81 | Lists and summarizes the most recent N session memory files. |
| 82 | |
| 83 | **How Claude executes this:** |
| 84 | |
| 85 | ```bash |
| 86 | ls -t ~/.claude/projects/*/memory/session_*.md | head -<N> |
| 87 | ``` |
| 88 | |
| 89 | Claude reads each file and produces a one-line summary per session: |
| 90 | `[date] [project] — <top decision or artifact from that session>` |
| 91 | |
| 92 | --- |
| 93 | |
| 94 | ## Output Format |
| 95 | |
| 96 | All subcommands return results in the following structure: |
| 97 | |
| 98 | ``` |
| 99 | ## Search Results: "<query>" |
| 100 | Source: --memory | --project | all |
| 101 | Query time: <timestamp> |
| 102 | |
| 103 | ### Match 1 |
| 104 | - Source: ~/.claude/projects/ontology/memory/session_20260321_1430.md (line 47) |
| 105 | - Relevance: high |
| 106 | - Snippet: |
| 107 | > decisions: |
| 108 | > - "Use Neo4j as primary graph store for ontology nodes" ← MATCH |
| 109 | > - "REST API over gRPC for external integrations" |
| 110 | |
| 111 | ### Match 2 |
| 112 | - Source: ./AlexAI/api/routes.py (line 12) |
| 113 | - Relevance: medium |
| 114 | - Snippet: |
| 115 | > # Neo4j connection pool config ← MATCH |
| 116 | > driver = GraphDatabase.driver(uri, auth=(user, pw), max_connection_pool_size=20) |
| 117 | |
| 118 | --- |
| 119 | Total matches: 2 | Searched: 14 files |
| 120 | ``` |
| 121 | |
| 122 | **Relevance scoring** (heuristic): |
| 123 | - **High:** exact phrase match in a `decisions` or `facts_learned` block |
| 124 | - **Medium:** keyword match in a session file body or code comment |
| 125 | - **Low:** keyword match in a filename or metadata field |
| 126 | |
| 127 | --- |
| 128 | |
| 129 | ## What Gets Searched |
| 130 | |
| 131 | | Source | Path pattern | Format | |
| 132 | |--------|-------------|--------| |
| 133 | | Session summaries | `~/.claude/projects/*/memory/session_*.md` | YAML/Markdown | |
| 134 | | Memory index | `~/.claude/projects/*/memory/MEMORY.md` | Markdown | |
| 135 | | Honcho profiles | `~/.claude/projects/*/memory/user_honcho_profile.md` | YAML/Markdown | |
| 136 | | Project source files | `./**/*.{md,py,ts,js,json,yaml}` | Any | |
| 137 | | History log | `~/.claude/history.jsonl` | JSONL (if accessible) | |
| 138 | |
| 139 | --- |
| 140 | |
| 141 | ## Handling Missing Sources |
| 142 | |
| 143 | - If `~/.claude/history.jsonl` does not exist or is not readable, Claude skips it and notes: "history.jsonl not accessible — searching memory files only." |
| 144 | - If no memory files exist, Claude reports: "No memory files found. Run `/hermes-compress` after a session to start building memory." |
| 145 | - If project files return too many matches (>50), Claude limits output to the top 10 by file modification date (most recent first). |
| 146 | |
| 147 | --- |
| 148 | |
| 149 | ## Relationship to Hermes FTS5 Session Search |
| 150 | |
| 151 | This skill is the Claude Code equivalent of Hermes Agent's full-text search over its SQLite session store (using SQLite FTS5). I |