@asifkibria/claude-code-toolkit 1.0.7 → 1.2.0
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 +152 -468
- package/dist/CLAUDE.md +7 -0
- package/dist/__tests__/dashboard.test.d.ts +2 -0
- package/dist/__tests__/dashboard.test.d.ts.map +1 -0
- package/dist/__tests__/dashboard.test.js +606 -0
- package/dist/__tests__/dashboard.test.js.map +1 -0
- package/dist/__tests__/mcp-validator.test.d.ts +2 -0
- package/dist/__tests__/mcp-validator.test.d.ts.map +1 -0
- package/dist/__tests__/mcp-validator.test.js +217 -0
- package/dist/__tests__/mcp-validator.test.js.map +1 -0
- package/dist/__tests__/security.test.d.ts +2 -0
- package/dist/__tests__/security.test.d.ts.map +1 -0
- package/dist/__tests__/security.test.js +375 -0
- package/dist/__tests__/security.test.js.map +1 -0
- package/dist/__tests__/session-recovery.test.d.ts +2 -0
- package/dist/__tests__/session-recovery.test.d.ts.map +1 -0
- package/dist/__tests__/session-recovery.test.js +230 -0
- package/dist/__tests__/session-recovery.test.js.map +1 -0
- package/dist/__tests__/storage.test.d.ts +2 -0
- package/dist/__tests__/storage.test.d.ts.map +1 -0
- package/dist/__tests__/storage.test.js +241 -0
- package/dist/__tests__/storage.test.js.map +1 -0
- package/dist/__tests__/trace.test.d.ts +2 -0
- package/dist/__tests__/trace.test.d.ts.map +1 -0
- package/dist/__tests__/trace.test.js +376 -0
- package/dist/__tests__/trace.test.js.map +1 -0
- package/dist/cli.js +322 -30
- package/dist/cli.js.map +1 -1
- package/dist/index.js +554 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/dashboard-ui.d.ts +2 -0
- package/dist/lib/dashboard-ui.d.ts.map +1 -0
- package/dist/lib/dashboard-ui.js +2075 -0
- package/dist/lib/dashboard-ui.js.map +1 -0
- package/dist/lib/dashboard.d.ts +15 -0
- package/dist/lib/dashboard.d.ts.map +1 -0
- package/dist/lib/dashboard.js +1422 -0
- package/dist/lib/dashboard.js.map +1 -0
- package/dist/lib/logs.d.ts +42 -0
- package/dist/lib/logs.d.ts.map +1 -0
- package/dist/lib/logs.js +166 -0
- package/dist/lib/logs.js.map +1 -0
- package/dist/lib/mcp-validator.d.ts +86 -0
- package/dist/lib/mcp-validator.d.ts.map +1 -0
- package/dist/lib/mcp-validator.js +463 -0
- package/dist/lib/mcp-validator.js.map +1 -0
- package/dist/lib/scanner.d.ts +6 -2
- package/dist/lib/scanner.d.ts.map +1 -1
- package/dist/lib/scanner.js +17 -14
- package/dist/lib/scanner.js.map +1 -1
- package/dist/lib/security.d.ts +57 -0
- package/dist/lib/security.d.ts.map +1 -0
- package/dist/lib/security.js +423 -0
- package/dist/lib/security.js.map +1 -0
- package/dist/lib/session-recovery.d.ts +60 -0
- package/dist/lib/session-recovery.d.ts.map +1 -0
- package/dist/lib/session-recovery.js +433 -0
- package/dist/lib/session-recovery.js.map +1 -0
- package/dist/lib/storage.d.ts +68 -0
- package/dist/lib/storage.d.ts.map +1 -0
- package/dist/lib/storage.js +500 -0
- package/dist/lib/storage.js.map +1 -0
- package/dist/lib/trace.d.ts +119 -0
- package/dist/lib/trace.d.ts.map +1 -0
- package/dist/lib/trace.js +649 -0
- package/dist/lib/trace.js.map +1 -0
- package/package.json +11 -3
package/README.md
CHANGED
|
@@ -2,588 +2,272 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@asifkibria/claude-code-toolkit)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://github.com/asifkibria/claude-code-toolkit)
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
Maintain, optimize, secure, and troubleshoot your Claude Code installation. Fix broken sessions, manage storage, detect secrets, and monitor everything through a web dashboard.
|
|
8
7
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
When you upload an oversized image, PDF, or document to Claude Code, it gets base64-encoded into your conversation history. That corrupted data then gets sent with **every future request**, causing API errors like:
|
|
12
|
-
|
|
13
|
-
- `API Error: 400 - image dimensions exceed max allowed size`
|
|
14
|
-
- `PDF too large. Try reading the file a different way...`
|
|
15
|
-
- Various timeout and context errors
|
|
16
|
-
|
|
17
|
-
**The worst part?** Nothing works anymore. Not your next message. Not `/compact`. Your entire conversation is bricked.
|
|
18
|
-
|
|
19
|
-
The "official" fix is to clear your conversation and lose everything. This toolkit offers a better solution.
|
|
20
|
-
|
|
21
|
-
## What It Fixes
|
|
22
|
-
|
|
23
|
-
| Content Type | Detection Threshold | Replacement Message |
|
|
24
|
-
|-------------|---------------------|---------------------|
|
|
25
|
-
| Images | >100KB base64 | `[Image removed - exceeded size limit]` |
|
|
26
|
-
| PDFs | >100KB base64 | `[PDF removed - exceeded size limit]` |
|
|
27
|
-
| Documents | >100KB base64 | `[Document removed - exceeded size limit]` |
|
|
28
|
-
| Large Text | >500KB | `[Large text content removed - exceeded size limit]` |
|
|
29
|
-
|
|
30
|
-
The toolkit surgically removes only the problematic content while preserving your entire conversation history, tool results, and context.
|
|
31
|
-
|
|
32
|
-
## Quick Start
|
|
33
|
-
|
|
34
|
-
### Fix Your Broken Session Right Now
|
|
8
|
+
## Quick Fix
|
|
35
9
|
|
|
36
10
|
```bash
|
|
37
|
-
#
|
|
38
|
-
npx @asifkibria/claude-code-toolkit scan
|
|
39
|
-
|
|
40
|
-
# Fix them (creates backups automatically)
|
|
11
|
+
# Your session is broken? Fix it in 10 seconds
|
|
41
12
|
npx @asifkibria/claude-code-toolkit fix
|
|
42
|
-
```
|
|
43
13
|
|
|
44
|
-
Restart Claude Code
|
|
14
|
+
# Restart Claude Code - you're back
|
|
15
|
+
```
|
|
45
16
|
|
|
46
|
-
|
|
17
|
+
## Installation
|
|
47
18
|
|
|
48
19
|
```bash
|
|
20
|
+
# Global install (recommended)
|
|
49
21
|
npm install -g @asifkibria/claude-code-toolkit
|
|
50
22
|
|
|
51
|
-
# Use the short alias
|
|
23
|
+
# Use the short alias everywhere
|
|
52
24
|
cct health
|
|
53
|
-
cct
|
|
54
|
-
cct fix
|
|
25
|
+
cct dashboard
|
|
55
26
|
```
|
|
56
27
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
### Option 1: MCP Server (Let Claude Maintain Itself)
|
|
28
|
+
### Add as MCP Server
|
|
60
29
|
|
|
61
|
-
|
|
30
|
+
Let Claude maintain itself:
|
|
62
31
|
|
|
63
32
|
```bash
|
|
64
33
|
claude mcp add --scope user toolkit -- npx -y @asifkibria/claude-code-toolkit claude-code-toolkit-server
|
|
65
34
|
```
|
|
66
35
|
|
|
67
|
-
Then
|
|
68
|
-
- "Check your health"
|
|
69
|
-
- "Are there any issues with your conversation files?"
|
|
70
|
-
- "Fix any problems you find"
|
|
36
|
+
Then ask Claude: "Check your health" or "Fix any issues"
|
|
71
37
|
|
|
72
|
-
|
|
38
|
+
---
|
|
73
39
|
|
|
74
|
-
|
|
75
|
-
# Global install
|
|
76
|
-
npm install -g @asifkibria/claude-code-toolkit
|
|
40
|
+
## Core Features
|
|
77
41
|
|
|
78
|
-
|
|
79
|
-
npx @asifkibria/claude-code-toolkit <command>
|
|
80
|
-
```
|
|
42
|
+
### 1. Fix Broken Sessions
|
|
81
43
|
|
|
82
|
-
|
|
44
|
+
When you upload an oversized image/PDF, your entire conversation breaks. This fixes it.
|
|
83
45
|
|
|
84
46
|
```bash
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
npm install && npm run build && npm test
|
|
47
|
+
cct scan # See what's wrong
|
|
48
|
+
cct fix # Fix it (creates backup automatically)
|
|
88
49
|
```
|
|
89
50
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
### `cct health` - Quick Health Check
|
|
51
|
+
### 2. Web Dashboard
|
|
93
52
|
|
|
94
|
-
|
|
53
|
+
Visual management of your entire Claude Code installation.
|
|
95
54
|
|
|
96
55
|
```bash
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
Health Check: ⚠ Issues Found
|
|
100
|
-
|
|
101
|
-
Conversations: 23
|
|
102
|
-
Total size: 156.2 MB
|
|
103
|
-
Backups: 5
|
|
104
|
-
Oversized content: 3
|
|
105
|
-
|
|
106
|
-
Largest: -Users-me-projects-myapp/abc123.jsonl
|
|
107
|
-
Size: 45.2 MB
|
|
108
|
-
|
|
109
|
-
Recommendation: Run 'cct fix' to fix 3 issue(s)
|
|
56
|
+
cct dashboard
|
|
110
57
|
```
|
|
111
58
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
Shows exactly what's wrong without making changes.
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
$ cct scan
|
|
59
|
+
14 tabs: Overview, Storage, Sessions, Security, Traces, MCP, Logs, Config, Snapshots, Analytics, Backups, Context, Maintenance, About
|
|
118
60
|
|
|
119
|
-
|
|
61
|
+
### 3. Security Scanning
|
|
120
62
|
|
|
121
|
-
|
|
122
|
-
Line 142: 🖼️ image (~2.3 MB)
|
|
123
|
-
Line 856: 📄 pdf (~1.1 MB)
|
|
124
|
-
|
|
125
|
-
-Users-me-projects-another/conversation2.jsonl
|
|
126
|
-
Line 45: 📎 document (~890 KB)
|
|
127
|
-
|
|
128
|
-
Found 3 issue(s) in 2 file(s).
|
|
129
|
-
Run 'cct fix' to fix them.
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### `cct fix` - Fix All Issues
|
|
133
|
-
|
|
134
|
-
Removes problematic content and creates backups.
|
|
63
|
+
Find leaked secrets in your conversations.
|
|
135
64
|
|
|
136
65
|
```bash
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Processing 23 file(s)...
|
|
140
|
-
|
|
141
|
-
✓ -Users-me-projects-myapp/conversation1.jsonl
|
|
142
|
-
Fixed 2 issue(s)
|
|
143
|
-
Backup: conversation1.jsonl.backup.2024-01-15T10-30-00
|
|
144
|
-
|
|
145
|
-
✓ -Users-me-projects-another/conversation2.jsonl
|
|
146
|
-
Fixed 1 issue(s)
|
|
147
|
-
Backup: conversation2.jsonl.backup.2024-01-15T10-30-01
|
|
148
|
-
|
|
149
|
-
✓ Fixed 3 issue(s) in 2 file(s).
|
|
150
|
-
Restart Claude Code to apply changes.
|
|
66
|
+
cct security-scan # Scan all conversations
|
|
67
|
+
cct audit abc123 # Full audit trail of session
|
|
151
68
|
```
|
|
152
69
|
|
|
153
|
-
###
|
|
154
|
-
|
|
155
|
-
See what's using space and resources.
|
|
70
|
+
### 4. Storage Management
|
|
156
71
|
|
|
157
72
|
```bash
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
Total: 23 conversations, 156.2 MB
|
|
163
|
-
Messages: 12,456, Images: 89, Documents: 23
|
|
164
|
-
Problematic content: 3
|
|
165
|
-
|
|
166
|
-
Top 5 by size:
|
|
167
|
-
|
|
168
|
-
-Users-me-projects-myapp/abc123.jsonl
|
|
169
|
-
Size: 45.2 MB, Messages: 2,341
|
|
170
|
-
Images: 34, Documents: 12 (2 oversized)
|
|
171
|
-
Modified: 2024-01-15 10:30:00
|
|
172
|
-
...
|
|
73
|
+
cct clean # Remove debug logs, old snapshots
|
|
74
|
+
cct archive --days 60 # Archive old conversations
|
|
75
|
+
cct trace clean # Selective trace cleanup
|
|
173
76
|
```
|
|
174
77
|
|
|
175
|
-
|
|
78
|
+
---
|
|
176
79
|
|
|
177
|
-
|
|
80
|
+
## Common Problems & Solutions
|
|
178
81
|
|
|
179
|
-
###
|
|
82
|
+
### 🚨 Out of Memory / API Error
|
|
180
83
|
|
|
181
|
-
|
|
84
|
+
Uploaded a large image or PDF and now Claude won't respond? The conversation file is too big for the API.
|
|
182
85
|
|
|
183
86
|
```bash
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
║ USAGE ANALYTICS DASHBOARD ║
|
|
188
|
-
╚══════════════════════════════════════════════════════════════╝
|
|
189
|
-
|
|
190
|
-
📊 OVERVIEW
|
|
191
|
-
──────────────────────────────────────────────────
|
|
192
|
-
Conversations: 23
|
|
193
|
-
Total Messages: 12,456
|
|
194
|
-
Total Tokens: ~2,345,678
|
|
195
|
-
Total Size: 156.2 MB
|
|
196
|
-
Active Projects: 8
|
|
197
|
-
Avg Msgs/Conv: 542
|
|
198
|
-
Avg Tokens/Conv: ~102,000
|
|
199
|
-
|
|
200
|
-
📈 ACTIVITY (Last 7 days)
|
|
201
|
-
──────────────────────────────────────────────────
|
|
202
|
-
Mon │█████████████████████████│ 234
|
|
203
|
-
Tue │████████████████░░░░░░░░░│ 156
|
|
204
|
-
Wed │██████████████████░░░░░░░│ 178
|
|
205
|
-
...
|
|
206
|
-
|
|
207
|
-
🏆 TOP PROJECTS (by messages)
|
|
208
|
-
──────────────────────────────────────────────────
|
|
209
|
-
-Users-me-myapp │███████████████│ 2,341
|
|
210
|
-
-Users-me-another-proj │████████░░░░░░░│ 1,234
|
|
211
|
-
...
|
|
212
|
-
|
|
213
|
-
🔧 TOP TOOLS
|
|
214
|
-
──────────────────────────────────────────────────
|
|
215
|
-
Read 1,234 (25%)
|
|
216
|
-
Edit 987 (20%)
|
|
217
|
-
Bash 654 (13%)
|
|
218
|
-
...
|
|
87
|
+
cct scan # Identify oversized content
|
|
88
|
+
cct fix # Remove problematic content (creates backup)
|
|
89
|
+
# Restart Claude Code - you're back
|
|
219
90
|
```
|
|
220
91
|
|
|
221
|
-
###
|
|
92
|
+
### 🔐 Leaked Secrets
|
|
222
93
|
|
|
223
|
-
|
|
94
|
+
Accidentally pasted API keys, passwords, or tokens in chat? Find and audit them before they're exposed.
|
|
224
95
|
|
|
225
96
|
```bash
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
╔══════════════════════════════════════════════════════════════╗
|
|
229
|
-
║ DUPLICATE DETECTION REPORT ║
|
|
230
|
-
╚══════════════════════════════════════════════════════════════╝
|
|
231
|
-
|
|
232
|
-
📊 SUMMARY
|
|
233
|
-
──────────────────────────────────────────────────
|
|
234
|
-
Duplicate groups: 5
|
|
235
|
-
Duplicate images: 12
|
|
236
|
-
Duplicate documents: 3
|
|
237
|
-
Wasted space: 45.2 MB
|
|
238
|
-
|
|
239
|
-
📁 DUPLICATE CONVERSATIONS
|
|
240
|
-
──────────────────────────────────────────────────
|
|
241
|
-
[2 copies] Wasted: 12.5 MB
|
|
242
|
-
- -Users-me-myapp/conversation1.jsonl
|
|
243
|
-
- -Users-me-myapp-backup/conversation1.jsonl
|
|
244
|
-
|
|
245
|
-
🖼️ DUPLICATE CONTENT
|
|
246
|
-
──────────────────────────────────────────────────
|
|
247
|
-
🖼️ image [3 copies] ~2.1 MB wasted
|
|
248
|
-
- -Users-me-proj1/conv.jsonl:142
|
|
249
|
-
- -Users-me-proj1/conv.jsonl:856
|
|
250
|
-
... and 1 more locations
|
|
251
|
-
|
|
252
|
-
💡 RECOMMENDATIONS
|
|
253
|
-
──────────────────────────────────────────────────
|
|
254
|
-
- Review duplicate conversations and consider removing copies
|
|
255
|
-
- Same images appear multiple times in your conversations
|
|
97
|
+
cct security-scan # Scan for AWS keys, tokens, passwords
|
|
98
|
+
cct audit abc123 # Full audit trail of what was accessed
|
|
256
99
|
```
|
|
257
100
|
|
|
258
|
-
###
|
|
101
|
+
### 🛑 Broken Sessions
|
|
259
102
|
|
|
260
|
-
|
|
103
|
+
Claude crashed mid-conversation and `--resume` doesn't work? Recover and repair corrupted session files.
|
|
261
104
|
|
|
262
105
|
```bash
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
╚══════════════════════════════════════════════════════════════╝
|
|
268
|
-
|
|
269
|
-
📊 SUMMARY
|
|
270
|
-
──────────────────────────────────────────────────
|
|
271
|
-
Eligible conversations: 8
|
|
272
|
-
Total size: 45.2 MB
|
|
273
|
-
|
|
274
|
-
📁 ARCHIVE CANDIDATES
|
|
275
|
-
──────────────────────────────────────────────────
|
|
276
|
-
...-Users-me-old-project/abc123.jsonl
|
|
277
|
-
65 days inactive, 234 msgs, 12.5 MB
|
|
278
|
-
...-Users-me-another-old/def456.jsonl
|
|
279
|
-
45 days inactive, 156 msgs, 8.2 MB
|
|
280
|
-
...
|
|
281
|
-
|
|
282
|
-
📋 DRY RUN - No changes made
|
|
283
|
-
──────────────────────────────────────────────────
|
|
284
|
-
Would archive: 8 conversations
|
|
285
|
-
Would free: 45.2 MB
|
|
286
|
-
Archive to: ~/.claude/archive
|
|
106
|
+
cct sessions # List all sessions with health status
|
|
107
|
+
cct recover abc123 # Diagnose the session
|
|
108
|
+
cct recover abc123 --repair # Fix corrupted lines
|
|
109
|
+
cct recover abc123 --extract # Extract salvageable content
|
|
287
110
|
```
|
|
288
111
|
|
|
289
|
-
###
|
|
112
|
+
### 💾 Disk Space
|
|
290
113
|
|
|
291
|
-
|
|
114
|
+
Months of conversation history eating up GBs? Clean old traces and archive inactive sessions.
|
|
292
115
|
|
|
293
116
|
```bash
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
╚══════════════════════════════════════════════════════════════╝
|
|
299
|
-
|
|
300
|
-
📊 STATUS
|
|
301
|
-
──────────────────────────────────────────────────
|
|
302
|
-
⚠ Needs Attention
|
|
303
|
-
|
|
304
|
-
📋 PENDING ACTIONS (dry run)
|
|
305
|
-
──────────────────────────────────────────────────
|
|
306
|
-
🔧 Oversized content detected
|
|
307
|
-
3 item(s) (~2.3 MB)
|
|
308
|
-
🗑️ Backups older than 7 days
|
|
309
|
-
5 item(s) (~89.3 MB)
|
|
310
|
-
📦 Conversations inactive for 60+ days
|
|
311
|
-
8 item(s) (~45.2 MB)
|
|
312
|
-
|
|
313
|
-
💡 RECOMMENDATIONS
|
|
314
|
-
──────────────────────────────────────────────────
|
|
315
|
-
- Run 'cct fix' to remove oversized content
|
|
316
|
-
- Run 'cct cleanup --days 7' to remove old backups
|
|
317
|
-
- Run 'cct archive --days 60' to archive inactive conversations
|
|
318
|
-
|
|
319
|
-
# Show scheduled maintenance setup
|
|
320
|
-
$ cct maintenance --schedule
|
|
321
|
-
|
|
322
|
-
# Run maintenance automatically
|
|
323
|
-
$ cct maintenance --auto
|
|
117
|
+
cct stats # See what's using space
|
|
118
|
+
cct clean --dry-run # Preview cleanup
|
|
119
|
+
cct clean # Remove debug logs, old snapshots
|
|
120
|
+
cct archive --days 30 # Archive old conversations
|
|
324
121
|
```
|
|
325
122
|
|
|
326
|
-
|
|
327
|
-
# Summary of all conversations by context size
|
|
328
|
-
$ cct context
|
|
329
|
-
|
|
330
|
-
Context Usage Summary
|
|
123
|
+
### 👁 Privacy / Trace Cleanup
|
|
331
124
|
|
|
332
|
-
|
|
333
|
-
Combined tokens: ~1,234,567
|
|
334
|
-
|
|
335
|
-
Top 10 by context size:
|
|
336
|
-
|
|
337
|
-
-Users-me-projects-myapp/abc123.jsonl
|
|
338
|
-
~125,000 tokens (456 messages)
|
|
339
|
-
⚠ Context exceeds 100K tokens - consider archiving older messages
|
|
340
|
-
|
|
341
|
-
-Users-me-projects-another/def456.jsonl
|
|
342
|
-
~45,000 tokens (234 messages)
|
|
343
|
-
...
|
|
344
|
-
|
|
345
|
-
# Detailed breakdown for a specific file
|
|
346
|
-
$ cct context -f ~/.claude/projects/-Users-me-myapp/conversation.jsonl
|
|
347
|
-
|
|
348
|
-
Context Size Estimate
|
|
349
|
-
────────────────────────────────────────
|
|
350
|
-
Total: ~125,000 tokens
|
|
351
|
-
Messages: 456
|
|
352
|
-
|
|
353
|
-
Breakdown:
|
|
354
|
-
User messages: 12,500 tokens
|
|
355
|
-
Assistant messages: 85,000 tokens
|
|
356
|
-
Tool calls: 5,000 tokens
|
|
357
|
-
Tool results: 20,000 tokens
|
|
358
|
-
Images: 2,500 tokens
|
|
359
|
-
|
|
360
|
-
Largest message: Line 342 (assistant)
|
|
361
|
-
~8,500 tokens
|
|
362
|
-
|
|
363
|
-
Warnings:
|
|
364
|
-
⚠ Context exceeds 100K tokens - consider archiving older messages
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
### `cct backups` - List Backups
|
|
368
|
-
|
|
369
|
-
See all backup files.
|
|
125
|
+
Corporate security requires clearing Claude traces? Full inventory of 18 trace categories with secure wipe.
|
|
370
126
|
|
|
371
127
|
```bash
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
conversation1.jsonl.backup.2024-01-15T10-30-00
|
|
377
|
-
Size: 23.4 MB, Created: 2024-01-15 10:30:00
|
|
378
|
-
...
|
|
128
|
+
cct trace # Full inventory of stored data
|
|
129
|
+
cct trace clean --days 7 # Remove traces older than 7 days
|
|
130
|
+
cct trace wipe --confirm # Secure wipe everything
|
|
131
|
+
cct trace guard --mode paranoid # Auto-delete going forward
|
|
379
132
|
```
|
|
380
133
|
|
|
381
|
-
###
|
|
134
|
+
### 📦 Backup & Restore
|
|
382
135
|
|
|
383
|
-
|
|
136
|
+
Need to undo a fix or restore a conversation? Automatic backups before every change.
|
|
384
137
|
|
|
385
138
|
```bash
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
Restart Claude Code to apply changes.
|
|
139
|
+
cct backups # List available backups
|
|
140
|
+
cct restore /path/to/backup # Restore original
|
|
141
|
+
cct cleanup --days 30 # Delete old backups
|
|
390
142
|
```
|
|
391
143
|
|
|
392
|
-
###
|
|
144
|
+
### 📷 Storage Snapshots
|
|
393
145
|
|
|
394
|
-
|
|
146
|
+
Track how Claude's storage grows over time. Compare snapshots to see what changed.
|
|
395
147
|
|
|
396
148
|
```bash
|
|
397
|
-
#
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
Would delete 3 backup(s):
|
|
401
|
-
conversation1.jsonl.backup.2024-01-01T00-00-00
|
|
402
|
-
conversation2.jsonl.backup.2024-01-02T00-00-00
|
|
403
|
-
conversation3.jsonl.backup.2024-01-03T00-00-00
|
|
404
|
-
|
|
405
|
-
Run without --dry-run to delete.
|
|
406
|
-
|
|
407
|
-
# Actually delete them
|
|
408
|
-
$ cct cleanup --days 7
|
|
409
|
-
|
|
410
|
-
✓ Deleted 3 backup(s)
|
|
149
|
+
cct dashboard # Snapshots tab in web UI
|
|
150
|
+
# Or via MCP: snapshot, compare, delete-snapshot actions
|
|
411
151
|
```
|
|
412
152
|
|
|
413
|
-
###
|
|
153
|
+
### 📜 Debug Logs
|
|
414
154
|
|
|
415
|
-
|
|
155
|
+
Something went wrong but you don't know what? Search and filter debug logs by level, component, or text.
|
|
416
156
|
|
|
417
157
|
```bash
|
|
418
|
-
#
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
✓ Exported 156 messages to conversation.md
|
|
422
|
-
|
|
423
|
-
# Export to JSON
|
|
424
|
-
$ cct export -f conversation.jsonl --format json -o backup.json
|
|
425
|
-
|
|
426
|
-
✓ Exported 156 messages to backup.json
|
|
427
|
-
|
|
428
|
-
# Include tool results in export
|
|
429
|
-
$ cct export -f conversation.jsonl --with-tools
|
|
430
|
-
|
|
431
|
-
✓ Exported 156 messages to conversation.md
|
|
158
|
+
cct dashboard # Logs tab with search and filtering
|
|
159
|
+
# Filter by level (DEBUG, INFO, WARN, ERROR)
|
|
160
|
+
# Search by component or message text
|
|
432
161
|
```
|
|
433
162
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
- **Markdown**: Human-readable format with headers, code blocks, and tool summaries
|
|
437
|
-
- **JSON**: Structured format with full message metadata for programmatic use
|
|
438
|
-
|
|
439
|
-
## CLI Options Reference
|
|
440
|
-
|
|
441
|
-
| Option | Description |
|
|
442
|
-
|--------|-------------|
|
|
443
|
-
| `-f, --file <path>` | Target a specific file instead of all conversations |
|
|
444
|
-
| `-o, --output <path>` | For export: output file path |
|
|
445
|
-
| `--format <type>` | For export: `markdown` or `json` (default: markdown) |
|
|
446
|
-
| `--with-tools` | For export: include tool results in output |
|
|
447
|
-
| `-d, --dry-run` | Preview changes without making them |
|
|
448
|
-
| `--no-backup` | Skip creating backups when fixing (not recommended) |
|
|
449
|
-
| `--days <n>` | For cleanup: delete backups older than n days (default: 7) |
|
|
450
|
-
| `--limit <n>` | For stats: limit number of results (default: 10) |
|
|
451
|
-
| `--sort <field>` | For stats: sort by `size`, `messages`, `images`, or `modified` |
|
|
452
|
-
| `-h, --help` | Show help message |
|
|
453
|
-
| `-v, --version` | Show version |
|
|
454
|
-
|
|
455
|
-
## MCP Server Tools
|
|
456
|
-
|
|
457
|
-
When installed as an MCP server, these tools are available to Claude:
|
|
458
|
-
|
|
459
|
-
| Tool | Description |
|
|
460
|
-
|------|-------------|
|
|
461
|
-
| `health_check` | Quick health check with recommendations |
|
|
462
|
-
| `get_conversation_stats` | Detailed statistics about conversations |
|
|
463
|
-
| `estimate_context_size` | Estimate token/context usage of conversations |
|
|
464
|
-
| `usage_analytics` | Usage analytics dashboard with trends and breakdowns |
|
|
465
|
-
| `find_duplicates` | Find duplicate conversations and content |
|
|
466
|
-
| `archive_conversations` | Archive old/inactive conversations |
|
|
467
|
-
| `run_maintenance` | Run maintenance checks and actions |
|
|
468
|
-
| `scan_image_issues` | Scan for oversized content (images, PDFs, documents) |
|
|
469
|
-
| `fix_image_issues` | Fix detected issues with automatic backups |
|
|
470
|
-
| `export_conversation` | Export conversation to markdown or JSON format |
|
|
471
|
-
| `list_backups` | List all backup files |
|
|
472
|
-
| `restore_backup` | Restore a conversation from backup |
|
|
473
|
-
| `cleanup_backups` | Delete old backups to free space |
|
|
474
|
-
|
|
475
|
-
## How It Works
|
|
476
|
-
|
|
477
|
-
1. **Locates** your Claude Code data in `~/.claude/projects/`
|
|
478
|
-
2. **Scans** conversation files (`.jsonl`) line by line
|
|
479
|
-
3. **Detects** oversized content:
|
|
480
|
-
- Images with base64 data >100KB
|
|
481
|
-
- PDFs with base64 data >100KB
|
|
482
|
-
- Documents with base64 data >100KB
|
|
483
|
-
- Text content >500KB
|
|
484
|
-
4. **Reports** findings with file paths, line numbers, and sizes
|
|
485
|
-
5. **Fixes** by replacing problematic content with placeholder text
|
|
486
|
-
6. **Backs up** original files before any modification
|
|
487
|
-
|
|
488
|
-
## Common Scenarios
|
|
489
|
-
|
|
490
|
-
### My Claude Code session is completely broken
|
|
491
|
-
|
|
492
|
-
```bash
|
|
493
|
-
cct scan # See what's wrong
|
|
494
|
-
cct fix # Fix it
|
|
495
|
-
# Restart Claude Code
|
|
496
|
-
```
|
|
497
|
-
|
|
498
|
-
### I want to prevent issues before they happen
|
|
499
|
-
|
|
500
|
-
```bash
|
|
501
|
-
cct health # Quick check
|
|
502
|
-
```
|
|
163
|
+
### 🔌 MCP Servers Not Connecting
|
|
503
164
|
|
|
504
|
-
|
|
165
|
+
MCP servers aren't working? Validate configs and test connectivity.
|
|
505
166
|
|
|
506
167
|
```bash
|
|
507
|
-
cct
|
|
168
|
+
cct mcp-validate # Check all MCP configs
|
|
169
|
+
cct mcp-validate --test # Test actual connectivity
|
|
170
|
+
cct dashboard # MCP tab shows tools/resources per server
|
|
508
171
|
```
|
|
509
172
|
|
|
510
|
-
###
|
|
511
|
-
|
|
512
|
-
```bash
|
|
513
|
-
cct backups # Find your backup
|
|
514
|
-
cct restore /path/to/backup # Restore it
|
|
515
|
-
```
|
|
173
|
+
### 📊 Visual Dashboard
|
|
516
174
|
|
|
517
|
-
|
|
175
|
+
Want a visual overview of everything? 14 tabs for complete management.
|
|
518
176
|
|
|
519
177
|
```bash
|
|
520
|
-
cct
|
|
521
|
-
cct
|
|
178
|
+
cct dashboard # Opens web UI at localhost:1405
|
|
179
|
+
cct dashboard --port 9000 # Custom port
|
|
180
|
+
cct dashboard --daemon # Run in background
|
|
522
181
|
```
|
|
523
182
|
|
|
524
|
-
###
|
|
525
|
-
|
|
526
|
-
```bash
|
|
527
|
-
cct export -f ~/.claude/projects/path/to/conversation.jsonl
|
|
528
|
-
# Creates conversation.md in current directory
|
|
529
|
-
```
|
|
183
|
+
### 📤 Export Conversations
|
|
530
184
|
|
|
531
|
-
|
|
185
|
+
Need to export a conversation for backup or sharing?
|
|
532
186
|
|
|
533
187
|
```bash
|
|
534
|
-
cct
|
|
188
|
+
cct export -f /path/to/conversation.jsonl
|
|
189
|
+
cct export -f conversation.jsonl --format json
|
|
535
190
|
```
|
|
536
191
|
|
|
537
|
-
|
|
192
|
+
---
|
|
538
193
|
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
194
|
+
## All Commands
|
|
195
|
+
|
|
196
|
+
| Command | What it does |
|
|
197
|
+
|---------|--------------|
|
|
198
|
+
| `cct health` | Quick system health check |
|
|
199
|
+
| `cct scan` | Find issues without fixing |
|
|
200
|
+
| `cct fix` | Fix issues (with backup) |
|
|
201
|
+
| `cct dashboard` | Launch web dashboard |
|
|
202
|
+
| `cct stats` | Conversation statistics |
|
|
203
|
+
| `cct context` | Token/context usage |
|
|
204
|
+
| `cct analytics` | Usage trends and patterns |
|
|
205
|
+
| `cct duplicates` | Find duplicate content |
|
|
206
|
+
| `cct clean` | Clean .claude directory |
|
|
207
|
+
| `cct archive` | Archive old conversations |
|
|
208
|
+
| `cct maintenance` | Automated maintenance |
|
|
209
|
+
| `cct sessions` | List all sessions |
|
|
210
|
+
| `cct recover` | Repair crashed sessions |
|
|
211
|
+
| `cct security-scan` | Find leaked secrets |
|
|
212
|
+
| `cct audit` | Session audit trail |
|
|
213
|
+
| `cct retention` | Apply data retention |
|
|
214
|
+
| `cct trace` | Trace inventory |
|
|
215
|
+
| `cct trace clean` | Selective cleanup |
|
|
216
|
+
| `cct trace wipe` | Secure wipe |
|
|
217
|
+
| `cct mcp-validate` | Validate MCP configs |
|
|
218
|
+
| `cct backups` | List backups |
|
|
219
|
+
| `cct restore` | Restore from backup |
|
|
220
|
+
| `cct cleanup` | Delete old backups |
|
|
221
|
+
| `cct export` | Export conversation |
|
|
222
|
+
|
|
223
|
+
## Common Options
|
|
224
|
+
|
|
225
|
+
| Option | Used with | Description |
|
|
226
|
+
|--------|-----------|-------------|
|
|
227
|
+
| `--dry-run` | Most commands | Preview without changes |
|
|
228
|
+
| `--days N` | clean, archive, retention | Age threshold |
|
|
229
|
+
| `-f, --file` | scan, fix, export | Target specific file |
|
|
230
|
+
| `--port N` | dashboard | Custom port (default: 1405) |
|
|
231
|
+
| `--test` | mcp-validate | Test connectivity |
|
|
232
|
+
| `--repair` | recover | Attempt repair |
|
|
233
|
+
| `--extract` | recover | Extract content |
|
|
234
|
+
| `--confirm` | trace wipe | Required for wipe |
|
|
542
235
|
|
|
543
|
-
|
|
236
|
+
---
|
|
544
237
|
|
|
545
|
-
|
|
546
|
-
cct duplicates # Find duplicate conversations and content
|
|
547
|
-
```
|
|
238
|
+
## MCP Server Tools
|
|
548
239
|
|
|
549
|
-
|
|
240
|
+
When installed as MCP server, Claude can use these tools directly:
|
|
550
241
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
242
|
+
- `health_check` - System health
|
|
243
|
+
- `scan_image_issues` / `fix_image_issues` - Content fixes
|
|
244
|
+
- `security_scan` / `audit_session` - Security
|
|
245
|
+
- `clean_claude_directory` / `clean_traces` - Cleanup
|
|
246
|
+
- `list_sessions` / `recover_session` - Session management
|
|
247
|
+
- `validate_mcp_config` - MCP validation
|
|
248
|
+
- `start_dashboard` - Launch dashboard
|
|
555
249
|
|
|
556
|
-
|
|
250
|
+
---
|
|
557
251
|
|
|
558
|
-
|
|
559
|
-
cct maintenance # Check what needs attention
|
|
560
|
-
cct maintenance --auto # Automatically fix issues
|
|
561
|
-
cct maintenance --schedule # Get cron/launchd setup instructions
|
|
562
|
-
```
|
|
252
|
+
## How It Works
|
|
563
253
|
|
|
564
|
-
|
|
254
|
+
1. Locates Claude Code data in `~/.claude/projects/`
|
|
255
|
+
2. Scans `.jsonl` conversation files
|
|
256
|
+
3. Detects oversized content (images >100KB, PDFs, large text)
|
|
257
|
+
4. Replaces problematic content with placeholders
|
|
258
|
+
5. Creates backups before any modification
|
|
565
259
|
|
|
566
|
-
|
|
567
|
-
npm install # Install dependencies
|
|
568
|
-
npm run build # Build TypeScript
|
|
569
|
-
npm test # Run tests (70 tests)
|
|
570
|
-
npm run dev # Watch mode
|
|
571
|
-
npm run test:coverage # Coverage report
|
|
572
|
-
```
|
|
260
|
+
---
|
|
573
261
|
|
|
574
|
-
##
|
|
262
|
+
## Links
|
|
575
263
|
|
|
576
|
-
|
|
264
|
+
- [npm](https://www.npmjs.com/package/@asifkibria/claude-code-toolkit)
|
|
265
|
+
- [GitHub](https://github.com/asifkibria/claude-code-toolkit)
|
|
266
|
+
- [Website](https://asifkibria.github.io/claude-code-toolkit)
|
|
577
267
|
|
|
578
268
|
## License
|
|
579
269
|
|
|
580
|
-
MIT
|
|
581
|
-
|
|
582
|
-
## Links
|
|
583
|
-
|
|
584
|
-
- [npm package](https://www.npmjs.com/package/@asifkibria/claude-code-toolkit)
|
|
585
|
-
- [GitHub repository](https://github.com/asifkibria/claude-code-toolkit)
|
|
586
|
-
- [Original issue #2939](https://github.com/anthropics/claude-code/issues/2939)
|
|
270
|
+
MIT
|
|
587
271
|
|
|
588
272
|
---
|
|
589
273
|
|