# Chat History

> Search, inspect, and export Claude Code, Cursor, and Codex conversation history. Use when the user asks about past conversations, wants to find a previous session, needs to search chat history, wants a summary of what they worked on, or asks to resume a session. Also use when the user says "what did I work on", "find that conversation where I...", "show me my recent sessions", or "search my histo…

- **Type:** Skill
- **Install:** `agentstack add skill-ay-bh-chat-history-chat-history`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ay-bh](https://agentstack.voostack.com/s/ay-bh)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ay-bh](https://github.com/ay-bh)
- **Source:** https://github.com/ay-bh/chat-history
- **Website:** https://crates.io/crates/chat-history

## Install

```sh
agentstack add skill-ay-bh-chat-history-chat-history
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# chat-history

Repo: https://github.com/ay-bh/chat-history

## Install

```bash
cargo install chat-history
```

This installs both `chat-history` and `ch` (short alias) into `~/.cargo/bin/`.

## When to use

- User asks about past conversations or sessions
- User wants to find something they discussed before
- User needs a summary of recent work / accomplishments
- User wants to search across all Claude Code or Cursor history
- User wants to resume or export a previous session

## Commands

```bash
# List sessions
chat-history                               # all sessions, newest first
chat-history --from yesterday -s           # grouped by day
chat-history --from "3 days ago"           # natural language dates
chat-history --source claude               # Claude Code only
chat-history --source cursor               # Cursor only
chat-history --source codex                # Codex only
chat-history -L                            # current workspace only
chat-history --branch feature-xyz          # filter by branch
chat-history -k "auth" -v                  # keyword filter, show IDs

# Search (always use --deep --json for best results from agents)
chat-history search "auth error" --deep --json   # full transcript search, structured output
chat-history search "fix" --scope errors --deep  # error patterns only
chat-history search "trade" --scope similar      # similar past queries
chat-history search                   # direct UUID lookup

# Inspect (session summary)
chat-history inspect --last                # accomplishments, tools, model, tokens
chat-history inspect 

# View / Export / Resume / Find
chat-history view --last --plain           # pipe-friendly plain text
chat-history view  --tools             # show tool call names
chat-history export  -o session.md     # export as markdown
chat-history resume                    # resume Claude Code or Codex session
chat-history find                      # print file path for scripting
```

The short alias `ch` works identically: `ch search "auth"`, `ch inspect --last`, etc.

## Search behavior

- Always use `--deep --json` when calling from an agent for thorough results and structured output.
- **Deep search** (`--deep`): Searches full transcript content across all messages in parallel.
  - Snippets show context **around the match**, not the first N characters of the message.
- **JSON output** (`--json`): Returns structured JSON with `session_id`, `score`, `snippet`, `tools`, `files`.

## Interpreting output

- `CC` = Claude Code session, `CR` = Cursor session
- Score (`★ N.N`) = relevance score (higher = better match)
- `[summary]`, `[first_prompt]`, `[branch]` = which field matched in index search
- `inspect` shows: duration, message count, model name, token count, tools used, files touched, accomplishments, key decisions

## Date formats accepted

`YYYY-MM-DD`, `today`, `yesterday`, `"3 days ago"`, `"last week"`, `"last month"`

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ay-bh](https://github.com/ay-bh)
- **Source:** [ay-bh/chat-history](https://github.com/ay-bh/chat-history)
- **License:** MIT
- **Homepage:** https://crates.io/crates/chat-history

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ay-bh-chat-history-chat-history
- Seller: https://agentstack.voostack.com/s/ay-bh
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
