claude-code-cost 0.7.0 → 0.8.1

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
@@ -12,7 +12,7 @@
12
12
  npx claude-code-cost --open
13
13
  ```
14
14
 
15
- Open http://localhost:3458 (or use `--open` to auto-launch the browser).
15
+ Open http://localhost:3543 (or use `--open` to auto-launch the browser).
16
16
 
17
17
  That's it. No hooks, no config — the dashboard reads your existing Claude Code session files.
18
18
 
@@ -52,7 +52,7 @@ npx claude-code-cost --open # Auto-open browser
52
52
  npx claude-code-cost --dir=~/.claude-work # Custom Claude config dir
53
53
  ```
54
54
 
55
- If port 3458 is in use, the server falls back to a random available port.
55
+ If port 3543 is in use, the server falls back to a random available port.
56
56
 
57
57
  ### Global install
58
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-cost",
3
- "version": "0.7.0",
3
+ "version": "0.8.1",
4
4
  "description": "Cost dashboard for Claude Code usage",
5
5
  "main": "server.js",
6
6
  "bin": {
package/public/app.js CHANGED
@@ -682,6 +682,15 @@ function getChartColors() {
682
682
  };
683
683
  }
684
684
 
685
+ // Translucent fill from a hex color so chart bars read as a quiet wash, not a solid block.
686
+ function hexToRgba(hex, alpha) {
687
+ const h = hex.replace('#', '');
688
+ const r = parseInt(h.slice(0, 2), 16);
689
+ const g = parseInt(h.slice(2, 4), 16);
690
+ const b = parseInt(h.slice(4, 6), 16);
691
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
692
+ }
693
+
685
694
  function chartDefaults() {
686
695
  const c = getChartColors();
687
696
  return {
@@ -733,9 +742,9 @@ function renderDailyChart(daily, canvasId = 'dailyChart', chartKey = 'daily') {
733
742
  {
734
743
  label: 'Daily Cost',
735
744
  data: daily.map((d) => d.cost),
736
- backgroundColor: c.accent,
745
+ backgroundColor: c.chartFill,
737
746
  borderColor: c.accent,
738
- borderWidth: 1,
747
+ borderWidth: 1.5,
739
748
  borderRadius: 3,
740
749
  },
741
750
  ],
@@ -779,8 +788,9 @@ function renderModelChart(models, canvasId = 'modelChart', chartKey = 'model') {
779
788
  datasets: [
780
789
  {
781
790
  data: models.map((m) => m.cost),
782
- backgroundColor: models.map((_, i) => palette[i % palette.length]),
783
- borderWidth: 0,
791
+ backgroundColor: models.map((_, i) => hexToRgba(palette[i % palette.length], 0.5)),
792
+ borderColor: models.map((_, i) => palette[i % palette.length]),
793
+ borderWidth: 1.5,
784
794
  borderRadius: 3,
785
795
  },
786
796
  ],
package/public/style.css CHANGED
@@ -14,7 +14,7 @@
14
14
  --accent-text: #f0a070;
15
15
  --accent-dim: rgba(232, 111, 51, 0.22);
16
16
  --accent-glow: rgba(232, 111, 51, 0.55);
17
- --chart-fill: rgba(232, 111, 51, 0.6);
17
+ --chart-fill: rgba(232, 111, 51, 0.32);
18
18
  --success: #3ecf8e;
19
19
  --success-dim: rgba(62, 207, 142, 0.18);
20
20
  --warning: #f0b429;
@@ -249,9 +249,9 @@ body {
249
249
  }
250
250
 
251
251
  .stat-card {
252
- background: var(--bg-elevated);
252
+ background: var(--bg-surface);
253
253
  border: 1px solid var(--border);
254
- border-radius: 8px;
254
+ border-radius: 6px;
255
255
  padding: 16px;
256
256
  transition: border-color 0.15s ease;
257
257
  }
@@ -270,7 +270,7 @@ body {
270
270
 
271
271
  .stat-card .card-value {
272
272
  font-size: 22px;
273
- font-weight: 600;
273
+ font-weight: 500;
274
274
  color: var(--text-primary);
275
275
  font-family: var(--mono);
276
276
  }
@@ -297,9 +297,9 @@ body {
297
297
  }
298
298
 
299
299
  .chart-box {
300
- background: var(--bg-elevated);
300
+ background: var(--bg-surface);
301
301
  border: 1px solid var(--border);
302
- border-radius: 8px;
302
+ border-radius: 6px;
303
303
  padding: 16px;
304
304
  overflow: hidden;
305
305
  min-width: 0;
@@ -622,12 +622,14 @@ body {
622
622
  .modal-box {
623
623
  background: var(--bg-surface);
624
624
  border: 1px solid var(--border);
625
- border-radius: 12px;
625
+ border-radius: 8px;
626
626
  width: 90%;
627
627
  max-width: 500px;
628
628
  max-height: 90vh;
629
629
  padding: 24px;
630
- box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
630
+ box-shadow:
631
+ 0 16px 44px rgba(0, 0, 0, 0.38),
632
+ 0 4px 12px rgba(0, 0, 0, 0.2);
631
633
  overflow-y: auto;
632
634
  }
633
635
 
@@ -639,8 +641,10 @@ body {
639
641
  }
640
642
 
641
643
  .modal-title {
642
- font-size: 18px;
643
- font-weight: 600;
644
+ font-family: var(--serif);
645
+ font-size: 20px;
646
+ font-weight: 500;
647
+ letter-spacing: -0.01em;
644
648
  color: var(--text-primary);
645
649
  }
646
650
 
@@ -759,8 +763,8 @@ body {
759
763
  }
760
764
 
761
765
  .toast.toast-success {
762
- border-color: #2ea043;
763
- color: #2ea043;
766
+ border-color: var(--success);
767
+ color: var(--success);
764
768
  }
765
769
 
766
770
  @keyframes slideIn {
@@ -780,10 +784,10 @@ body {
780
784
 
781
785
  body.light {
782
786
  --bg-deep: #e8e6e3;
783
- --bg-surface: #f4f3f1;
784
- --bg-elevated: #dddbd8;
787
+ --bg-surface: #efede9;
788
+ --bg-elevated: #fbfaf9;
785
789
  --bg-hover: #d2d0cc;
786
- --border: #a09b94;
790
+ --border: #cfcbc4;
787
791
  --text-primary: #0a0a0a;
788
792
  --text-secondary: #444444;
789
793
  --text-tertiary: #666666;
@@ -791,7 +795,7 @@ body.light {
791
795
  --accent-text: #b85a20;
792
796
  --accent-dim: rgba(232, 111, 51, 0.18);
793
797
  --accent-glow: rgba(232, 111, 51, 0.5);
794
- --chart-fill: rgba(232, 111, 51, 0.5);
798
+ --chart-fill: rgba(232, 111, 51, 0.28);
795
799
  --success: #1a8a5a;
796
800
  --success-dim: rgba(26, 138, 90, 0.15);
797
801
  --warning: #b07d0a;
package/server.js CHANGED
@@ -18,7 +18,7 @@ function getArg(name) {
18
18
  return process.argv[eqIdx + 1] || null;
19
19
  }
20
20
 
21
- const PORT = getArg('port') || process.env.PORT || 3458;
21
+ const PORT = getArg('port') || process.env.PORT || 3543;
22
22
  const claudeDirArg = getArg('dir');
23
23
  const CLAUDE_DIR = claudeDirArg
24
24
  ? claudeDirArg.replace(/^~/, os.homedir())