cc-query 0.4.0 → 0.4.2

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.
Files changed (3) hide show
  1. package/README.md +48 -16
  2. package/bin/cc-query +6 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -4,6 +4,24 @@ SQL REPL for querying Claude Code session data using DuckDB.
4
4
 
5
5
  ## Installation
6
6
 
7
+ ### As a Claude Code Plugin
8
+
9
+ 1. Add the marketplace:
10
+ ```
11
+ /plugin marketplace add dannycoates/cc-query
12
+ ```
13
+
14
+ 2. Install the plugin:
15
+ ```
16
+ /plugin install cc-query@dannycoates-cc-query
17
+ ```
18
+
19
+ The plugin automatically runs `npm install` on first session start.
20
+
21
+ ### Manual Installation
22
+
23
+ For use outside of Claude Code
24
+
7
25
  ```bash
8
26
  npm install -g cc-query
9
27
  ```
@@ -31,7 +49,12 @@ echo "SELECT count(*) FROM messages;" | cc-query .
31
49
  - `messages` - All messages with parsed fields
32
50
  - `user_messages` - User messages only
33
51
  - `assistant_messages` - Assistant responses only
34
- - `tool_calls` - Tool invocations from assistant messages
52
+ - `human_messages` - Human-typed messages (no tool results)
53
+ - `tool_uses` - Tool invocations from assistant messages
54
+ - `tool_results` - Tool results with duration and error status
55
+ - `token_usage` - Token consumption per message
56
+ - `bash_commands` - Bash command details
57
+ - `file_operations` - File read/write/edit operations
35
58
  - `raw_messages` - Unparsed JSONL data
36
59
 
37
60
  ## REPL Commands
@@ -40,27 +63,36 @@ echo "SELECT count(*) FROM messages;" | cc-query .
40
63
  - `.schema` - Show table schema
41
64
  - `.quit` - Exit
42
65
 
43
- ## Skill (experimental)
66
+ ## Skills
44
67
 
45
- This [example skill](examples/skills/reflect/SKILL.md) gives claude the ability and slash command `/reflect` to work with claude session history.
68
+ The plugin includes two skills for session analysis:
46
69
 
47
- Why not a plugin? If you copy the skill you can reflect on it to adapt to your own usage.
70
+ ### `/reflect`
48
71
 
49
- For example you can ask questions like:
50
- - Across all projects what bash commands return the most errors?
51
- - Let's analyze the last session and identify how we might improve the claude.md file
52
- - Gimme a summary of what we worked on this past week
53
- - Let's go though our whole session history and identify repeated patterns that we could extract into skills
54
- - Let's look at our use of cc-query tool calls to see how we might improve the reflect skill
72
+ Query and analyze Claude Code session history. Use for:
73
+ - Token usage analysis
74
+ - Tool patterns across projects
75
+ - Finding user corrections/preferences
76
+ - Weekly summaries
77
+
78
+ See [skills/reflect/SKILL.md](skills/reflect/SKILL.md) for query reference.
79
+
80
+ ### `/handoff`
55
81
 
56
- ### Test drive
82
+ Create detailed handoff documents for work continuation. Produces:
83
+ - Task status and progress
84
+ - Files modified with change summaries
85
+ - Key conversation flow
86
+ - Actionable next steps
57
87
 
58
- To test drive this skill do something like this:
88
+ See [skills/handoff/SKILL.md](skills/handoff/SKILL.md) for output format.
59
89
 
60
- 1. `npm i -g cc-query`
61
- 2. Clone this repo or otherwise fetch the `examples/skills/reflect` dir
62
- 3. `mkdir -p ~/.claude/skills && cp -R examples/skills/reflect ~/.claude/skills/`
63
- 4. run claude and use `/reflect [whatever you want]`
90
+ ### Example Questions
91
+
92
+ - Across all projects what bash commands return the most errors?
93
+ - Let's analyze the last session and identify how we might improve the CLAUDE.md file
94
+ - Give me a summary of what we worked on this past week
95
+ - Create a handoff document for this session
64
96
 
65
97
  ## License
66
98
 
package/bin/cc-query ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ # Wrapper script for cc-query
3
+ # Usage: cc-query [options] [project-path]
4
+
5
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ exec node "${SCRIPT_DIR}/cc-query.js" "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-query",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "SQL REPL for querying Claude Code session data",
5
5
  "type": "module",
6
6
  "exports": {