claude-session-explorer 0.1.0 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -0
- package/dist/cli.js +836 -417
- package/package.json +5 -1
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# claude-session-explorer
|
|
2
|
+
|
|
3
|
+
Fast, structured access to your Claude Code session history. Search conversations, track token usage, extract file operations, and export sessions — all from the terminal.
|
|
4
|
+
|
|
5
|
+
Reads directly from `~/.claude/` with zero setup. JSON output by default, pipe-friendly.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i -g claude-session-explorer
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
[](https://www.npmjs.com/package/claude-session-explorer)
|
|
14
|
+
|
|
15
|
+
### From source
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm install
|
|
19
|
+
pnpm build
|
|
20
|
+
pnpm link --global
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
cse list # all sessions, most recent first
|
|
27
|
+
cse list --today --pretty # today's sessions as a table
|
|
28
|
+
cse list --project /path/to/dir # filter by project
|
|
29
|
+
cse show <session-id> # session metadata
|
|
30
|
+
cse show <session-id> --raw # raw JSONL lines
|
|
31
|
+
cse search "authentication" # search user messages
|
|
32
|
+
cse search "auth" --all --regex # search everything with regex
|
|
33
|
+
cse stats # aggregate statistics
|
|
34
|
+
cse projects --pretty # list all projects
|
|
35
|
+
cse history --search "deploy" # search prompt history
|
|
36
|
+
cse files <session-id> # file operations (read/write/edit)
|
|
37
|
+
cse messages <session-id> --user # extract user messages
|
|
38
|
+
cse tokens <session-id> # per-turn token usage
|
|
39
|
+
cse export <session-id> --format md # export as markdown
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Commands
|
|
43
|
+
|
|
44
|
+
| Command | Description |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `list` | List sessions with filters (project, date, kind, entrypoint) |
|
|
47
|
+
| `show` | Show session detail, messages, tools, files, tokens |
|
|
48
|
+
| `search` | Full-text search across sessions (substring or regex) |
|
|
49
|
+
| `stats` | Aggregate statistics (counts, breakdowns by project/hour) |
|
|
50
|
+
| `projects` | List all projects with session counts |
|
|
51
|
+
| `history` | Prompt history from history.jsonl |
|
|
52
|
+
| `files` | Extract file operations from a session |
|
|
53
|
+
| `messages` | Extract messages with filters (user/assistant, slice, first/last) |
|
|
54
|
+
| `tokens` | Per-turn token usage breakdown |
|
|
55
|
+
| `export` | Export session data to JSON or Markdown |
|
|
56
|
+
|
|
57
|
+
## Global Flags
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
--claude-dir <path> Override ~/.claude location
|
|
61
|
+
--json JSON output (default)
|
|
62
|
+
--pretty Human-readable table output
|
|
63
|
+
--verbose Debug info to stderr
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Development
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
pnpm dev -- list --pretty --today # run without building
|
|
70
|
+
pnpm check # biome lint + typecheck
|
|
71
|
+
pnpm lint:fix # auto-fix lint/format issues
|
|
72
|
+
pnpm build # build to dist/
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Design
|
|
76
|
+
|
|
77
|
+
- **JSON-first** — `--json` default, `--pretty` for humans
|
|
78
|
+
- **Composable** — each command does one thing, pipe the rest
|
|
79
|
+
- **Fast** — stream-parses JSONL, no database needed
|
|
80
|
+
- **Read-only** — never modifies session data
|