Search across Claude Code session history
Project description
search-claude-history
Search across all your Claude Code session history for keywords or patterns.
$ sch "git-log-list"
── 2026-02-17 05:35 | -code-rb | session:720d82ef ──
[assistant] There it is — 114 commits, numbered and dated. Usage: `./scripts/git-log-list.sh`...
── 2026-02-23 20:15 | -code-scripts | session:379bb145 ──
[user] do you remember the motivation behind git-log-list.sh? search our session history
2 match(es)
Works out of the box, but fastest with ripgrep installed.
Install
# Run directly (no install needed)
uvx search-claude-history "pattern"
# Or install globally
uv tool install search-claude-history
# With hyperscan for faster searches (matches ripgrep speed)
uv tool install "search-claude-history[hyperscan]"
Requires uv. No system Python needed.
Usage
sch <pattern> [options]
| Flag | Description |
|---|---|
-p, --project |
Filter to a project (substring match on dir name) |
-t, --type |
Filter by role: user or assistant |
-A N |
Show N messages after each match |
-B N |
Show N messages before each match |
-C, --context |
Chars of text context around match (default 200) |
--tools |
Include tool_use/tool_result messages (hidden by default) |
--no-color |
Disable colored output |
Examples
sch "database migration" # search everything
sch "TypeError" --type assistant # only assistant messages
sch "deployment" -p myproject # filter to a project
sch "refactor" -B 1 -A 1 # show surrounding messages
sch "SELECT.*FROM" --tools # search tool calls too
Performance
Searches ~/.claude/projects/ using the fastest available engine:
| Engine | 0.45 GB | Requires |
|---|---|---|
| ripgrep | 0.13s | rg on PATH |
| hyperscan | 0.15s | install with [hyperscan] extra |
| stdlib (mmap + multiprocessing) | 0.64s | nothing |
The tool uses whichever engine is available, in the order above.
Respects CLAUDE_CONFIG_DIR if set, otherwise defaults to ~/.claude/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file search_claude_history-0.1.0.tar.gz.
File metadata
- Download URL: search_claude_history-0.1.0.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3d527bb44a2e67b592e09827911647744f5b9542ee8ca4df7b81a2b6cbb6cd3
|
|
| MD5 |
05f80e6d088a8ef9f2713d838dc129db
|
|
| BLAKE2b-256 |
ef18966496e923e82ae2d0901b0fe7cb16d0bee35ecac1355ad17d39a9a2cbc7
|
Provenance
The following attestation bundles were made for search_claude_history-0.1.0.tar.gz:
Publisher:
publish.yml on wakamex/search-claude-history
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
search_claude_history-0.1.0.tar.gz -
Subject digest:
a3d527bb44a2e67b592e09827911647744f5b9542ee8ca4df7b81a2b6cbb6cd3 - Sigstore transparency entry: 984008270
- Sigstore integration time:
-
Permalink:
wakamex/search-claude-history@a0a41d6742a9cb455cd90523de75d1fd12636401 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/wakamex
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0a41d6742a9cb455cd90523de75d1fd12636401 -
Trigger Event:
release
-
Statement type:
File details
Details for the file search_claude_history-0.1.0-py3-none-any.whl.
File metadata
- Download URL: search_claude_history-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aa9156b3f9fd46331a13b4d043d9f3ea26cb3cb6910dc5da28ff7abd3350b10
|
|
| MD5 |
ff669391325f0416e4dd30a48edb4b8c
|
|
| BLAKE2b-256 |
197a69a15286489a87e22ee63a46dd1ddccabd14cea99002df577ad692ec4f22
|
Provenance
The following attestation bundles were made for search_claude_history-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on wakamex/search-claude-history
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
search_claude_history-0.1.0-py3-none-any.whl -
Subject digest:
9aa9156b3f9fd46331a13b4d043d9f3ea26cb3cb6910dc5da28ff7abd3350b10 - Sigstore transparency entry: 984008280
- Sigstore integration time:
-
Permalink:
wakamex/search-claude-history@a0a41d6742a9cb455cd90523de75d1fd12636401 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/wakamex
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0a41d6742a9cb455cd90523de75d1fd12636401 -
Trigger Event:
release
-
Statement type: