claude-code-monitor 1.0.1 → 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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.2] - 2026-01-17
9
+
10
+ ### Fixed
11
+
12
+ - Handle undefined cwd in session display (shows "(unknown)" instead of crashing)
13
+ - Ensure hook data is written before process exits
14
+
15
+ ### Security
16
+
17
+ - Set file permission 0o600 for settings.json
18
+
8
19
  ## [1.0.1] - 2026-01-17
9
20
 
10
21
  ### Changed
package/README.md CHANGED
@@ -2,11 +2,12 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/claude-code-monitor.svg)](https://www.npmjs.com/package/claude-code-monitor)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![macOS](https://img.shields.io/badge/platform-macOS-lightgrey.svg)](https://www.apple.com/macos/)
5
6
 
6
- A CLI tool to monitor multiple Claude Code sessions in real-time from your terminal.
7
+ **A CLI tool to monitor multiple Claude Code sessions in real-time from your terminal.**
7
8
 
8
9
  <p align="center">
9
- <img src="docs/demo.gif" alt="Claude Code Monitor Demo" width="1000">
10
+ <img src="https://raw.githubusercontent.com/onikan27/claude-code-monitor/main/docs/ccm-demo.gif" alt="Claude Code Monitor Demo" width="1000">
10
11
  </p>
11
12
 
12
13
  ---
@@ -43,6 +44,8 @@ A CLI tool to monitor multiple Claude Code sessions in real-time from your termi
43
44
 
44
45
  ## 📋 Requirements
45
46
 
47
+ > **Note**: This tool is **macOS only** due to its use of AppleScript for terminal focus features.
48
+
46
49
  - **macOS** (focus feature is macOS only)
47
50
  - **Node.js** >= 18.0.0
48
51
  - **Claude Code** installed
@@ -1 +1 @@
1
- {"version":3,"file":"SessionCard.d.ts","sourceRoot":"","sources":["../../src/components/SessionCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKjD,UAAU,gBAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACrB;AAMD,eAAO,MAAM,WAAW,8CAiCtB,CAAC"}
1
+ {"version":3,"file":"SessionCard.d.ts","sourceRoot":"","sources":["../../src/components/SessionCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKjD,UAAU,gBAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;CACrB;AAOD,eAAO,MAAM,WAAW,8CAiCtB,CAAC"}
@@ -5,6 +5,8 @@ import { getStatusDisplay } from '../utils/status.js';
5
5
  import { formatRelativeTime } from '../utils/time.js';
6
6
  import { Spinner } from './Spinner.js';
7
7
  function abbreviateHomePath(path) {
8
+ if (!path)
9
+ return '(unknown)';
8
10
  return path.replace(/^\/Users\/[^/]+/, '~');
9
11
  }
10
12
  export const SessionCard = memo(function SessionCard({ session, index, isSelected, }) {
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/hook/handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlE,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAMhD,CAAC;AAEH,gBAAgB;AAChB,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAExE;AAED,gBAAgB;AAChB,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEhE;AAED,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDpF"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/hook/handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlE,gBAAgB;AAChB,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAMhD,CAAC;AAEH,gBAAgB;AAChB,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAExE;AAED,gBAAgB;AAChB,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAEhE;AAED,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDpF"}
@@ -1,4 +1,4 @@
1
- import { updateSession } from '../store/file-store.js';
1
+ import { flushPendingWrites, updateSession } from '../store/file-store.js';
2
2
  // Allowed hook event names (whitelist)
3
3
  /** @internal */
4
4
  export const VALID_HOOK_EVENTS = new Set([
@@ -59,4 +59,6 @@ export async function handleHookEvent(eventName, tty) {
59
59
  notification_type: hookPayload.notification_type,
60
60
  };
61
61
  updateSession(event);
62
+ // Ensure data is written before process exits (hooks are short-lived processes)
63
+ flushPendingWrites();
62
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/setup/index.ts"],"names":[],"mappings":"AAUA,gBAAgB;AAChB,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,gBAAgB;AAChB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B,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAG/F;AAaD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,CAcjF;AAkBD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAazF;AAkDD;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAwB3C;AAED,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAyChD"}
@@ -120,7 +120,10 @@ function applyHooks(settings, hooksToAdd, baseCommand) {
120
120
  existing.push(createHookEntry(eventName, baseCommand));
121
121
  }
122
122
  }
123
- writeFileSync(SETTINGS_FILE, JSON.stringify(settings, null, 2), 'utf-8');
123
+ writeFileSync(SETTINGS_FILE, JSON.stringify(settings, null, 2), {
124
+ encoding: 'utf-8',
125
+ mode: 0o600,
126
+ });
124
127
  }
125
128
  /**
126
129
  * Check if hooks are already configured
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-monitor",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "CLI for monitoring multiple Claude Code sessions in real-time",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",