fantasy-claude 1.0.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.
Files changed (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -0
  3. package/VERSION +1 -0
  4. package/cli.sh +7 -0
  5. package/config.json +135 -0
  6. package/configure.py +1922 -0
  7. package/configure.sh +5 -0
  8. package/hooks/notify-auth.sh +17 -0
  9. package/hooks/notify-elicitation.sh +17 -0
  10. package/hooks/notify-idle.sh +9 -0
  11. package/hooks/notify-permission.sh +17 -0
  12. package/hooks/notify.sh +38 -0
  13. package/hooks/sounds.sh +55 -0
  14. package/install.sh +67 -0
  15. package/package.json +25 -0
  16. package/sounds/error/.gitkeep +0 -0
  17. package/sounds/error/FFAAAAH.mp3 +0 -0
  18. package/sounds/error/lego-break.mp3 +0 -0
  19. package/sounds/notification/.gitkeep +0 -0
  20. package/statusline/elements/battery.sh +12 -0
  21. package/statusline/elements/burn-rate.sh +6 -0
  22. package/statusline/elements/context-pct.sh +40 -0
  23. package/statusline/elements/cwd.sh +21 -0
  24. package/statusline/elements/datetime.sh +2 -0
  25. package/statusline/elements/file-entropy.sh +31 -0
  26. package/statusline/elements/git-branch.sh +3 -0
  27. package/statusline/elements/github-repo.sh +6 -0
  28. package/statusline/elements/haiku.sh +77 -0
  29. package/statusline/elements/model.sh +33 -0
  30. package/statusline/elements/mood.sh +27 -0
  31. package/statusline/elements/moon-phase.sh +31 -0
  32. package/statusline/elements/pomodoro.sh +39 -0
  33. package/statusline/elements/reset-time.sh +15 -0
  34. package/statusline/elements/session-cost.sh +42 -0
  35. package/statusline/elements/session-duration.sh +43 -0
  36. package/statusline/elements/streak.sh +47 -0
  37. package/statusline/elements/usage-5h.sh +6 -0
  38. package/statusline/statusline.sh +223 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 itsAlfantasy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # claude-hooks
2
+
3
+ Configurable statusline and sound hooks for [Claude Code](https://claude.ai/code).
4
+
5
+ ## Features
6
+
7
+ - **Statusline**: compose your status bar with modular elements (git branch, cwd, time, battery, …)
8
+ - **Sound hooks**: play sounds on tool errors, stop, or notifications — sounds are bundled, no downloads needed
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ git clone https://github.com/yourusername/claude-hooks.git
14
+ cd claude-hooks
15
+ bash install.sh
16
+ ```
17
+
18
+ Then restart Claude Code.
19
+
20
+ ## Configuration
21
+
22
+ ### Interactive configurator
23
+
24
+ Run the TUI configurator to change settings without editing JSON:
25
+
26
+ ```bash
27
+ bash configure.sh
28
+ ```
29
+
30
+ Use `↑↓` to navigate, `Enter` to select, `←` to go back, `q` to quit.
31
+ Changes are written to `config.json` immediately on confirmation.
32
+
33
+ ### Manual config
34
+
35
+ Edit `config.json` directly to customize:
36
+
37
+ ```json
38
+ {
39
+ "statusline": {
40
+ "elements": ["git-branch", "cwd", "datetime"]
41
+ },
42
+ "sounds": {
43
+ "on_error": "lego-break",
44
+ "on_stop": null,
45
+ "on_notification": null
46
+ }
47
+ }
48
+ ```
49
+
50
+ ### Statusline elements
51
+
52
+ | Element | Description |
53
+ |---|---|
54
+ | `git-branch` | Current git branch |
55
+ | `cwd` | Current working directory |
56
+ | `datetime` | Current time (HH:MM) |
57
+ | `battery` | Battery percentage |
58
+
59
+ To add a custom element, create a script in `statusline/elements/<name>.sh` that prints a single line, then add `<name>` to the `elements` array in `config.json`.
60
+
61
+ ### Sounds
62
+
63
+ Place `.mp3` files in:
64
+ - `sounds/error/` — for `on_error`
65
+ - `sounds/notification/` — for `on_stop` and `on_notification`
66
+
67
+ Then set the filename (without extension) in `config.json`. Set to `null` to disable.
68
+
69
+ **Supported events:**
70
+
71
+ | Event | When |
72
+ |---|---|
73
+ | `on_error` | A tool call returns an error |
74
+ | `on_stop` | Claude finishes a response |
75
+ | `on_notification` | Claude sends a notification |
76
+
77
+ ## Platform support
78
+
79
+ - macOS: `afplay`
80
+ - Linux: `paplay` or `aplay`
package/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.3
package/cli.sh ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
3
+ case "${1:-}" in
4
+ install) exec bash "$SCRIPT_DIR/install.sh" ;;
5
+ --version) cat "$SCRIPT_DIR/VERSION" ;;
6
+ *) exec python3 "$SCRIPT_DIR/configure.py" ;;
7
+ esac
package/config.json ADDED
@@ -0,0 +1,135 @@
1
+ {
2
+ "statusline": {
3
+ "default_color": null,
4
+ "separator_color": null,
5
+ "lines": [
6
+ [
7
+ "model",
8
+ "cwd",
9
+ "git-branch"
10
+ ],
11
+ [
12
+ "context-pct",
13
+ "burn-rate",
14
+ "session-cost"
15
+ ]
16
+ ],
17
+ "element_settings": {
18
+ "burn-rate": {
19
+ "emoji": true,
20
+ "label": false,
21
+ "color": "orange"
22
+ },
23
+ "cwd": {
24
+ "emoji": true,
25
+ "label": false,
26
+ "color": null,
27
+ "bar": "off",
28
+ "basename_only": true
29
+ },
30
+ "git-branch": {
31
+ "emoji": true,
32
+ "label": false,
33
+ "color": null,
34
+ "bar": "off"
35
+ },
36
+ "battery": {
37
+ "emoji": true,
38
+ "label": false,
39
+ "color": null,
40
+ "bar": "mono"
41
+ },
42
+ "context-pct": {
43
+ "emoji": true,
44
+ "label": false,
45
+ "color": "orange",
46
+ "bar": "multi"
47
+ },
48
+ "datetime": {
49
+ "emoji": true,
50
+ "label": false,
51
+ "color": null
52
+ },
53
+ "reset-time": {
54
+ "emoji": true,
55
+ "label": false,
56
+ "color": null
57
+ },
58
+ "session-cost": {
59
+ "emoji": true,
60
+ "label": false,
61
+ "color": "orange",
62
+ "bar": "off"
63
+ },
64
+ "session-duration": {
65
+ "emoji": true,
66
+ "label": false,
67
+ "color": null
68
+ },
69
+ "usage-5h": {
70
+ "emoji": false,
71
+ "label": true,
72
+ "color": "green",
73
+ "bar": "multi"
74
+ },
75
+ "model": {
76
+ "emoji": true,
77
+ "label": false,
78
+ "color": null,
79
+ "bar": "off",
80
+ "emoji_set": 2
81
+ },
82
+ "github-repo": {
83
+ "emoji": true,
84
+ "label": false,
85
+ "color": null,
86
+ "bar": "off"
87
+ },
88
+ "mood": {
89
+ "emoji": false,
90
+ "label": false,
91
+ "color": null,
92
+ "bar": "off",
93
+ "mood_set": 1
94
+ },
95
+ "streak": {
96
+ "emoji": true,
97
+ "label": false,
98
+ "color": null,
99
+ "bar": "off",
100
+ "show_unit": true
101
+ },
102
+ "pomodoro": {
103
+ "emoji": true,
104
+ "label": false,
105
+ "color": null,
106
+ "bar": "off",
107
+ "duration": 20
108
+ },
109
+ "file-entropy": {
110
+ "emoji": true,
111
+ "label": false,
112
+ "color": null,
113
+ "bar": "off"
114
+ },
115
+ "moon-phase": {
116
+ "emoji": false,
117
+ "label": false,
118
+ "color": null,
119
+ "bar": "off",
120
+ "show_name": true
121
+ },
122
+ "haiku": {
123
+ "emoji": false,
124
+ "label": false,
125
+ "color": null,
126
+ "bar": "off"
127
+ }
128
+ }
129
+ },
130
+ "sounds": {
131
+ "on_error": "lego-break",
132
+ "on_stop": null,
133
+ "on_notification": null
134
+ }
135
+ }