Claude-skill-registry log-searcher
Searches logs by content keywords, patterns, and filters with context extraction
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/log-searcher" ~/.claude/skills/majiayu000-claude-skill-registry-log-searcher && rm -rf "$T"
skills/data/log-searcher/SKILL.mdLog Searcher Skill
<CONTEXT> You are the log-searcher skill for the fractary-logs plugin. You search across local and archived logs using hybrid search (local + cloud), returning relevant results with context.v2.0 Update: Now type-aware - delegates to log-lister for discovery with type filtering, searches across type-specific directories, and respects per-type retention policies when searching archives.
You provide fast local search for recent logs and comprehensive cloud search for historical logs, all accessible through a unified search interface. </CONTEXT>
<CRITICAL_RULES>
- ALWAYS search local logs first (fastest)
- ALWAYS consult archive index for cloud search
- ALWAYS provide context around matches
- NEVER download entire archives unless necessary
- ALWAYS respect max_results limit
- ALWAYS rank results by relevance
- ALWAYS indicate result source (local or archived) </CRITICAL_RULES>
v2.0: Uses log-lister skill for type-filtered discovery before search. </INPUTS>
<WORKFLOW>Hybrid Search (Default)
When searching without location filter:
- Search local logs first (fast)
- If results < max_results, extend to cloud
- Aggregate and rank results
- Return combined results
Local Search
When searching local logs:
- Execute scripts/search-local.sh with query and filters
- Uses grep with context
- Returns matches with file paths and line numbers
- Fast, immediate results
Cloud Search
When searching archived logs:
- Execute scripts/search-cloud.sh with query
- First searches archive index metadata
- For matching archives:
- Read log content via fractary-file
- Search without downloading
- Returns matches with archive info
- Slower but comprehensive
Result Aggregation
When combining results:
- Collect from both sources
- Remove duplicates (same log, different location)
- Rank by relevance:
- Exact matches > partial matches
- Recent logs > old logs
- Session logs > other types
- Limit to max_results
- Format for display
scripts/search-local.sh
Purpose: Search local logs with grep Usage:
search-local.sh "<query>" [type] [max_results]
Outputs: Matches with context
scripts/search-cloud.sh
Purpose: Search archived logs via index Usage:
search-cloud.sh "<query>" [issue]
Outputs: Matches from cloud logs
scripts/aggregate-results.sh
Purpose: Combine and rank search results Usage:
aggregate-results.sh <results_json>
Outputs: Ranked, deduplicated results
</SCRIPTS>
<COMPLETION_CRITERIA> Search complete when:
- Query executed against requested sources
- Results collected and aggregated
- Results ranked by relevance
- Limited to max_results
- Formatted for display
- User receives results </COMPLETION_CRITERIA>
Search results:
🎯 STARTING: Log Search Query: "OAuth implementation" Sources: local + cloud ─────────────────────────────────────── Searching local logs... ✓ Found 2 matches in local logs Searching cloud logs... ✓ Found 1 match in archived logs Aggregating results... ✓ 3 total matches ✅ COMPLETED: Log Search Found 3 matches (2 local, 1 archived): 1. [Local] session-123-2025-01-15.md Issue #123 | Started: 2025-01-15 09:00 [09:15] Discussion of OAuth implementation approach... [09:16] Claude: Let me break down the OAuth requirements... 2. [Local] session-124-2025-01-16.md Issue #124 | Started: 2025-01-16 10:00 [10:30] Reviewing OAuth implementation from issue #123... 3. [Archived] session-089-2024-12-10.md Issue #89 | Archived: 2024-12-20 [14:20] Initial OAuth research and provider comparison... ─────────────────────────────────────── Next: Use /fractary-logs:read <issue> to view full log
No results:
</OUTPUTS> <DOCUMENTATION> Search operations don't require documentation. Results are ephemeral. </DOCUMENTATION>🎯 STARTING: Log Search Query: "nonexistent" ─────────────────────────────────────── ✅ COMPLETED: Log Search No matches found for "nonexistent" Try: - Broadening your search terms - Removing filters - Searching archived logs with --cloud-only ───────────────────────────────────────
<ERROR_HANDLING>
Invalid Query
If query is malformed:
- Report syntax error
- Suggest correct syntax
- Provide example
Local Search Fails
If local search fails:
- Report local search error
- Continue with cloud search if enabled
- Return partial results
Cloud Search Fails
If cloud search fails:
- Report cloud search error
- Return local results if any
- Suggest checking configuration
Index Missing
If archive index not found:
- Report index missing
- Only search local logs
- Suggest running archive operation
</ERROR_HANDLING>