claude-code-tracker 1.2.2 → 1.2.4

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 CHANGED
@@ -167,6 +167,23 @@ The uninstaller removes the scripts from `~/.claude/tracking/` and removes the S
167
167
 
168
168
  ---
169
169
 
170
+ ## Skills
171
+
172
+ `install.sh` copies bundled Claude Code skills into `~/.claude/skills/` automatically. Skills are slash commands available in any Claude Code session.
173
+
174
+ ### /view-tracking
175
+
176
+ Opens the tracking dashboard and today's key-prompts file for the current project.
177
+
178
+ ```
179
+ /view-tracking
180
+ ```
181
+
182
+ - **macOS**: opens files with `open`
183
+ - **Linux / WSL**: opens files with `xdg-open` (falls back to printing the path if unavailable)
184
+
185
+ ---
186
+
170
187
  ## Cost note
171
188
 
172
189
  Figures shown are **API list-price equivalents** — what pay-as-you-go API customers would be charged at current Anthropic pricing. If you are on a Max subscription, these are not amounts billed to you.
package/install.sh CHANGED
@@ -36,6 +36,16 @@ else
36
36
  echo "Scripts installed to $INSTALL_DIR"
37
37
  fi
38
38
 
39
+ # Install skills to ~/.claude/skills/
40
+ if [[ -d "$SCRIPT_DIR/skills" ]]; then
41
+ for skill_dir in "$SCRIPT_DIR/skills"/*/; do
42
+ skill_name="$(basename "$skill_dir")"
43
+ mkdir -p "$HOME/.claude/skills/$skill_name"
44
+ cp "$skill_dir/SKILL.md" "$HOME/.claude/skills/$skill_name/SKILL.md"
45
+ echo "Skill installed: $skill_name"
46
+ done
47
+ fi
48
+
39
49
  # Patch settings.json — add Stop hook if not already present
40
50
  python3 - "$SETTINGS" "$HOOK_CMD" <<'PYEOF'
41
51
  import sys, json, os
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-tracker",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Automatic token, cost, and prompt tracking for Claude Code sessions",
5
5
  "keywords": [
6
6
  "claude",
@@ -15,7 +15,7 @@ from datetime import date
15
15
  def find_git_root():
16
16
  root = os.getcwd()
17
17
  while root != "/":
18
- if os.path.isdir(os.path.join(root, ".git")):
18
+ if os.path.exists(os.path.join(root, ".git")):
19
19
  return root
20
20
  root = os.path.dirname(root)
21
21
  return root
package/src/stop-hook.sh CHANGED
@@ -10,7 +10,7 @@ if [[ "${1:-}" == "--backfill-only" ]]; then
10
10
  if [[ -z "$CWD" ]]; then exit 0; fi
11
11
  PROJECT_ROOT="$CWD"
12
12
  while [[ "$PROJECT_ROOT" != "/" ]]; do
13
- [[ -d "$PROJECT_ROOT/.git" ]] && break
13
+ [[ -e "$PROJECT_ROOT/.git" ]] && break
14
14
  PROJECT_ROOT="$(dirname "$PROJECT_ROOT")"
15
15
  done
16
16
  if [[ "$PROJECT_ROOT" == "/" ]]; then exit 0; fi
@@ -37,7 +37,7 @@ if [[ -z "$CWD" || -z "$TRANSCRIPT" || ! -f "$TRANSCRIPT" ]]; then exit 0; fi
37
37
  # Find project root (walk up to .git)
38
38
  PROJECT_ROOT="$CWD"
39
39
  while [[ "$PROJECT_ROOT" != "/" ]]; do
40
- [[ -d "$PROJECT_ROOT/.git" ]] && break
40
+ [[ -e "$PROJECT_ROOT/.git" ]] && break
41
41
  PROJECT_ROOT="$(dirname "$PROJECT_ROOT")"
42
42
  done
43
43
  if [[ "$PROJECT_ROOT" == "/" ]]; then exit 0; fi
package/uninstall.sh CHANGED
@@ -1,6 +1,11 @@
1
1
  #!/usr/bin/env bash
2
2
  set -euo pipefail
3
3
 
4
+ if [[ "$OSTYPE" == msys* || "$OSTYPE" == cygwin* || -n "${WINDIR:-}" ]]; then
5
+ echo "Error: claude-code-tracker requires a Unix shell (macOS, Linux, or WSL)." >&2
6
+ exit 1
7
+ fi
8
+
4
9
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
10
  INSTALL_DIR="$HOME/.claude/tracking"
6
11
  SETTINGS="$HOME/.claude/settings.json"
@@ -24,6 +29,18 @@ else
24
29
  fi
25
30
  fi
26
31
 
32
+ # Remove skills this package installed
33
+ if [[ -d "$SCRIPT_DIR/skills" ]]; then
34
+ for skill_dir in "$SCRIPT_DIR/skills"/*/; do
35
+ skill_name="$(basename "$skill_dir")"
36
+ dest="$HOME/.claude/skills/$skill_name"
37
+ if [[ -d "$dest" ]]; then
38
+ rm -rf "$dest"
39
+ echo "Skill removed: $skill_name"
40
+ fi
41
+ done
42
+ fi
43
+
27
44
  # Remove hook entry from settings.json
28
45
  if [[ -f "$SETTINGS" ]] && [[ -n "$HOOK_CMD" ]]; then
29
46
  python3 - "$SETTINGS" "$HOOK_CMD" <<'PYEOF'