find-session

A tool for finding past DSH conversations by title or text and reading their content or usage statistics. DSH is the system referenced by the skill for storing agent sessions.

In plain words
What is it for?
It helps search recent or all stored sessions, open a session by ID, filter by project or date, and view token statistics.
Why use it?
It avoids manually searching session files and makes it easier to locate earlier work or inspect its token and time usage.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ooooooooooooooooooop/agent-tools/find-session
Any agent
npx skills add ooooooooooooooooooop/agent-tools --skill find-session
Clone the repo
git clone --depth 1 https://github.com/ooooooooooooooooooop/agent-tools

Made for: Claude Code, Codex.

Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 929 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00053 $0.00929
Opus 5 $0.00026 $0.00464
Sonnet 5 $0.00011 $0.00186
Haiku 4.5 $0.00005 $0.00093

Measured 2d ago against content hash c55006e12818, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

find-session scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/find_session.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/find-session/SKILL.md · 69 lines

What it actually says

快速定位与跟踪 DSH 会话

用于用户要求"按对话名/标题找会话""跟踪某个对话""查看某次会话内容或 token 消耗"时。统一入口是本 Skill 包内脚本 scripts/find_session.py(相对本 Skill 目录),不临场另写遍历逻辑。

路径提示:Skill 包在 ~/.dsh/skills/find-session/(仓库源在 skills/find-session/)。以下命令均假设当前目录为本 Skill 目录,或把 scripts/find_session.py 换成绝对路径 ~/.dsh/skills/find-session/scripts/find_session.py

触发边界

  • 适用:按标题关键词搜索会话、按正文关键词搜索会话、读取某会话消息内容、查看会话 token/时间统计、按项目或时间范围过滤。
  • 不适用:修改/删除会话、DSH 内部状态变更、跨设备同步。这些不得套用本 Skill。

数据源与固定事实

  • 索引:~/.dsh/storages/session_projcache.json(title/cwd/createdAt/sessionStats/tokenUsage)。
  • 内容:~/.dsh/sessions/<项目>/<session>/session.jsonl.zstd(多帧 zstd,必须流式解压,单帧 decompress 只解第一帧)。
  • 正文搜索默认只扫最近 30 个会话(全量解压 200+ 会话慢),需要全量时加 --full

固定执行

  1. 标题搜索(快,走索引):

    python scripts/find_session.py <关键词>                # 列出匹配会话(按时间倒序)
    python scripts/find_session.py <关键词> --content      # 搜索后直接读最新匹配会话内容
    
  2. 正文全文搜索(慢,需解压):

    python scripts/find_session.py --grep <关键词>          # 默认最近 30 个会话
    python scripts/find_session.py --grep <关键词> --full   # 全量扫描
    
  3. 按会话 id 操作:

    python scripts/find_session.py --id <session-id>        # 读取消息内容
    python scripts/find_session.py --id <id> --stats        # token/时间统计
    
  4. 过滤与排序(标题/正文搜索均生效):

    python scripts/find_session.py <关键词> --project 桌面    # 按项目路径过滤
    python scripts/find_session.py <关键词> --since 2026-08-01 --until 2026-08-31
    python scripts/find_session.py <关键词> --sort tokens     # time|tokens|turns
    python scripts/find_session.py <关键词> --max 5           # 结果条数上限
    

输出与失败报告

  • 输出完整 token 消耗(未缓存输入 + 缓存读 + 输出 + 缓存写),来自 tokenUsage.totals,不用单一 decodeTokens。
  • 搜索无匹配时报告"无匹配会话",不以空结果冒充成功;会话文件缺失时给出明确提示。
  • 只读操作,不改动任何会话数据。

验证

  • 每次使用后核对:搜索关键词是否命中预期会话、token 统计是否与 ~/.dsh/storages/session_projcache.jsontokenUsage.totals 一致。
  • 改动脚本后回归:至少跑一次标题搜索、一次 --grep 正文搜索、一次 --id --stats,确认三项路径输出正常。

脚本是唯一入口:

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 69 lines · 53 tokens per session scan A c55006e12818

Subscribe to this mod's changes

find-session is a skill published in the GitHub repository ooooooooooooooooooop/agent-tools (2 stars, last pushed 3d ago), licensed MIT. It adds 53 tokens to every session and 929 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

zlog

Multi-agent session log compressor and storage optimizer. Compresses .log, .out, .txt, .trace (>10KB) to .zst, .xz, or .gz (saving 77%-99.9% disk space) across /.gemini, /.config/Cursor, /.ollama, /.claude, /.windsurf, /.codex, etc. Auto-discovers AI log dirs, purges empty 0-byte logs. Safe for concurrent…

sebin-gg/zlog · 150 tokens

agent-memory

../../../engineering/agent-memory/skills/agent-memory/SKILL.md.

alirezarezvani/claude-skills · 0 tokens

amazon-reviews-api-skill

This skill helps users automatically extract Amazon product reviews via the Amazon Reviews API. Agent should proactively apply this skill when users express needs like getting reviews for Amazon product with ASIN B07TS6R1SF, analyzing customer feedback for a specific Amazon item, getting ratings and comments for a…

browser-act/skills · 124 tokens

ai-security

../../../engineering-team/skills/ai-security/SKILL.md.

alirezarezvani/claude-skills · 0 tokens

amazon-competitor-analyzer

Scrapes Amazon product data from ASINs using browseract.com automation API and performs surgical competitive analysis. Compares specifications, pricing, review quality, and visual strategies to identify competitor moats and vulnerabilities.

browser-act/skills · 48 tokens

ctf-malware

Provides malware analysis and network traffic techniques for CTF challenges. Use when analyzing obfuscated scripts, malicious packages, custom crypto protocols, C2 traffic, PE/.NET binaries, RC4/AES encrypted communications, YARA rules, shellcode analysis, memory forensics for malware (Volatility malfind, process…

ljagiello/ctf-skills · 101 tokens