Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计未展示

rg_history历史

Agent Skill

rg_history 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

259

周安装

11

GitHub Stars

50

下载量

91
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:rg_history(历史)
来源仓库:https://github.com/backnotprop/rg_history
仓库路径:skills/rg_history
安装命令:
npx skills add https://github.com/backnotprop/rg_history --skill rg_history
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/backnotprop/rg_history --skill rg_history

简介

rg_history 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于基于关键词或任务场景的信息聚合场景。
  • 可通过 npx 命令从 rg_history 仓库安装,建议查看原始 README 了解具体用法。
  • 使用前需确认权限范围和维护状态,警惕可能的联网或文件读写行为。
  • 输出内容应以原始 README 和项目事实为依据,不直接作为最终结论。

SKILL.md

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 filters`rg 'a' \rg 'b'`

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.9%
按下载量换算28

Gemini CLI

21.9%
按下载量换算20

Antigravity

16.66%
按下载量换算15

windsurf

12.8%
按下载量换算12

trae

8.18%
按下载量换算7

OpenCode

3.54%
按下载量换算3

安全审计

暂无安全审计结果可展示。

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills