@indigoai-us/hq-cli 5.330.0 → 5.331.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.331.0] — 2026-10-02
6
+ - Prevent duplicate Claude hook dispatch inside the HQ root when global hooks are installed.
7
+
5
8
  ## [5.330.0] — 2026-10-02
6
9
  - `hq lanes message` and `hq lanes resume` can refresh model, effort, and account settings from the current worker profile when a done lane starts a new story, behind the default-off `lanes.reuse-refreshes-profile` flag. Reused settings are recorded in lane history; provider-changing reuse is refused without changing the lane.
7
10
 
@@ -49,9 +49,14 @@ export function hqSkillsSource(hqRoot) {
49
49
  }
50
50
  /** The exact hook command registered for one event (absolute path, quoted). */
51
51
  export function hookCommand(hqRoot, event, target = 'master') {
52
+ const skipInsideRoot = `if [ -d "\${CLAUDE_PROJECT_DIR:-}" ] && [ "\${CLAUDE_PROJECT_DIR}" -ef ${shellQuote(hqRoot)} ]; then exit 0; fi; `;
52
53
  if (target === 'shim')
53
- return `/bin/sh ${JSON.stringify(shimPath(hqRoot))} ${event} --runtime claude`;
54
- return `bash ${JSON.stringify(masterHookPath(hqRoot))} ${event}`;
54
+ return `${skipInsideRoot}exec /bin/sh ${shellQuote(shimPath(hqRoot))} ${shellQuote(event)} --runtime claude`;
55
+ return `${skipInsideRoot}exec bash ${shellQuote(masterHookPath(hqRoot))} ${shellQuote(event)}`;
56
+ }
57
+ /** Quote one argument for the POSIX shell used by Claude Code command hooks. */
58
+ function shellQuote(value) {
59
+ return `'${value.replace(/'/g, "'\\''")}'`;
55
60
  }
56
61
  // ---------------------------------------------------------------------------
57
62
  // CLAUDE.md block.
@@ -92,8 +97,9 @@ function isHqHookEntry(entry, hqRoot) {
92
97
  if (!entry || typeof entry !== 'object')
93
98
  return false;
94
99
  const cmd = entry.command;
95
- return (typeof cmd === 'string' &&
96
- (cmd.includes(JSON.stringify(masterHookPath(hqRoot))) || cmd.includes(JSON.stringify(shimPath(hqRoot)))));
100
+ if (typeof cmd !== 'string')
101
+ return false;
102
+ return [masterHookPath(hqRoot), shimPath(hqRoot)].some((target) => cmd.includes(target) || cmd.includes(JSON.stringify(target)) || cmd.includes(shellQuote(target)));
97
103
  }
98
104
  /**
99
105
  * Add one HQ hook group per event; idempotent. An HQ entry for the other
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.330.0",
3
+ "version": "5.331.0",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {