rg_history

Search your conversation history using ripgrep. Use when you need to find previous messages, file edits, tool calls, or decisions from earlier in the session.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "rg_history" with this command: npx skills add backnotprop/rg_history/backnotprop-rg-history-rg-history

rg_history

Search your session history with ripgrep.

CRITICAL: Search Strategy

Each event is one long JSON line. Full output will overwhelm you. Always start broad with limited output, then narrow in.

The Pattern

# 1. COUNT first - how many matches?
rg -c 'search_term' session.jsonl

# 2. SNIPPETS - get context around matches (not full lines)
rg -o '.{0,60}search_term.{0,60}' session.jsonl | head -20

# 3. NARROW - pipe to filter further
rg -o '.{0,60}search_term.{0,60}' session.jsonl | rg 'new_string'

# 4. FULL CONTEXT - only when you know what you want
rg '"name":"Edit".*search_term' session.jsonl -M 500

Never run raw rg 'pattern' file.jsonl - you'll get walls of JSON.

Always use one of:

  • -c to count matches
  • -o '.{0,60}pattern.{0,60}' for snippets
  • -M 200 to truncate lines
  • | head -20 to limit results

Find Your Session Files

Run the helper script:

scripts/list-sessions.sh /path/to/project  # defaults to cwd

Or construct manually:

~/.claude/projects/{encoded_project_path}/{session_id}.jsonl

Where encoded_project_path = project path with / replaced by -.

File Structure

~/.claude/projects/-Users-ramos-my-project/
├── abc123-def4-5678-....jsonl    # Main session (UUID format)
├── agent-a1b2c3d.jsonl           # Sub-agent spawned by Task tool
└── ...
  • Main session: Full UUID, your conversation
  • Agent files: agent-{7-char-id}.jsonl, from Task tool
  • Agent IDs appear in results as "agentId": "a1b2c3d"

JSONL Structure Reference

Each line is one JSON object. Key fields:

Message types:

  • "type":"user" + "userType":"external" = actual human input
  • "type":"assistant" = Claude's responses
  • "type":"tool_result" = tool output

Tool calls (in assistant messages):

  • "name":"Edit""input":{"file_path":"...", "old_string":"...", "new_string":"..."}
  • "name":"Write""input":{"file_path":"...", "content":"..."}
  • "name":"Bash""input":{"command":"..."}
  • "name":"Task""input":{"prompt":"...", "subagent_type":"..."}

Content blocks:

  • "type":"text" - message text
  • "type":"thinking" - Claude's reasoning
  • "type":"tool_use" - tool invocation

Other fields:

  • "timestamp":"2025-12-20T..." - when it happened
  • "agentId":"..." - links to agent file
  • "isCompactSummary":true - compacted context

Example Search Patterns

Remember: always use snippets or limit output!

# Find human messages (not tool results)
rg -o '.{0,40}"userType":"external".{0,40}' session.jsonl | head -10

# Find file edits
rg -c '"name":"Edit"' session.jsonl  # count first
rg -o '.{0,50}"name":"Edit".{0,50}' session.jsonl | head -10

# Find edits to specific file
rg -o '.{0,30}auth.{0,30}' session.jsonl | rg 'file_path'

# Find commands that were run
rg -o '.{0,80}"command":".{0,80}' session.jsonl | head -10

# Find code in file writes
rg -o '.{0,60}function.{0,60}' session.jsonl | rg 'new_string\|content'

Quick Reference

GoalCommand
Count matchesrg -c 'pattern' file
Snippetsrg -o '.{0,60}pattern.{0,60}' file
Limit output| head -20
Truncate lines-M 200
Case insensitive-i
Chain filtersrg 'a' | rg 'b'

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

test_skill

import json import tkinter as tk from tkinter import messagebox, simpledialog

Archived SourceRecently Updated
General

错敏信息检测

1. 安装https://clawhub.ai/xxxx/sensitive-check-skill 这个技能 2. 调用错敏信息检测技能,传入参数 userKey=xxxx,content=xxxx

Archived SourceRecently Updated
General

neo

Browse websites, read web pages, interact with web apps, call website APIs, and automate web tasks. Use Neo when: user asks to check a website, read a web page, post on social media (Twitter/X), interact with any web app, look up information on a specific site, scrape data from websites, automate browser tasks, or when you need to call any website's API. Keywords: website, web page, browse, URL, http, API, twitter, tweet, post, scrape, web app, open site, check site, read page, social media, online service.

Archived SourceRecently Updated
General

image-gen

Generate AI images from text prompts. Triggers on: "生成图片", "画一张", "AI图", "generate image", "配图", "create picture", "draw", "visualize", "generate an image".

Archived SourceRecently Updated