@qazuor/claude-code-config 0.1.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 (171) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1248 -0
  3. package/dist/bin.cjs +11886 -0
  4. package/dist/bin.cjs.map +1 -0
  5. package/dist/bin.d.cts +1 -0
  6. package/dist/bin.d.ts +1 -0
  7. package/dist/bin.js +11869 -0
  8. package/dist/bin.js.map +1 -0
  9. package/dist/index.cjs +3887 -0
  10. package/dist/index.cjs.map +1 -0
  11. package/dist/index.d.cts +1325 -0
  12. package/dist/index.d.ts +1325 -0
  13. package/dist/index.js +3835 -0
  14. package/dist/index.js.map +1 -0
  15. package/package.json +86 -0
  16. package/templates/.log/notifications.log +1775 -0
  17. package/templates/agents/README.md +164 -0
  18. package/templates/agents/_registry.json +443 -0
  19. package/templates/agents/design/content-writer.md +353 -0
  20. package/templates/agents/design/ux-ui-designer.md +382 -0
  21. package/templates/agents/engineering/astro-engineer.md +293 -0
  22. package/templates/agents/engineering/db-drizzle-engineer.md +360 -0
  23. package/templates/agents/engineering/express-engineer.md +316 -0
  24. package/templates/agents/engineering/fastify-engineer.md +399 -0
  25. package/templates/agents/engineering/hono-engineer.md +263 -0
  26. package/templates/agents/engineering/mongoose-engineer.md +473 -0
  27. package/templates/agents/engineering/nestjs-engineer.md +429 -0
  28. package/templates/agents/engineering/nextjs-engineer.md +451 -0
  29. package/templates/agents/engineering/node-typescript-engineer.md +347 -0
  30. package/templates/agents/engineering/prisma-engineer.md +432 -0
  31. package/templates/agents/engineering/react-senior-dev.md +394 -0
  32. package/templates/agents/engineering/tanstack-start-engineer.md +447 -0
  33. package/templates/agents/engineering/tech-lead.md +269 -0
  34. package/templates/agents/product/product-functional.md +329 -0
  35. package/templates/agents/product/product-technical.md +578 -0
  36. package/templates/agents/quality/debugger.md +514 -0
  37. package/templates/agents/quality/qa-engineer.md +390 -0
  38. package/templates/agents/specialized/enrichment-agent.md +277 -0
  39. package/templates/agents/specialized/i18n-specialist.md +322 -0
  40. package/templates/agents/specialized/seo-ai-specialist.md +387 -0
  41. package/templates/agents/specialized/tech-writer.md +300 -0
  42. package/templates/code-style/.editorconfig +27 -0
  43. package/templates/code-style/.prettierignore +25 -0
  44. package/templates/code-style/.prettierrc +12 -0
  45. package/templates/code-style/biome.json +78 -0
  46. package/templates/code-style/commitlint.config.js +44 -0
  47. package/templates/commands/README.md +175 -0
  48. package/templates/commands/_registry.json +420 -0
  49. package/templates/commands/add-new-entity.md +211 -0
  50. package/templates/commands/audit/accessibility-audit.md +360 -0
  51. package/templates/commands/audit/performance-audit.md +290 -0
  52. package/templates/commands/audit/security-audit.md +231 -0
  53. package/templates/commands/code-check.md +127 -0
  54. package/templates/commands/five-why.md +225 -0
  55. package/templates/commands/formatting/format-markdown.md +197 -0
  56. package/templates/commands/git/commit.md +247 -0
  57. package/templates/commands/meta/create-agent.md +257 -0
  58. package/templates/commands/meta/create-command.md +312 -0
  59. package/templates/commands/meta/create-skill.md +321 -0
  60. package/templates/commands/meta/help.md +318 -0
  61. package/templates/commands/planning/check-completed-tasks.md +224 -0
  62. package/templates/commands/planning/cleanup-issues.md +248 -0
  63. package/templates/commands/planning/planning-cleanup.md +251 -0
  64. package/templates/commands/planning/sync-planning-github.md +133 -0
  65. package/templates/commands/planning/sync-todos-github.md +203 -0
  66. package/templates/commands/quality-check.md +211 -0
  67. package/templates/commands/run-tests.md +159 -0
  68. package/templates/commands/start-feature-plan.md +232 -0
  69. package/templates/commands/start-refactor-plan.md +244 -0
  70. package/templates/commands/sync-planning.md +176 -0
  71. package/templates/commands/update-docs.md +242 -0
  72. package/templates/docs/CHECKPOINT-SYSTEM.md +504 -0
  73. package/templates/docs/INDEX.md +677 -0
  74. package/templates/docs/RECOMMENDED-HOOKS.md +415 -0
  75. package/templates/docs/_registry.json +329 -0
  76. package/templates/docs/diagrams/README.md +220 -0
  77. package/templates/docs/diagrams/agent-hierarchy.mmd +55 -0
  78. package/templates/docs/diagrams/documentation-map.mmd +61 -0
  79. package/templates/docs/diagrams/tools-relationship.mmd +55 -0
  80. package/templates/docs/diagrams/workflow-decision-tree.mmd +38 -0
  81. package/templates/docs/doc-sync.md +533 -0
  82. package/templates/docs/examples/end-to-end-workflow.md +1505 -0
  83. package/templates/docs/glossary.md +495 -0
  84. package/templates/docs/guides/mockup-prompt-engineering.md +644 -0
  85. package/templates/docs/guides/mockup-setup.md +737 -0
  86. package/templates/docs/learnings/README.md +250 -0
  87. package/templates/docs/learnings/common-architectural-patterns.md +123 -0
  88. package/templates/docs/learnings/common-mistakes-to-avoid.md +149 -0
  89. package/templates/docs/learnings/markdown-formatting-standards.md +104 -0
  90. package/templates/docs/learnings/monorepo-command-execution.md +64 -0
  91. package/templates/docs/learnings/optimization-tips.md +146 -0
  92. package/templates/docs/learnings/planning-linear-sync-workflow.md +70 -0
  93. package/templates/docs/learnings/shell-compatibility-fish.md +46 -0
  94. package/templates/docs/learnings/test-organization-structure.md +68 -0
  95. package/templates/docs/mcp-installation.md +613 -0
  96. package/templates/docs/mcp-servers.md +989 -0
  97. package/templates/docs/notification-installation.md +570 -0
  98. package/templates/docs/quick-start.md +354 -0
  99. package/templates/docs/standards/architecture-patterns.md +1064 -0
  100. package/templates/docs/standards/atomic-commits.md +513 -0
  101. package/templates/docs/standards/code-standards.md +993 -0
  102. package/templates/docs/standards/design-standards.md +656 -0
  103. package/templates/docs/standards/documentation-standards.md +1160 -0
  104. package/templates/docs/standards/testing-standards.md +969 -0
  105. package/templates/docs/system-maintenance.md +604 -0
  106. package/templates/docs/templates/PDR-template.md +561 -0
  107. package/templates/docs/templates/TODOs-template.md +534 -0
  108. package/templates/docs/templates/tech-analysis-template.md +800 -0
  109. package/templates/docs/workflows/README.md +519 -0
  110. package/templates/docs/workflows/atomic-task-protocol.md +955 -0
  111. package/templates/docs/workflows/decision-tree.md +482 -0
  112. package/templates/docs/workflows/edge-cases.md +856 -0
  113. package/templates/docs/workflows/phase-1-planning.md +957 -0
  114. package/templates/docs/workflows/phase-2-implementation.md +896 -0
  115. package/templates/docs/workflows/phase-3-validation.md +792 -0
  116. package/templates/docs/workflows/phase-4-finalization.md +927 -0
  117. package/templates/docs/workflows/quick-fix-protocol.md +505 -0
  118. package/templates/docs/workflows/task-atomization.md +537 -0
  119. package/templates/docs/workflows/task-completion-protocol.md +448 -0
  120. package/templates/hooks/on-notification.sh +28 -0
  121. package/templates/schemas/checkpoint.schema.json +97 -0
  122. package/templates/schemas/code-registry.schema.json +84 -0
  123. package/templates/schemas/pdr.schema.json +314 -0
  124. package/templates/schemas/problems.schema.json +55 -0
  125. package/templates/schemas/tech-analysis.schema.json +404 -0
  126. package/templates/schemas/telemetry.schema.json +298 -0
  127. package/templates/schemas/todos.schema.json +234 -0
  128. package/templates/schemas/workflows.schema.json +69 -0
  129. package/templates/scripts/add-changelogs.sh +105 -0
  130. package/templates/scripts/generate-code-registry.ts +270 -0
  131. package/templates/scripts/health-check.sh +343 -0
  132. package/templates/scripts/sync-registry.sh +40 -0
  133. package/templates/scripts/telemetry-report.ts +36 -0
  134. package/templates/scripts/validate-docs.sh +224 -0
  135. package/templates/scripts/validate-registry.sh +225 -0
  136. package/templates/scripts/validate-schemas.ts +283 -0
  137. package/templates/scripts/validate-structure.sh +165 -0
  138. package/templates/scripts/worktree-cleanup.sh +81 -0
  139. package/templates/scripts/worktree-create.sh +63 -0
  140. package/templates/sessions/planning/.gitkeep +0 -0
  141. package/templates/sessions/planning/archived/.gitkeep +0 -0
  142. package/templates/settings.json +202 -0
  143. package/templates/settings.local.json +138 -0
  144. package/templates/skills/README.md +197 -0
  145. package/templates/skills/_registry.json +473 -0
  146. package/templates/skills/audit/accessibility-audit.md +309 -0
  147. package/templates/skills/audit/performance-audit.md +257 -0
  148. package/templates/skills/audit/security-audit.md +217 -0
  149. package/templates/skills/auth/nextauth-patterns.md +308 -0
  150. package/templates/skills/brand-guidelines.md +240 -0
  151. package/templates/skills/documentation/markdown-formatter.md +302 -0
  152. package/templates/skills/git/git-commit-helper.md +321 -0
  153. package/templates/skills/i18n/i18n-patterns.md +251 -0
  154. package/templates/skills/patterns/error-handling-patterns.md +242 -0
  155. package/templates/skills/patterns/tdd-methodology.md +342 -0
  156. package/templates/skills/qa/qa-criteria-validator.md +383 -0
  157. package/templates/skills/qa/web-app-testing.md +398 -0
  158. package/templates/skills/react/react-hook-form-patterns.md +359 -0
  159. package/templates/skills/state/redux-toolkit-patterns.md +272 -0
  160. package/templates/skills/state/tanstack-query-patterns.md +299 -0
  161. package/templates/skills/state/zustand-patterns.md +301 -0
  162. package/templates/skills/tech/mermaid-diagram-specialist.md +195 -0
  163. package/templates/skills/tech/shadcn-specialist.md +252 -0
  164. package/templates/skills/tech/vercel-specialist.md +297 -0
  165. package/templates/skills/testing/api-app-testing.md +254 -0
  166. package/templates/skills/testing/performance-testing.md +275 -0
  167. package/templates/skills/testing/security-testing.md +348 -0
  168. package/templates/skills/utils/add-memory.md +295 -0
  169. package/templates/skills/utils/json-data-auditor.md +283 -0
  170. package/templates/skills/utils/pdf-creator-editor.md +342 -0
  171. package/templates/tools/format-markdown.sh +185 -0
@@ -0,0 +1,570 @@
1
+ # Notification System Installation Guide
2
+
3
+ Complete guide for setting up desktop notifications for Claude Code in Ubuntu/Linux environments.
4
+
5
+ ---
6
+
7
+ ## Table of Contents
8
+
9
+ 1. [Overview](#overview)
10
+ 2. [Prerequisites](#prerequisites)
11
+ 3. [Installation](#installation)
12
+ 4. [Configuration](#configuration)
13
+ 5. [Customization](#customization)
14
+ 6. [Troubleshooting](#troubleshooting)
15
+ 7. [Advanced Features](#advanced-features)
16
+
17
+ ---
18
+
19
+ ## Overview
20
+
21
+ The notification system provides real-time feedback when Claude Code completes tasks or encounters issues.
22
+
23
+ **Features:**
24
+
25
+ - Desktop notifications via `notify-send`
26
+ - Audio alerts (beep or system sounds)
27
+ - Notification logging for history
28
+ - Customizable urgency levels
29
+ - Icon and sound customization
30
+
31
+ **Supported Platforms:**
32
+
33
+ - Ubuntu 20.04+
34
+ - Debian 11+
35
+ - Other Linux distributions with libnotify
36
+
37
+ ---
38
+
39
+ ## Prerequisites
40
+
41
+ ### Required Dependencies
42
+
43
+ ```bash
44
+ # Update package manager
45
+ sudo apt update
46
+
47
+ # jq - REQUIRED (JSON processor for hooks)
48
+ sudo apt install jq
49
+
50
+ # libnotify-bin - REQUIRED (desktop notifications)
51
+ sudo apt install libnotify-bin
52
+ ```
53
+
54
+ ### Optional Dependencies
55
+
56
+ ```bash
57
+ # beep - OPTIONAL (system beep sounds)
58
+ sudo apt install beep
59
+
60
+ # speech-dispatcher - OPTIONAL (text-to-speech)
61
+ sudo apt install speech-dispatcher
62
+ ```
63
+
64
+ ### Verify Installation
65
+
66
+ Create a verification script:
67
+
68
+ ```bash
69
+ # Check dependencies
70
+ which jq && echo "✅ jq installed" || echo "❌ jq missing"
71
+ which notify-send && echo "✅ notify-send installed" || echo "❌ notify-send missing"
72
+ which beep && echo "✅ beep installed (optional)" || echo "⚠️ beep not installed (optional)"
73
+ ```
74
+
75
+ **Expected output:**
76
+
77
+ ```
78
+ ✅ jq installed
79
+ ✅ notify-send installed
80
+ ✅ beep installed (optional)
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Installation
86
+
87
+ ### Step 1: Create Directory Structure
88
+
89
+ ```bash
90
+ # Navigate to project root
91
+ cd /path/to/project
92
+
93
+ # Create .claude structure
94
+ mkdir -p .claude/hooks
95
+ mkdir -p .claude/.log
96
+ ```
97
+
98
+ ### Step 2: Create Notification Hook
99
+
100
+ Create `.claude/hooks/on-notification.sh`:
101
+
102
+ ```bash
103
+ #!/usr/bin/env bash
104
+ set -euo pipefail
105
+
106
+ # Read JSON payload from stdin
107
+ payload="$(cat)"
108
+ message=$(echo "$payload" | jq -r '.message')
109
+
110
+ # Create log directory if it doesn't exist
111
+ mkdir -p .claude/.log
112
+
113
+ # Log notification
114
+ timestamp=$(date '+%Y-%m-%d %H:%M:%S')
115
+ echo "[$timestamp] $message" >> .claude/.log/notifications.log
116
+
117
+ # Basic beep (works everywhere)
118
+ echo -ne '\007'
119
+
120
+ # Desktop notification
121
+ if command -v notify-send &> /dev/null; then
122
+ notify-send "Claude Code" "$message" \
123
+ --icon=dialog-information \
124
+ --urgency=normal \
125
+ --expire-time=5000
126
+ fi
127
+ ```
128
+
129
+ ### Step 3: Make Hook Executable
130
+
131
+ ```bash
132
+ chmod +x .claude/hooks/on-notification.sh
133
+ ```
134
+
135
+ ### Step 4: Configure Claude Code
136
+
137
+ Update `.claude/settings.local.json`:
138
+
139
+ ```json
140
+ {
141
+ "hooks": {
142
+ "on-notification": ".claude/hooks/on-notification.sh"
143
+ }
144
+ }
145
+ ```
146
+
147
+ ### Step 5: Test Installation
148
+
149
+ ```bash
150
+ # Manual test
151
+ echo '{"message":"Hello from Claude Code"}' | .claude/hooks/on-notification.sh
152
+ ```
153
+
154
+ **Expected result:**
155
+
156
+ 1. ✅ Hear a beep
157
+ 2. ✅ See a desktop notification
158
+ 3. ✅ Check log file: `cat .claude/.log/notifications.log`
159
+
160
+ ---
161
+
162
+ ## Configuration
163
+
164
+ ### Basic Hook
165
+
166
+ Minimal notification hook:
167
+
168
+ ```bash
169
+ #!/usr/bin/env bash
170
+ set -euo pipefail
171
+
172
+ payload="$(cat)"
173
+ message=$(echo "$payload" | jq -r '.message')
174
+
175
+ # Log
176
+ mkdir -p .claude/.log
177
+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] $message" >> .claude/.log/notifications.log
178
+
179
+ # Beep
180
+ echo -ne '\007'
181
+
182
+ # Notify
183
+ notify-send "Claude Code" "$message"
184
+ ```
185
+
186
+ ### Notification Options
187
+
188
+ #### Urgency Levels
189
+
190
+ ```bash
191
+ # Low urgency (subtle)
192
+ notify-send "Claude Code" "$message" --urgency=low
193
+
194
+ # Normal urgency (default)
195
+ notify-send "Claude Code" "$message" --urgency=normal
196
+
197
+ # Critical urgency (persistent)
198
+ notify-send "Claude Code" "$message" --urgency=critical
199
+ ```
200
+
201
+ #### Icons
202
+
203
+ ```bash
204
+ # Information
205
+ notify-send "Claude Code" "$message" --icon=dialog-information
206
+
207
+ # Warning
208
+ notify-send "Claude Code" "$message" --icon=dialog-warning
209
+
210
+ # Error
211
+ notify-send "Claude Code" "$message" --icon=dialog-error
212
+
213
+ # Success
214
+ notify-send "Claude Code" "$message" --icon=emblem-success
215
+ ```
216
+
217
+ #### Duration
218
+
219
+ ```bash
220
+ # Auto-dismiss after 5 seconds
221
+ notify-send "Claude Code" "$message" --expire-time=5000
222
+
223
+ # Persistent (until clicked)
224
+ notify-send "Claude Code" "$message" --expire-time=0
225
+ ```
226
+
227
+ ---
228
+
229
+ ## Customization
230
+
231
+ ### Smart Notification Hook
232
+
233
+ Advanced hook with conditional formatting:
234
+
235
+ ```bash
236
+ #!/usr/bin/env bash
237
+ set -euo pipefail
238
+
239
+ payload="$(cat)"
240
+ message=$(echo "$payload" | jq -r '.message')
241
+
242
+ # Log
243
+ mkdir -p .claude/.log
244
+ timestamp=$(date '+%Y-%m-%d %H:%M:%S')
245
+ echo "[$timestamp] $message" >> .claude/.log/notifications.log
246
+
247
+ # Beep
248
+ echo -ne '\007'
249
+
250
+ # Determine urgency and icon based on message content
251
+ urgency="normal"
252
+ icon="dialog-information"
253
+ sound="/usr/share/sounds/freedesktop/stereo/message.oga"
254
+
255
+ if [[ "$message" == *"ERROR"* ]] || [[ "$message" == *"FAIL"* ]]; then
256
+ urgency="critical"
257
+ icon="dialog-error"
258
+ sound="/usr/share/sounds/freedesktop/stereo/dialog-error.oga"
259
+ elif [[ "$message" == *"SUCCESS"* ]] || [[ "$message" == *"COMPLETE"* ]]; then
260
+ icon="emblem-success"
261
+ sound="/usr/share/sounds/freedesktop/stereo/complete.oga"
262
+ elif [[ "$message" == *"WARNING"* ]]; then
263
+ urgency="normal"
264
+ icon="dialog-warning"
265
+ sound="/usr/share/sounds/freedesktop/stereo/dialog-warning.oga"
266
+ fi
267
+
268
+ # Desktop notification
269
+ if command -v notify-send &> /dev/null; then
270
+ notify-send "Claude Code" "$message" \
271
+ --icon="$icon" \
272
+ --urgency="$urgency" \
273
+ --expire-time=5000
274
+ fi
275
+
276
+ # Play sound
277
+ if command -v paplay &> /dev/null; then
278
+ paplay "$sound" 2>/dev/null || true
279
+ fi
280
+ ```
281
+
282
+ ### Audio Options
283
+
284
+ #### Option 1: Basic Beep
285
+
286
+ ```bash
287
+ # Terminal beep (no installation required)
288
+ echo -ne '\007'
289
+ ```
290
+
291
+ #### Option 2: System Sounds
292
+
293
+ ```bash
294
+ # Using paplay (PulseAudio - usually pre-installed)
295
+ paplay /usr/share/sounds/freedesktop/stereo/complete.oga
296
+
297
+ # Using aplay (ALSA)
298
+ aplay /usr/share/sounds/alsa/Front_Center.wav
299
+ ```
300
+
301
+ #### Option 3: Custom Beep
302
+
303
+ ```bash
304
+ # Using beep package (requires installation)
305
+ if command -v beep &> /dev/null; then
306
+ beep -f 800 -l 200
307
+ fi
308
+
309
+ # Parameters:
310
+ # -f 800: Frequency in Hz (higher = higher pitch)
311
+ # -l 200: Duration in milliseconds
312
+ ```
313
+
314
+ #### Option 4: Text-to-Speech
315
+
316
+ ```bash
317
+ # Requires speech-dispatcher
318
+ if command -v spd-say &> /dev/null; then
319
+ spd-say "$message"
320
+ fi
321
+ ```
322
+
323
+ ### Available System Sounds
324
+
325
+ Ubuntu/Debian systems include these sounds:
326
+
327
+ ```bash
328
+ # Success/completion
329
+ /usr/share/sounds/freedesktop/stereo/complete.oga
330
+
331
+ # Error
332
+ /usr/share/sounds/freedesktop/stereo/dialog-error.oga
333
+
334
+ # Warning
335
+ /usr/share/sounds/freedesktop/stereo/dialog-warning.oga
336
+
337
+ # Message
338
+ /usr/share/sounds/freedesktop/stereo/message.oga
339
+
340
+ # Bell
341
+ /usr/share/sounds/freedesktop/stereo/bell.oga
342
+ ```
343
+
344
+ ---
345
+
346
+ ## Troubleshooting
347
+
348
+ ### Hook Not Executing
349
+
350
+ #### Solution 1: Check Permissions
351
+
352
+ ```bash
353
+ # Verify executable
354
+ ls -l .claude/hooks/on-notification.sh
355
+
356
+ # Should show: -rwxr-xr-x
357
+
358
+ # If not, make executable
359
+ chmod +x .claude/hooks/on-notification.sh
360
+ ```
361
+
362
+ #### Solution 2: Verify jq Installation
363
+
364
+ ```bash
365
+ which jq
366
+ # Should output: /usr/bin/jq
367
+
368
+ # If not installed
369
+ sudo apt install jq
370
+ ```
371
+
372
+ #### Solution 3: Test Hook Manually
373
+
374
+ ```bash
375
+ echo '{"message":"Test notification"}' | .claude/hooks/on-notification.sh
376
+ ```
377
+
378
+ ### No Desktop Notifications
379
+
380
+ **Test notify-send:**
381
+
382
+ ```bash
383
+ notify-send "Test" "This is a test notification"
384
+ ```
385
+
386
+ **If not working, reinstall:**
387
+
388
+ ```bash
389
+ sudo apt install --reinstall libnotify-bin
390
+ ```
391
+
392
+ **Check notification daemon:**
393
+
394
+ ```bash
395
+ # For GNOME
396
+ ps aux | grep notification-daemon
397
+
398
+ # For KDE
399
+ ps aux | grep knotify
400
+ ```
401
+
402
+ ### No Audio
403
+
404
+ #### Solution 1: Check System Volume
405
+
406
+ Ensure system volume is not muted.
407
+
408
+ #### Solution 2: Test Audio
409
+
410
+ ```bash
411
+ # Test with paplay
412
+ paplay /usr/share/sounds/freedesktop/stereo/bell.oga
413
+
414
+ # Test with aplay
415
+ speaker-test -t sine -f 1000 -l 1
416
+ ```
417
+
418
+ #### Solution 3: Use Alternative Audio
419
+
420
+ ```bash
421
+ # Instead of beep, use paplay
422
+ paplay /usr/share/sounds/freedesktop/stereo/complete.oga
423
+ ```
424
+
425
+ ### Beep Permission Denied
426
+
427
+ The `beep` command requires special permissions.
428
+
429
+ #### Solution: Use paplay instead
430
+
431
+ ```bash
432
+ # Replace beep with
433
+ paplay /usr/share/sounds/freedesktop/stereo/complete.oga
434
+ ```
435
+
436
+ ### Log File Not Created
437
+
438
+ **Check directory permissions:**
439
+
440
+ ```bash
441
+ ls -ld .claude/.log
442
+
443
+ # If directory doesn't exist or no write permission
444
+ mkdir -p .claude/.log
445
+ chmod 755 .claude/.log
446
+ ```
447
+
448
+ ---
449
+
450
+ ## Advanced Features
451
+
452
+ ### Viewing Notification Logs
453
+
454
+ ```bash
455
+ # View all notifications
456
+ cat .claude/.log/notifications.log
457
+
458
+ # View in real-time
459
+ tail -f .claude/.log/notifications.log
460
+
461
+ # View last 10
462
+ tail -n 10 .claude/.log/notifications.log
463
+
464
+ # Search for specific messages
465
+ grep "ERROR" .claude/.log/notifications.log
466
+
467
+ # Count notifications by type
468
+ grep -c "SUCCESS" .claude/.log/notifications.log
469
+ grep -c "ERROR" .claude/.log/notifications.log
470
+ ```
471
+
472
+ ### Log Rotation
473
+
474
+ Prevent log file from growing too large:
475
+
476
+ ```bash
477
+ #!/usr/bin/env bash
478
+ # Add to hook
479
+
480
+ LOG_FILE=".claude/.log/notifications.log"
481
+ MAX_LINES=1000
482
+
483
+ # Rotate if too large
484
+ if [ -f "$LOG_FILE" ]; then
485
+ lines=$(wc -l < "$LOG_FILE")
486
+ if [ "$lines" -gt "$MAX_LINES" ]; then
487
+ tail -n "$MAX_LINES" "$LOG_FILE" > "$LOG_FILE.tmp"
488
+ mv "$LOG_FILE.tmp" "$LOG_FILE"
489
+ fi
490
+ fi
491
+ ```
492
+
493
+ ### Notification Actions
494
+
495
+ Add clickable buttons to notifications:
496
+
497
+ ```bash
498
+ notify-send "Claude Code" "$message" \
499
+ --action="view=View Details" \
500
+ --action="dismiss=Dismiss"
501
+ ```
502
+
503
+ ### Custom Icons
504
+
505
+ Use custom icon files:
506
+
507
+ ```bash
508
+ notify-send "Claude Code" "$message" \
509
+ --icon=/path/to/custom-icon.png
510
+ ```
511
+
512
+ ### Integration with Other Tools
513
+
514
+ #### Slack Integration
515
+
516
+ ```bash
517
+ # Add to hook
518
+ if [ -n "$SLACK_WEBHOOK_URL" ]; then
519
+ curl -X POST "$SLACK_WEBHOOK_URL" \
520
+ -H 'Content-Type: application/json' \
521
+ -d "{\"text\":\"Claude Code: $message\"}"
522
+ fi
523
+ ```
524
+
525
+ #### Email Notifications
526
+
527
+ ```bash
528
+ # For critical errors only
529
+ if [[ "$message" == *"ERROR"* ]]; then
530
+ echo "$message" | mail -s "Claude Code Error" user@example.com
531
+ fi
532
+ ```
533
+
534
+ ---
535
+
536
+ ## Final Checklist
537
+
538
+ Before using the notification system, verify:
539
+
540
+ - [ ] `jq` installed
541
+ - [ ] `libnotify-bin` installed
542
+ - [ ] `.claude/hooks/` directory created
543
+ - [ ] `on-notification.sh` created and executable
544
+ - [ ] Hook tested manually
545
+ - [ ] Desktop notifications working
546
+ - [ ] Audio alerts working (optional)
547
+ - [ ] Log file created in `.claude/.log/notifications.log`
548
+
549
+ ---
550
+
551
+ ## Related Documentation
552
+
553
+ - [MCP Installation Guide](.claude/docs/mcp-installation.md)
554
+ - [System Maintenance](.claude/docs/system-maintenance.md)
555
+ - [Quick Start Guide](.claude/docs/quick-start.md)
556
+ - [Recommended Hooks](.claude/docs/RECOMMENDED-HOOKS.md)
557
+
558
+ **External Resources:**
559
+
560
+ - [notify-send Manual](https://manpages.ubuntu.com/manpages/focal/man1/notify-send.1.html)
561
+ - [jq Manual](https://stedolan.github.io/jq/manual/)
562
+ - [Ubuntu Sound Theme](https://wiki.ubuntu.com/Sound)
563
+
564
+ ---
565
+
566
+ ## Changelog
567
+
568
+ | Version | Date | Changes | Author | Related |
569
+ |---------|------|---------|--------|---------|
570
+ | 1.0.0 | 2024-10-31 | Initial comprehensive notification guide | @tech-lead | P-004 |