@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.
Files changed (67) hide show
  1. package/README.md +152 -468
  2. package/dist/CLAUDE.md +7 -0
  3. package/dist/__tests__/dashboard.test.d.ts +2 -0
  4. package/dist/__tests__/dashboard.test.d.ts.map +1 -0
  5. package/dist/__tests__/dashboard.test.js +606 -0
  6. package/dist/__tests__/dashboard.test.js.map +1 -0
  7. package/dist/__tests__/mcp-validator.test.d.ts +2 -0
  8. package/dist/__tests__/mcp-validator.test.d.ts.map +1 -0
  9. package/dist/__tests__/mcp-validator.test.js +217 -0
  10. package/dist/__tests__/mcp-validator.test.js.map +1 -0
  11. package/dist/__tests__/security.test.d.ts +2 -0
  12. package/dist/__tests__/security.test.d.ts.map +1 -0
  13. package/dist/__tests__/security.test.js +375 -0
  14. package/dist/__tests__/security.test.js.map +1 -0
  15. package/dist/__tests__/session-recovery.test.d.ts +2 -0
  16. package/dist/__tests__/session-recovery.test.d.ts.map +1 -0
  17. package/dist/__tests__/session-recovery.test.js +230 -0
  18. package/dist/__tests__/session-recovery.test.js.map +1 -0
  19. package/dist/__tests__/storage.test.d.ts +2 -0
  20. package/dist/__tests__/storage.test.d.ts.map +1 -0
  21. package/dist/__tests__/storage.test.js +241 -0
  22. package/dist/__tests__/storage.test.js.map +1 -0
  23. package/dist/__tests__/trace.test.d.ts +2 -0
  24. package/dist/__tests__/trace.test.d.ts.map +1 -0
  25. package/dist/__tests__/trace.test.js +376 -0
  26. package/dist/__tests__/trace.test.js.map +1 -0
  27. package/dist/cli.js +322 -30
  28. package/dist/cli.js.map +1 -1
  29. package/dist/index.js +554 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/lib/dashboard-ui.d.ts +2 -0
  32. package/dist/lib/dashboard-ui.d.ts.map +1 -0
  33. package/dist/lib/dashboard-ui.js +2075 -0
  34. package/dist/lib/dashboard-ui.js.map +1 -0
  35. package/dist/lib/dashboard.d.ts +15 -0
  36. package/dist/lib/dashboard.d.ts.map +1 -0
  37. package/dist/lib/dashboard.js +1422 -0
  38. package/dist/lib/dashboard.js.map +1 -0
  39. package/dist/lib/logs.d.ts +42 -0
  40. package/dist/lib/logs.d.ts.map +1 -0
  41. package/dist/lib/logs.js +166 -0
  42. package/dist/lib/logs.js.map +1 -0
  43. package/dist/lib/mcp-validator.d.ts +86 -0
  44. package/dist/lib/mcp-validator.d.ts.map +1 -0
  45. package/dist/lib/mcp-validator.js +463 -0
  46. package/dist/lib/mcp-validator.js.map +1 -0
  47. package/dist/lib/scanner.d.ts +6 -2
  48. package/dist/lib/scanner.d.ts.map +1 -1
  49. package/dist/lib/scanner.js +17 -14
  50. package/dist/lib/scanner.js.map +1 -1
  51. package/dist/lib/security.d.ts +57 -0
  52. package/dist/lib/security.d.ts.map +1 -0
  53. package/dist/lib/security.js +423 -0
  54. package/dist/lib/security.js.map +1 -0
  55. package/dist/lib/session-recovery.d.ts +60 -0
  56. package/dist/lib/session-recovery.d.ts.map +1 -0
  57. package/dist/lib/session-recovery.js +433 -0
  58. package/dist/lib/session-recovery.js.map +1 -0
  59. package/dist/lib/storage.d.ts +68 -0
  60. package/dist/lib/storage.d.ts.map +1 -0
  61. package/dist/lib/storage.js +500 -0
  62. package/dist/lib/storage.js.map +1 -0
  63. package/dist/lib/trace.d.ts +119 -0
  64. package/dist/lib/trace.d.ts.map +1 -0
  65. package/dist/lib/trace.js +649 -0
  66. package/dist/lib/trace.js.map +1 -0
  67. package/package.json +11 -3
package/README.md CHANGED
@@ -2,588 +2,272 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@asifkibria/claude-code-toolkit.svg)](https://www.npmjs.com/package/@asifkibria/claude-code-toolkit)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- [![Tests](https://img.shields.io/badge/tests-70%20passing-brightgreen)](https://github.com/asifkibria/claude-code-toolkit)
6
5
 
7
- A comprehensive MCP server and CLI toolkit for maintaining, optimizing, and troubleshooting your Claude Code installation.
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
- ## The Problem This Solves
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
- # Scan for issues
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. You're back.
14
+ # Restart Claude Code - you're back
15
+ ```
45
16
 
46
- ### Install Globally (Recommended)
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 scan
54
- cct fix
25
+ cct dashboard
55
26
  ```
56
27
 
57
- ## Installation Options
58
-
59
- ### Option 1: MCP Server (Let Claude Maintain Itself)
28
+ ### Add as MCP Server
60
29
 
61
- Add to Claude Code so you can literally ask Claude to check and fix its own issues:
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 just ask Claude:
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
- ### Option 2: CLI Tool
38
+ ---
73
39
 
74
- ```bash
75
- # Global install
76
- npm install -g @asifkibria/claude-code-toolkit
40
+ ## Core Features
77
41
 
78
- # Or use npx (no install needed)
79
- npx @asifkibria/claude-code-toolkit <command>
80
- ```
42
+ ### 1. Fix Broken Sessions
81
43
 
82
- ### Option 3: From Source
44
+ When you upload an oversized image/PDF, your entire conversation breaks. This fixes it.
83
45
 
84
46
  ```bash
85
- git clone https://github.com/asifkibria/claude-code-toolkit.git
86
- cd claude-code-toolkit
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
- ## CLI Commands
91
-
92
- ### `cct health` - Quick Health Check
51
+ ### 2. Web Dashboard
93
52
 
94
- Start here. Shows overall status and recommendations.
53
+ Visual management of your entire Claude Code installation.
95
54
 
96
55
  ```bash
97
- $ cct health
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
- ### `cct scan` - Scan for Issues (Dry Run)
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
- Scanning 23 file(s)...
61
+ ### 3. Security Scanning
120
62
 
121
- -Users-me-projects-myapp/conversation1.jsonl
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
- $ cct fix
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
- ### `cct stats` - Conversation Statistics
154
-
155
- See what's using space and resources.
70
+ ### 4. Storage Management
156
71
 
157
72
  ```bash
158
- $ cct stats --limit 5 --sort size
159
-
160
- Conversation Statistics
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
- ### `cct context` - Estimate Context Size
78
+ ---
176
79
 
177
- See how much context/tokens your conversations are using.
80
+ ## Common Problems & Solutions
178
81
 
179
- ### `cct analytics` - Usage Analytics Dashboard
82
+ ### 🚨 Out of Memory / API Error
180
83
 
181
- Get a comprehensive view of your Claude Code usage with activity trends, top projects, and tool statistics.
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
- $ cct analytics
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
- ### `cct duplicates` - Find Duplicate Content
92
+ ### 🔐 Leaked Secrets
222
93
 
223
- Scan for duplicate conversations and content (images, documents) that waste storage and context.
94
+ Accidentally pasted API keys, passwords, or tokens in chat? Find and audit them before they're exposed.
224
95
 
225
96
  ```bash
226
- $ cct duplicates
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
- ### `cct archive` - Archive Old Conversations
101
+ ### 🛑 Broken Sessions
259
102
 
260
- Move inactive conversations to an archive directory to free up space.
103
+ Claude crashed mid-conversation and `--resume` doesn't work? Recover and repair corrupted session files.
261
104
 
262
105
  ```bash
263
- $ cct archive --days 60 --dry-run
264
-
265
- ╔══════════════════════════════════════════════════════════════╗
266
- ║ CONVERSATION ARCHIVE REPORT ║
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
- ### `cct maintenance` - Scheduled Maintenance
112
+ ### 💾 Disk Space
290
113
 
291
- Run automated maintenance checks and actions.
114
+ Months of conversation history eating up GBs? Clean old traces and archive inactive sessions.
292
115
 
293
116
  ```bash
294
- $ cct maintenance
295
-
296
- ╔══════════════════════════════════════════════════════════════╗
297
- ║ MAINTENANCE REPORT ║
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
- ```bash
327
- # Summary of all conversations by context size
328
- $ cct context
329
-
330
- Context Usage Summary
123
+ ### 👁 Privacy / Trace Cleanup
331
124
 
332
- Total conversations: 23
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
- $ cct backups
373
-
374
- Backup Files (5 files, 89.3 MB total)
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
- ### `cct restore <path>` - Restore from Backup
134
+ ### 📦 Backup & Restore
382
135
 
383
- Undo a fix if needed.
136
+ Need to undo a fix or restore a conversation? Automatic backups before every change.
384
137
 
385
138
  ```bash
386
- $ cct restore ~/.claude/projects/-Users-me-myapp/conversation.jsonl.backup.2024-01-15T10-30-00
387
-
388
- Restored /Users/me/.claude/projects/-Users-me-myapp/conversation.jsonl
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
- ### `cct cleanup` - Delete Old Backups
144
+ ### 📷 Storage Snapshots
393
145
 
394
- Free up disk space.
146
+ Track how Claude's storage grows over time. Compare snapshots to see what changed.
395
147
 
396
148
  ```bash
397
- # Preview what would be deleted
398
- $ cct cleanup --days 7 --dry-run
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
- ### `cct export` - Export Conversation
153
+ ### 📜 Debug Logs
414
154
 
415
- Export a conversation to markdown or JSON for backup, sharing, or archiving.
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
- # Export to markdown (default)
419
- $ cct export -f ~/.claude/projects/-Users-me-myapp/conversation.jsonl
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
- **Export formats:**
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
- ### I accidentally uploaded a huge file
165
+ MCP servers aren't working? Validate configs and test connectivity.
505
166
 
506
167
  ```bash
507
- cct fix -f ~/.claude/projects/path/to/conversation.jsonl
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
- ### I want to undo a fix
511
-
512
- ```bash
513
- cct backups # Find your backup
514
- cct restore /path/to/backup # Restore it
515
- ```
173
+ ### 📊 Visual Dashboard
516
174
 
517
- ### My disk is filling up
175
+ Want a visual overview of everything? 14 tabs for complete management.
518
176
 
519
177
  ```bash
520
- cct cleanup --days 30 --dry-run # Preview
521
- cct cleanup --days 30 # Delete
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
- ### I want to save or share a conversation
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
- ### My conversations are getting slow
185
+ Need to export a conversation for backup or sharing?
532
186
 
533
187
  ```bash
534
- cct context # See which conversations are using the most tokens
188
+ cct export -f /path/to/conversation.jsonl
189
+ cct export -f conversation.jsonl --format json
535
190
  ```
536
191
 
537
- ### I want to see my usage patterns
192
+ ---
538
193
 
539
- ```bash
540
- cct analytics # Full usage dashboard with trends and stats
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
- ### I have duplicate content wasting space
236
+ ---
544
237
 
545
- ```bash
546
- cct duplicates # Find duplicate conversations and content
547
- ```
238
+ ## MCP Server Tools
548
239
 
549
- ### I want to clean up old conversations
240
+ When installed as MCP server, Claude can use these tools directly:
550
241
 
551
- ```bash
552
- cct archive --days 60 --dry-run # Preview what would be archived
553
- cct archive --days 60 # Archive conversations inactive for 60+ days
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
- ### I want automated maintenance
250
+ ---
557
251
 
558
- ```bash
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
- ## Development
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
- ```bash
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
- ## Contributing
262
+ ## Links
575
263
 
576
- Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md).
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 - see [LICENSE](LICENSE)
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