Agent skill
session-search
For CLI agents WITHOUT subagent support (e.g., Codex CLI). Search previous code agent sessions for specific work, decisions, or code patterns.
Install this agent skill to your Project
npx add-skill https://github.com/pchalasani/claude-code-tools/tree/main/plugins/aichat/skills/session-search
SKILL.md
If you are Claude Code: Do NOT use this skill directly. Use the
session-searchersubagent via the Task tool instead - it handles this more efficiently without polluting your context.
session-search
Search and find previous code agent sessions (Claude-Code or Codex-CLI) for specific work, decisions, or code patterns.
Workflow
- Understand the query: Identify what the user is looking for (code patterns, decisions, specific work, design direction)
- Search with aichat: Run
aichat search --json -n 10 "[query]"(use-g "project"to filter by project) - Parse results: Use
jqto extract fields from JSONL output (session_id, project, created, snippet, file_path) - Deep dive if needed: Read session files at
~/.claude/projects/*/[session-id].jsonl(max 3 files) - Summarize: Return a focused summary with key findings and references
Run aichat search --help to see all options (date filters, branch filters, etc.)
and JSONL field names.
Output Format
Return a concise summary containing:
- Key Findings: 2-3 bullet points answering the query
- Relevant Sessions: Session IDs and dates for reference
- Specific Content: Code snippets or quotes if directly relevant
Format as clean markdown, not raw JSON.
Example
Query: "Find sessions where we discussed authentication design"
aichat search --json -n 10 "authentication design"
Summary:
- Session abc123 (Dec 10): Discussed JWT vs session-based auth, decided on JWT
- Session def456 (Dec 8): Implemented refresh token rotation pattern
Constraints
- ALWAYS use
--jsonflag with aichat search (otherwise it spawns interactive UI) - NEVER return raw JSON output to the user - summarize and distill findings
- NEVER read more than 3 session files per query
- If no results found, suggest alternative search terms
- ONLY report information directly observed in files - never infer or extrapolate
Error Handling
If aichat search command fails or is not found, ask user to install:
uv tool install claude-code-tools # Python package
cargo install aichat-search # Rust search TUI
Prerequisites:
- Node.js 16+ (for action menus)
- Rust/Cargo (for aichat-search)
If user doesn't have uv or cargo:
curl -LsSf https://astral.sh/uv/install.sh | sh # uv
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # Rust
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
msg
Inter-agent communication via the msg CLI. Use this when you need to send messages to other agent sessions, read incoming messages, or coordinate with other agents in tmux panes.
code-walk-thru
Use this when user wants you to walk through (code or text) files in a EDITOR to either explain how some code works, or to show the user what changes you made, etc. You would typically use this repeatedly to show the user your changes or code files one by one, sometimes with specific line-numbers. This way the user is easily able to follow along in their favorite EDITOR as you point at various files possibly at specific line numbers within those files.
make-issue-spec
socratic-quiz
Use this when the user wants to deeply understand something through guided questioning. Trigger phrases include: "quiz me", "help me understand", "Socratic", "teach me", "walk me through with questions", "test my understanding", or when the user asks for an explanation and would benefit more from guided discovery than a direct answer.
log-work
tmux-cli
CLI utility to communicate with other CLI Agents or Scripts in other tmux panes; use it only when user asks you to communicate with other CLI Agents or Scripts in other tmux panes.
Didn't find tool you were looking for?