@mmerterden/multi-agent-pipeline 23.3.0 → 23.5.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.
Files changed (239) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +27 -8
  3. package/README.tr.md +28 -9
  4. package/SECURITY.md +16 -0
  5. package/docs/adr/0008-installer-modularization-and-secret-leak-defense.md +1 -1
  6. package/docs/adr/0010-own-code-graph.md +299 -8
  7. package/docs/architecture.md +3 -3
  8. package/docs/ecosystem.md +10 -10
  9. package/docs/engineering.md +4 -4
  10. package/docs/facts.json +8 -8
  11. package/docs/features.md +5 -5
  12. package/docs/performance.md +17 -17
  13. package/install/_dev-only-files.mjs +9 -0
  14. package/install/_platform-filter.mjs +2 -55
  15. package/install/claude.mjs +28 -2
  16. package/install/codex.mjs +1 -3
  17. package/install/copilot.mjs +4 -8
  18. package/install/templates/claude-hooks.json +32 -1
  19. package/manifest.json +236 -167
  20. package/package.json +11 -3
  21. package/pipeline/commands/multi-agent/SKILL.md +1 -1
  22. package/pipeline/commands/multi-agent/design-check/SKILL.md +3 -2
  23. package/pipeline/commands/multi-agent/diff-explain/SKILL.md +3 -3
  24. package/pipeline/commands/multi-agent/graph/SKILL.md +57 -24
  25. package/pipeline/commands/multi-agent/pair/SKILL.md +92 -0
  26. package/pipeline/commands/multi-agent/prune-prompts/SKILL.md +1 -1
  27. package/pipeline/commands/multi-agent/search/SKILL.md +7 -1
  28. package/pipeline/commands/multi-agent/status/SKILL.md +4 -0
  29. package/pipeline/commands/multi-agent/sync/SKILL.md +3 -3
  30. package/pipeline/contract/CHANGELOG.md +63 -0
  31. package/pipeline/contract/README.md +1 -0
  32. package/pipeline/contract/build.mjs +13 -1
  33. package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
  34. package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
  35. package/pipeline/contract/fixtures/runs-awaiting-question.json +4 -1
  36. package/pipeline/contract/fixtures/runs-empty.json +1 -1
  37. package/pipeline/contract/fixtures/runs-failed.json +4 -1
  38. package/pipeline/contract/fixtures/runs-old-schema.json +3 -0
  39. package/pipeline/contract/fixtures/runs-pr-opened-redacted.json +4 -1
  40. package/pipeline/contract/fixtures/runs-pr-opened.json +4 -1
  41. package/pipeline/contract/fixtures/runs-running.json +4 -1
  42. package/pipeline/contract/manifest.json +41 -15
  43. package/pipeline/contract/types/index.d.ts +81 -3
  44. package/pipeline/lib/detach-self.mjs +95 -0
  45. package/pipeline/lib/public-mcp-servers.mjs +33 -0
  46. package/pipeline/lib/rotated-log.mjs +93 -0
  47. package/pipeline/lib/stack-detect.sh +1 -1
  48. package/pipeline/lib/tls-trust.mjs +29 -0
  49. package/pipeline/lib/usage-lifecycle.mjs +9 -11
  50. package/pipeline/lib/usage-names.generated.mjs +613 -0
  51. package/pipeline/lib/usage-run-key.mjs +235 -0
  52. package/pipeline/lib/usage-vocab.mjs +210 -0
  53. package/pipeline/multi-agent-refs/analysis/intake.md +2 -2
  54. package/pipeline/multi-agent-refs/analysis/render.md +1 -1
  55. package/pipeline/multi-agent-refs/channels/generator.md +4 -5
  56. package/pipeline/multi-agent-refs/cross-cli-contract.md +3 -3
  57. package/pipeline/multi-agent-refs/design-check/init-inventory.md +11 -1
  58. package/pipeline/multi-agent-refs/design-check/scope-and-ledger.md +1 -1
  59. package/pipeline/multi-agent-refs/features/code-graph.md +146 -11
  60. package/pipeline/multi-agent-refs/features/code-intelligence.md +16 -14
  61. package/pipeline/multi-agent-refs/features/dev-critic.md +7 -7
  62. package/pipeline/multi-agent-refs/features/model-fallback.md +6 -4
  63. package/pipeline/multi-agent-refs/features/remote-control.md +253 -0
  64. package/pipeline/multi-agent-refs/features/review-delta.md +1 -1
  65. package/pipeline/multi-agent-refs/features/review-file-set.md +3 -3
  66. package/pipeline/multi-agent-refs/features/review-multi-repo.md +1 -1
  67. package/pipeline/multi-agent-refs/features/session-brief.md +42 -0
  68. package/pipeline/multi-agent-refs/features/skill-conformance.md +3 -3
  69. package/pipeline/multi-agent-refs/features/usage-reporting.md +255 -27
  70. package/pipeline/multi-agent-refs/help/en.md +3 -2
  71. package/pipeline/multi-agent-refs/help/tr.md +3 -2
  72. package/pipeline/multi-agent-refs/knowledge.md +1 -1
  73. package/pipeline/multi-agent-refs/orchestrator/dispatcher.md +2 -2
  74. package/pipeline/multi-agent-refs/phases/operations.md +2 -2
  75. package/pipeline/multi-agent-refs/phases/phase-0-init.md +13 -12
  76. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +4 -4
  77. package/pipeline/multi-agent-refs/phases/phase-3-review.md +2 -0
  78. package/pipeline/multi-agent-refs/phases/phase-5-report.md +1 -1
  79. package/pipeline/multi-agent-refs/platform-parity.md +2 -2
  80. package/pipeline/multi-agent-refs/wiki-capture.md +3 -17
  81. package/pipeline/office/index.html +1309 -236
  82. package/pipeline/office/toolkit.json +1 -1
  83. package/pipeline/rules/outside-the-pipeline.md +1 -1
  84. package/pipeline/schemas/activity.schema.json +23 -0
  85. package/pipeline/schemas/agent-state.schema.json +6 -1
  86. package/pipeline/schemas/code-graph-calls.schema.json +254 -0
  87. package/pipeline/schemas/code-graph-docs.schema.json +223 -0
  88. package/pipeline/schemas/code-graph-infra.schema.json +227 -0
  89. package/pipeline/schemas/code-graph.schema.json +2 -2
  90. package/pipeline/schemas/examples/design-check-config.json +27 -0
  91. package/pipeline/schemas/learning-curve.schema.json +67 -0
  92. package/pipeline/schemas/mcp-health.schema.json +96 -0
  93. package/pipeline/schemas/office-jobs.json +69 -2
  94. package/pipeline/schemas/office-jobs.schema.json +8 -1
  95. package/pipeline/schemas/phases.json +5 -0
  96. package/pipeline/schemas/phases.schema.json +8 -0
  97. package/pipeline/schemas/prefs.schema.json +46 -12
  98. package/pipeline/schemas/runs-index.schema.json +17 -0
  99. package/pipeline/schemas/toolkit-path-params.json +78 -8
  100. package/pipeline/scripts/README.md +1 -0
  101. package/pipeline/scripts/_code-graph.mjs +184 -103
  102. package/pipeline/scripts/_contract-core.mjs +1 -1
  103. package/pipeline/scripts/_contract-routes-office.mjs +33 -0
  104. package/pipeline/scripts/_diff-impact.mjs +21 -2
  105. package/pipeline/scripts/_graph-sidecars.mjs +372 -0
  106. package/pipeline/scripts/_http-post.mjs +103 -115
  107. package/pipeline/scripts/_safe-read.mjs +57 -0
  108. package/pipeline/scripts/_skill-practices.mjs +26 -0
  109. package/pipeline/scripts/_strip-code.mjs +380 -0
  110. package/pipeline/scripts/activity-snapshot.mjs +13 -1
  111. package/pipeline/scripts/aggregate-metrics.mjs +3 -5
  112. package/pipeline/scripts/build-stack-plugins.mjs +1 -47
  113. package/pipeline/scripts/call-graph/index.mjs +78 -0
  114. package/pipeline/scripts/call-graph/lang/cpp.mjs +308 -0
  115. package/pipeline/scripts/call-graph/lang/csharp.mjs +130 -0
  116. package/pipeline/scripts/call-graph/lang/go.mjs +303 -0
  117. package/pipeline/scripts/call-graph/lang/java.mjs +370 -0
  118. package/pipeline/scripts/call-graph/lang/kotlin.mjs +397 -0
  119. package/pipeline/scripts/call-graph/lang/python.mjs +399 -0
  120. package/pipeline/scripts/call-graph/lang/rust.mjs +345 -0
  121. package/pipeline/scripts/call-graph/lang/shared.mjs +230 -0
  122. package/pipeline/scripts/call-graph/lang/swift.mjs +432 -0
  123. package/pipeline/scripts/call-graph/lang/typescript.mjs +692 -0
  124. package/pipeline/scripts/call-graph/lex.mjs +396 -0
  125. package/pipeline/scripts/call-graph/platform.mjs +86 -0
  126. package/pipeline/scripts/call-graph/profiles.mjs +89 -0
  127. package/pipeline/scripts/call-graph/resolve.mjs +1125 -0
  128. package/pipeline/scripts/call-graph/scan.mjs +267 -0
  129. package/pipeline/scripts/code-graph-rules/android.json +7 -2
  130. package/pipeline/scripts/code-graph-rules/cpp.json +99 -0
  131. package/pipeline/scripts/code-graph-rules/csharp.json +102 -0
  132. package/pipeline/scripts/code-graph-rules/go.json +2 -1
  133. package/pipeline/scripts/code-graph-rules/ios.json +3 -1
  134. package/pipeline/scripts/code-graph-rules/java.json +76 -0
  135. package/pipeline/scripts/code-graph-rules/node.json +7 -2
  136. package/pipeline/scripts/code-graph-rules/python.json +6 -2
  137. package/pipeline/scripts/code-graph-rules/rust.json +105 -0
  138. package/pipeline/scripts/contract-server.mjs +3 -0
  139. package/pipeline/scripts/design-check-config.mjs +205 -0
  140. package/pipeline/scripts/feedback-send.mjs +26 -26
  141. package/pipeline/scripts/gate-ledger.mjs +2 -1
  142. package/pipeline/scripts/gen-facts.mjs +1 -2
  143. package/pipeline/scripts/gen-usage-names.mjs +124 -0
  144. package/pipeline/scripts/graph-affected.mjs +109 -20
  145. package/pipeline/scripts/graph-build.mjs +95 -15
  146. package/pipeline/scripts/graph-export.mjs +272 -0
  147. package/pipeline/scripts/graph-hint.mjs +15 -2
  148. package/pipeline/scripts/graph-query.mjs +305 -26
  149. package/pipeline/scripts/graph-report.mjs +187 -1
  150. package/pipeline/scripts/health-report.mjs +3 -4
  151. package/pipeline/scripts/infra/docs.mjs +317 -0
  152. package/pipeline/scripts/infra/extract.mjs +998 -0
  153. package/pipeline/scripts/infra/graph.mjs +245 -0
  154. package/pipeline/scripts/infra/yaml-lite.mjs +311 -0
  155. package/pipeline/scripts/job-launch.mjs +67 -2
  156. package/pipeline/scripts/learning-curve.mjs +288 -178
  157. package/pipeline/scripts/log-metric.sh +10 -1
  158. package/pipeline/scripts/mcp-health.mjs +309 -0
  159. package/pipeline/scripts/note-agent-event.mjs +3 -4
  160. package/pipeline/scripts/note-command-use.mjs +333 -0
  161. package/pipeline/scripts/note-command-use.sh +126 -0
  162. package/pipeline/scripts/note-mcp-call.sh +89 -0
  163. package/pipeline/scripts/note-mcp-failure.mjs +272 -1
  164. package/pipeline/scripts/note-session.sh +62 -3
  165. package/pipeline/scripts/note-skill-use.mjs +58 -2
  166. package/pipeline/scripts/office-build.mjs +115 -1
  167. package/pipeline/scripts/office-memory.mjs +14 -5
  168. package/pipeline/scripts/pair.mjs +333 -0
  169. package/pipeline/scripts/pre-push-check.sh +1 -1
  170. package/pipeline/scripts/remote/cbor.mjs +128 -0
  171. package/pipeline/scripts/remote/contract.mjs +98 -0
  172. package/pipeline/scripts/remote/handler.mjs +330 -0
  173. package/pipeline/scripts/remote/handles.mjs +57 -0
  174. package/pipeline/scripts/remote/lifecycle.mjs +186 -0
  175. package/pipeline/scripts/remote/listener.mjs +204 -0
  176. package/pipeline/scripts/remote/lockout.mjs +103 -0
  177. package/pipeline/scripts/remote/nonces.mjs +61 -0
  178. package/pipeline/scripts/remote/pairing.mjs +519 -0
  179. package/pipeline/scripts/remote/qr-encode.mjs +459 -0
  180. package/pipeline/scripts/remote/store.mjs +191 -0
  181. package/pipeline/scripts/remote/transport.mjs +211 -0
  182. package/pipeline/scripts/remote/verbs.json +70 -0
  183. package/pipeline/scripts/remote/verbs.mjs +217 -0
  184. package/pipeline/scripts/remote/webauthn.mjs +169 -0
  185. package/pipeline/scripts/remote/wire.mjs +364 -0
  186. package/pipeline/scripts/remote-listener.mjs +83 -0
  187. package/pipeline/scripts/route-learn.mjs +4 -4
  188. package/pipeline/scripts/run-kill.mjs +1 -1
  189. package/pipeline/scripts/run-write.mjs +13 -2
  190. package/pipeline/scripts/runs-index.mjs +30 -3
  191. package/pipeline/scripts/search-logs.sh +9 -0
  192. package/pipeline/scripts/session-brief.mjs +458 -0
  193. package/pipeline/scripts/session-brief.sh +130 -0
  194. package/pipeline/scripts/skill-usage.mjs +16 -5
  195. package/pipeline/scripts/test-gap-rules/cpp.json +25 -0
  196. package/pipeline/scripts/test-gap-rules/csharp.json +20 -0
  197. package/pipeline/scripts/test-gap-rules/java.json +20 -0
  198. package/pipeline/scripts/test-gap-rules/rust.json +14 -0
  199. package/pipeline/scripts/token-budget-report.mjs +3 -2
  200. package/pipeline/scripts/uninstall.mjs +29 -0
  201. package/pipeline/scripts/usage-access.mjs +16 -31
  202. package/pipeline/scripts/usage-health.mjs +31 -62
  203. package/pipeline/scripts/usage-register-beacon.mjs +11 -22
  204. package/pipeline/scripts/usage-register.mjs +39 -29
  205. package/pipeline/scripts/usage-report.mjs +579 -178
  206. package/pipeline/scripts/validate-code-graph.mjs +361 -111
  207. package/pipeline/scripts/write-state.mjs +39 -0
  208. package/pipeline/skills/.skill-manifest.json +21 -17
  209. package/pipeline/skills/.skills-index.json +13 -2
  210. package/pipeline/skills/shared/README.md +5 -4
  211. package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +1 -1
  212. package/pipeline/skills/shared/core/multi-agent-diff-explain/SKILL.md +3 -3
  213. package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +55 -21
  214. package/pipeline/skills/shared/core/multi-agent-pair/SKILL.md +41 -0
  215. package/pipeline/skills/shared/core/multi-agent-prune-prompts/SKILL.md +1 -1
  216. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +3 -3
  217. package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +2 -3
  218. package/pipeline/skills/shared/external/app-store-optimization/references/keyword-research-methodology.md +2 -2
  219. package/pipeline/skills/shared/external/app-store-optimization/references/product-page-variants.md +2 -2
  220. package/pipeline/skills/shared/external/app-store-review/SKILL.md +11 -4
  221. package/pipeline/skills/shared/external/build-settings-audit/SKILL.md +1 -1
  222. package/pipeline/skills/shared/external/build-time-benchmark/SKILL.md +5 -5
  223. package/pipeline/skills/shared/external/build-time-fixes/SKILL.md +5 -5
  224. package/pipeline/skills/shared/external/build-time-optimizer/SKILL.md +6 -6
  225. package/pipeline/skills/shared/external/free-llm-apis/references/providers.md +1 -0
  226. package/pipeline/skills/shared/external/ios-coding-standard/references/STANDARD.md +2 -2
  227. package/pipeline/skills/shared/external/ios-haptics/references/core-haptics.md +1 -1
  228. package/pipeline/skills/shared/external/localization-reuse-map/references/publish-and-snapshot.md +1 -1
  229. package/pipeline/skills/shared/external/package-build-audit/SKILL.md +3 -3
  230. package/pipeline/skills/shared/external/reverse-engineer-own-app/SKILL.md +2 -3
  231. package/pipeline/skills/shared/external/swift-compile-hotspots/SKILL.md +2 -2
  232. package/pipeline/skills/shared/external/weatherkit/SKILL.md +5 -6
  233. package/pipeline/skills/skills-index.md +3 -2
  234. package/docs/FIGMA_PIPELINE.md +0 -137
  235. package/pipeline/lib/identifier-scan.mjs +0 -156
  236. package/pipeline/scripts/_renamed-skills.mjs +0 -164
  237. package/pipeline/scripts/publish-staged.mjs +0 -324
  238. package/pipeline/skills/renamed.json +0 -30
  239. package/pipeline/skills/shared/external/ios-coding-standard/scripts/check_structure.py +0 -765
@@ -9,17 +9,10 @@
9
9
  * @module install/_platform-filter
10
10
  */
11
11
 
12
- import { existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from "fs";
13
- import { dirname, join } from "path";
12
+ import { readdirSync, writeFileSync } from "fs";
13
+ import { join } from "path";
14
14
  import { isDryRun } from "./_common.mjs";
15
15
  import { routeSkill } from "../pipeline/scripts/_stack-routing.mjs";
16
- import {
17
- aliasSkillMarkdown,
18
- aliasesFor,
19
- isAliasSkill,
20
- isUserInvocableOff,
21
- loadRenamed,
22
- } from "../pipeline/scripts/_renamed-skills.mjs";
23
16
 
24
17
  /** Uninstall reads this to know exactly which external skill dirs are ours to remove. */
25
18
  export const EXTERNAL_SKILLS_MANIFEST = ".external-skills-manifest.json";
@@ -78,49 +71,3 @@ export function writeExternalSkillsManifest(dest, names) {
78
71
  /* best-effort - a missing manifest just means uninstall falls back */
79
72
  }
80
73
  }
81
-
82
- /**
83
- * Write an alias skill under each renamed skill's old name, next to the
84
- * delivered skill it points at (pipeline/skills/renamed.json).
85
- *
86
- * An existing directory under the old name is replaced only when it is ours:
87
- * an alias written earlier, or a name `isOurs` vouches for (the previous
88
- * delivery manifest). A user's own directory that happens to carry the old
89
- * name is left alone.
90
- *
91
- * @param {string} dest - the host's skills directory
92
- * @param {string} pipelineSrc - absolute path to the package's `pipeline/`
93
- * @param {string[]} delivered - external skill names copied into `dest`
94
- * @param {(name: string) => boolean} [isOurs]
95
- * @returns {string[]} the old names now holding an alias
96
- */
97
- export function writeRenamedAliases(dest, pipelineSrc, delivered, isOurs = () => false) {
98
- let renamed;
99
- try {
100
- renamed = loadRenamed(dirname(pipelineSrc));
101
- } catch {
102
- return [];
103
- }
104
- const external = join(pipelineSrc, "skills", "shared", "external");
105
- const written = [];
106
- for (const [oldName, newName] of aliasesFor(renamed, delivered)) {
107
- const dir = join(dest, oldName);
108
- if (existsSync(dir) && !isOurs(oldName) && !isAliasSkill(join(dir, "SKILL.md"))) continue;
109
- written.push(oldName);
110
- if (isDryRun()) continue;
111
- try {
112
- rmSync(dir, { recursive: true, force: true });
113
- mkdirSync(dir, { recursive: true });
114
- writeFileSync(
115
- join(dir, "SKILL.md"),
116
- aliasSkillMarkdown(oldName, newName, {
117
- removeIn: renamed.removeIn,
118
- userInvocable: !isUserInvocableOff(join(external, newName, "SKILL.md")),
119
- }),
120
- );
121
- } catch {
122
- /* best-effort - the new name is delivered either way */
123
- }
124
- }
125
- return written;
126
- }
@@ -759,12 +759,15 @@ export function quotePipelineHookCommands(hooks) {
759
759
  * The run-scoped hooks the installer registers beside the two gates above:
760
760
  * run-stop-guard.sh (Stop), task-mirror.sh (TaskCreate / TaskUpdate),
761
761
  * answer-check.sh (AskUserQuestion, in every session: it only adds context),
762
- * file-context.sh (after a Read, and before a Read, Grep or Glob), pr-write-guard.sh (asks before a pr-threads.mjs apply writes to GitHub, denies it unattended), run-scope-guard.sh (Figma MCP tools, file edits, Figma over HTTP, direct run-state writes in Bash or WebFetch, and subagent spawns against the cost budget), note-skill-use.sh (after a Skill call, ok or failed) and note-mcp-failure.sh (after a failed MCP tool call). The run hooks are silent outside a pipeline run (file-context also runs everywhere when prefs.global.fileContext.enabled is true) and fail open, so
762
+ * file-context.sh (after a Read, and before a Read, Grep or Glob), pr-write-guard.sh (asks before a pr-threads.mjs apply writes to GitHub, denies it unattended), run-scope-guard.sh (Figma MCP tools, file edits, Figma over HTTP, direct run-state writes in Bash or WebFetch, and subagent spawns against the cost budget), note-skill-use.sh (after a Skill call, ok or failed) and note-mcp-failure.sh (after a failed MCP tool call) and session-brief.sh (at session start: prints a cached ledger index and graph line; inert until prefs.global.sessionBrief.enabled is true). The run hooks are silent outside a pipeline run (file-context also runs everywhere when prefs.global.fileContext.enabled is true) and fail open, so
763
763
  * registering them by default changes nothing until a run is active. note-skill-use.sh runs in every
764
764
  * session, records only the skill name, outcome, time, host and repo folder name into the local
765
765
  * skill-usage log, and is off with prefs.global.skillUsage.enabled false. note-mcp-failure.sh
766
766
  * records only the server, tool, time and a closed error class into the local MCP failure log,
767
- * probes nothing, and is off with prefs.global.mcpFailures.enabled false. Both are off with
767
+ * probes nothing, and is off with prefs.global.mcpFailures.enabled false. note-mcp-call.sh (after
768
+ * a successful MCP call, registered async) appends one line, the session id and the tool name,
769
+ * for the usage record; it starts no node process and does nothing unless
770
+ * prefs.global.usageLog.enabled is true. Both are off with
768
771
  * prefs.global.usageLog.optOut true. The same entries are in install/templates/claude-hooks.json.
769
772
  */
770
773
  export const RUN_HOOKS = [
@@ -844,6 +847,21 @@ export const RUN_HOOKS = [
844
847
  timeout: 5,
845
848
  statusMessage: "Counting the skill call...",
846
849
  },
850
+ {
851
+ event: "PostToolUse",
852
+ matcher: "mcp__.*",
853
+ script: "note-mcp-call.sh",
854
+ async: true,
855
+ timeout: 5,
856
+ statusMessage: "Counting the MCP call...",
857
+ },
858
+ {
859
+ event: "UserPromptSubmit",
860
+ script: "note-command-use.sh",
861
+ async: true,
862
+ timeout: 5,
863
+ statusMessage: "Counting the command...",
864
+ },
847
865
  {
848
866
  event: "PostToolUseFailure",
849
867
  matcher: "Skill",
@@ -858,6 +876,13 @@ export const RUN_HOOKS = [
858
876
  timeout: 5,
859
877
  statusMessage: "Counting the failed MCP call...",
860
878
  },
879
+ {
880
+ event: "SessionStart",
881
+ matcher: "startup|resume|clear|compact",
882
+ script: "session-brief.sh",
883
+ timeout: 5,
884
+ statusMessage: "Loading the session brief...",
885
+ },
861
886
  ];
862
887
 
863
888
  /**
@@ -904,6 +929,7 @@ export function ensureHook(hooks, r) {
904
929
  const hook = {
905
930
  type: "command",
906
931
  command: pipelineHookCommand(r.script),
932
+ ...(r.async === true ? { async: true } : {}),
907
933
  timeout: r.timeout,
908
934
  statusMessage: r.statusMessage,
909
935
  };
package/install/codex.mjs CHANGED
@@ -44,7 +44,6 @@ import {
44
44
  import {
45
45
  partitionExternalSkillsByPlugins,
46
46
  writeExternalSkillsManifest,
47
- writeRenamedAliases,
48
47
  } from "./_platform-filter.mjs";
49
48
  import { generateCodexInstructions } from "./_codex-instructions.mjs";
50
49
  import { mergeManagedBlock } from "./_managed-block.mjs";
@@ -490,8 +489,7 @@ function installSkillRefs(pipelineSrc, dest, home, platformFlag) {
490
489
  for (const name of keep) {
491
490
  count += copyTreeRewritten(join(externalSrc, name), join(dest, name));
492
491
  }
493
- const aliases = writeRenamedAliases(dest, pipelineSrc, keep);
494
- writeExternalSkillsManifest(dest, [...keep, ...aliases]);
492
+ writeExternalSkillsManifest(dest, keep);
495
493
  console.log(
496
494
  ` -> stack filter (${selectionSource}): ${keep.length} kept, ${skipped.length} skipped`,
497
495
  );
@@ -31,7 +31,6 @@ import {
31
31
  EXTERNAL_SKILLS_MANIFEST,
32
32
  partitionExternalSkillsByPlugins,
33
33
  writeExternalSkillsManifest,
34
- writeRenamedAliases,
35
34
  } from "./_platform-filter.mjs";
36
35
  import { DEV_ONLY_SCRIPTS, countDevOnlyFiles } from "./_dev-only-files.mjs";
37
36
  import { generateCopilotInstructions } from "./_copilot-instructions.mjs";
@@ -453,13 +452,10 @@ function installSkills(opts) {
453
452
  /* non-fatal */
454
453
  }
455
454
  }
456
- const aliases = writeRenamedAliases(dest, pipelineSrc, keep, (n) =>
457
- Boolean(prevDelivered?.has(n)),
458
- );
459
455
  // A name the previous delivery wrote that this catalog no longer has at all
460
- // (a renamed skill's old copy, an alias past its removal release) is ours
461
- // to remove; nothing else would ever clean it up.
462
- const current = new Set([...keep, ...skipped, ...aliases]);
456
+ // (a skill that was renamed or dropped) is ours to remove; nothing else
457
+ // would ever clean it up.
458
+ const current = new Set([...keep, ...skipped]);
463
459
  for (const name of prevDelivered ?? []) {
464
460
  if (current.has(name) || isDryRun()) continue;
465
461
  try {
@@ -468,7 +464,7 @@ function installSkills(opts) {
468
464
  /* non-fatal */
469
465
  }
470
466
  }
471
- writeExternalSkillsManifest(dest, [...keep, ...aliases]);
467
+ writeExternalSkillsManifest(dest, keep);
472
468
  console.log(
473
469
  ` -> stack filter (${selectionSource}): ${keep.length} kept, ${skipped.length} skipped`,
474
470
  );
@@ -1,5 +1,5 @@
1
1
  {
2
- "_readme": "Recommended Claude Code hooks for multi-agent-pipeline. `install` registers the pre-commit and agent-guard gates, the run-scoped run-stop-guard / run-scope-guard hooks, the task-mirror hook, the file-context hook, the skill-usage hook and the MCP failure hook itself (install/claude.mjs configureSettings, RUN_HOOKS); /multi-agent:setup offers to merge the rest of this block. Merge the `hooks` object into your ~/.claude/settings.json to make these deterministic PreToolUse gates real (exit 2 blocks the tool call). A PreToolUse matcher is a regex over the TOOL NAME, so each gate registers on a tool name and reads the command from its stdin payload. Three PreToolUse gates ship here: (1) pre-commit-check.sh on Bash, which acts only on a `git commit` and blocks a secret in the staged diff; (2) agent-guard.sh on Bash, on Edit|Write|NotebookEdit, and on WebFetch plus every multi-agent MCP tool (WebFetch|mcp__multi-agent__.*). Always, it blocks AI/assistant attribution in a commit message and a force-push, delete or mirror push to a protected branch (main/master/develop), including one inside a subshell or a `bash -c` / `eval` line. With MULTI_AGENT_UNATTENDED=1 in the hook's environment it also applies the unattended policy: no push, PR or tracker write, no Keychain read, no fetch outside the host allowlist (curl, WebFetch, the toolkit's web tools, agent_run_steps and open_url), no package install, and no write into a protected path (features/unattended-security.md); (3) check-read-size.sh on Read|Bash, which inspects Read plus the shell commands that read a file whole (cat/head/tail/sed), returns immediately for everything else, and routes an oversized read to a cheap worker instead of the caller's own rung; it is inert until `prefs.global.bulkRead.mode` is set to observe or enforce. Failure behaviour: pre-commit-check.sh and check-read-size.sh fail open on an internal error. agent-guard.sh fails open when attended, so a guard bug cannot break a legitimate tool call, and fails closed under MULTI_AGENT_UNATTENDED=1, where nobody is there to notice a gap. None of the three executes the inspected command, and none needs run-specific arguments. The other deterministic gates (evidence, consensus, intent, learnings) take run-specific arguments and are phase-enforced by the pipeline instead. Three capture hooks ship alongside them and block nothing: (4) SessionEnd runs capture-flush.sh --if-stale, which writes a run's triage findings and durable learnings into the per-repo stores when the run ended before Phase 5, where those writes otherwise happen; the same hook runs note-session.sh, which records the mechanical shape of a session outside the pipeline (tools used, commands that failed, calls the user refused). (4b) SubagentStop and PostToolUseFailure run note-agent-event.sh, which appends one row to the same session notes as the event happens: a subagent's type, id, the bound run's task id and its last message cut to 200 characters (secret-scanned; a hit stores the row without the message), or a failed tool's name and its command's first program word, never an argument or error text. (5) PreCompact runs capture-flush.sh without --if-stale: a compaction summarizes the conversation mid-phase, so it is the moment unflushed findings are at risk, and both writes are idempotent, so a finished run costs two no-op writes. The staleness test exists only so a session exit does not re-flush a run that already finished. (6) SessionStart runs capture-resume.sh, which prints at most two lines: an unfinished run and how to resume it, and a stale pipeline-observation queue. No capture hook calls a model or reads a payload - note-session.sh keeps a command's first word and an exit code, never an argument or any output - and all exit 0 on every path, because a hook that fails a session over bookkeeping costs more than the bookkeeping. A GitHub write gate ships too: (2a) pr-write-guard.sh on Bash answers `ask`, naming the PR and the operation, when the command runs `pr-threads.mjs apply` (directly, through a variable, inside `bash -c`, after `env` or as `node <path>`), so /multi-agent:address-review cannot reply, resolve or push without the person approving that one write at the host; with MULTI_AGENT_UNATTENDED=1 it answers `deny`. Every other Bash call gets no output, and it exits 0 on every path. A run-scoped PreToolUse gate ships too: (2b) run-scope-guard.sh on every Figma MCP tool (mcp__.*[Ff]igma.*) denies a Figma call above phases.json thresholds.mcpAllowedThroughPhase for the run bound to the session, unless the run is in analysis mode, and records each allowed call into telemetry.mcpCalls[]; on Edit|Write|NotebookEdit the same script warns, attended only, when the target is outside the bound run's worktree (additionalContext for the model, systemMessage for the user; the call proceeds). On Agent|Task, with prefs.global.costBudget.enabled true, it asks before a subagent starts while the bound run's estimated spend is over the ceiling (denies with onExceed halt) and adds a note for the model from the warn threshold. On Bash|WebFetch|AskUserQuestion it denies a question from a bound autopilot run, a Figma read over HTTP (figma.com or api.figma.com) under the same phase rule, and, in any session, a direct write to agent-state.json or tracker-state.json (Edit/Write, a shell redirect or tee), since write-state.mjs is their only writer; the shell wrapper starts node only when the payload mentions Figma or a state file. Outside a run it is silent, and it fails open. One PostToolUse hook ships as well and blocks nothing: (7) edit-syntax-gate.sh on Edit|Write|MultiEdit parses the file the edit just wrote (swiftc -parse, node --check, py_compile into a temp dir, JSON.parse, bash -n; Kotlin skipped) under a 2 s deadline and, when it no longer parses, hands the model the error as PostToolUse additionalContext; it exits 0 on every path, stays silent when a parser is missing or slow, and is inert until `prefs.global.editSyntaxGate.enabled` is true. A second PostToolUse hook blocks nothing either: (7b) task-mirror.sh on TaskCreate|TaskUpdate mirrors the native task list into the tracker of the run bound to the session (phase-tracker.sh task, tracker-contract.md, \"Mirroring the host's task list\"), skipping phase tiles, so the office panel shows the same list; silent outside a run, exit 0 on every path. A third blocks nothing: (7c) file-context.sh on Read (PostToolUse, and PreToolUse on Read|Grep|Glob) hands the model, once per file per session, what the repo's memory says about the file it reads or searches (ledger facts whose scope covers it, its latest review findings, its open known limits from debt-ledger.mjs) as additionalContext inside an <untrusted-data> block, after the secret scan and fitted to the host's 10,000-character hook output limit; a Grep with a path, or a Glob whose literal directory is inside the repo, is mapped to at most five files the stores know, and a whole-repo search gets nothing; inside a run bound to the session by default, everywhere with prefs.global.fileContext.enabled true, never with it false; exit 0 on every path. A fourth blocks nothing: (7d) answer-check.sh on AskUserQuestion names, as PostToolUse additionalContext, every question the user submitted without a choice, so an empty answer is asked again instead of resolved to the Recommended option; it runs in every session, since it only adds context, and exits 0 on every path. A fifth blocks nothing: (7e) graph-hint.sh on Grep|Glob (PreToolUse) adds, once per session, one line pointing at `/multi-agent:graph ask` and mcp__multi-agent__graph_query when the call searches the whole repo for a bare identifier and a current code graph (graphFreshness: build commit is HEAD, no indexed file changed) exists for the repo; silent with prefs.global.codeGraph.enabled false; exit 0 on every path. A sixth blocks nothing: (7f) note-skill-use.sh on Skill (PostToolUse and PostToolUseFailure) appends one row to the local <log root>/skill-usage.jsonl: the skill name (kept only when it matches a strict charset and length and carries no credential pattern, else the call is dropped), ok or error, the time, the host and the repo folder name (null outside a git repository and for a repository in prefs.global.memory.excludeProjects), never the arguments, the prompt or any output; past 1 MiB the log moves to skill-usage.jsonl.1; off with prefs.global.skillUsage.enabled false or prefs.global.usageLog.optOut true; it reads stdin for at most 1.5 s and exits 0 on every path. skill-usage.mjs summary and prune-candidates read it. A seventh blocks nothing: (7g) note-mcp-failure.sh on mcp__.* (PostToolUseFailure) appends one row to the local <log root>/mcp-failures.jsonl: the server and tool from the tool name (dropped unless both match a strict charset and length and carry no credential pattern), the time and a closed error class (the host's interrupt flag first, then a refusal by the user or the permission layer, then a JSON-RPC code in the error text, then a message opening with invalid or validation, then an HTTP status, then fixed patterns), never the arguments, the output or the error text itself; it probes nothing, is written by the same code as the skill-usage log, so it has the same 1 MiB cap and .1 generation, rotates under its own mcp-failures.jsonl.lock, never follows a symlink at the log path, is off with prefs.global.mcpFailures.enabled false or prefs.global.usageLog.optOut true, and exits 0 on every path; doctor's mcp-failures check reads it. One Stop hook ships as well: (8) run-stop-guard.sh answers {\"decision\":\"block\"} when the session driving an active pipeline run (bound through agent-state.json sessionId or hostSessionId, never by a worktree match) tries to stop while the run is in_progress below its mode's last phase with no haltReason or waitingFor; the reason says to finish the current phase, record the wait, or record a halt. A turn that ends on a question to the user, a session with background tasks or crons, and prefs.global.stopGuard.enabled false are never held, and run-stop-guard.sh is not registered on SubagentStop: a subagent's stop is the dispatching session's business. After three consecutive blocks it records the halt itself (status paused, haltReason <phase>:stop-guard), which write-state clears when the run advances a phase. It never blocks outside a run and fails open, with a line in <log root>/hook-failures.log, on any error. These registrations are Claude Code's; README \"Hooks per host\" lists which have no equivalent elsewhere. On Codex only the syntax gate is offered, from codex-hooks.json through host-hooks.mjs; Copilot CLI gets none, since as of 1.0.45 it discards postToolUse output; the other gates are Claude Code only. multi-agent:setup offers to merge this block.",
2
+ "_readme": "Recommended Claude Code hooks for multi-agent-pipeline. `install` registers the pre-commit and agent-guard gates, the run-scoped run-stop-guard / run-scope-guard hooks, the task-mirror hook, the file-context hook, the skill-usage hook and the MCP failure hook itself (install/claude.mjs configureSettings, RUN_HOOKS); /multi-agent:setup offers to merge the rest of this block. Merge the `hooks` object into your ~/.claude/settings.json to make these deterministic PreToolUse gates real (exit 2 blocks the tool call). A PreToolUse matcher is a regex over the TOOL NAME, so each gate registers on a tool name and reads the command from its stdin payload. Three PreToolUse gates ship here: (1) pre-commit-check.sh on Bash, which acts only on a `git commit` and blocks a secret in the staged diff; (2) agent-guard.sh on Bash, on Edit|Write|NotebookEdit, and on WebFetch plus every multi-agent MCP tool (WebFetch|mcp__multi-agent__.*). Always, it blocks AI/assistant attribution in a commit message and a force-push, delete or mirror push to a protected branch (main/master/develop), including one inside a subshell or a `bash -c` / `eval` line. With MULTI_AGENT_UNATTENDED=1 in the hook's environment it also applies the unattended policy: no push, PR or tracker write, no Keychain read, no fetch outside the host allowlist (curl, WebFetch, the toolkit's web tools, agent_run_steps and open_url), no package install, and no write into a protected path (features/unattended-security.md); (3) check-read-size.sh on Read|Bash, which inspects Read plus the shell commands that read a file whole (cat/head/tail/sed), returns immediately for everything else, and routes an oversized read to a cheap worker instead of the caller's own rung; it is inert until `prefs.global.bulkRead.mode` is set to observe or enforce. Failure behaviour: pre-commit-check.sh and check-read-size.sh fail open on an internal error. agent-guard.sh fails open when attended, so a guard bug cannot break a legitimate tool call, and fails closed under MULTI_AGENT_UNATTENDED=1, where nobody is there to notice a gap. None of the three executes the inspected command, and none needs run-specific arguments. The other deterministic gates (evidence, consensus, intent, learnings) take run-specific arguments and are phase-enforced by the pipeline instead. Three capture hooks ship alongside them and block nothing: (4) SessionEnd runs capture-flush.sh --if-stale, which writes a run's triage findings and durable learnings into the per-repo stores when the run ended before Phase 5, where those writes otherwise happen; the same hook runs note-session.sh, which records the mechanical shape of a session outside the pipeline (tools used, commands that failed, calls the user refused). (4b) SubagentStop and PostToolUseFailure run note-agent-event.sh, which appends one row to the same session notes as the event happens: a subagent's type, id, the bound run's task id and its last message cut to 200 characters (secret-scanned; a hit stores the row without the message), or a failed tool's name and its command's first program word, never an argument or error text. (5) PreCompact runs capture-flush.sh without --if-stale: a compaction summarizes the conversation mid-phase, so it is the moment unflushed findings are at risk, and both writes are idempotent, so a finished run costs two no-op writes. The staleness test exists only so a session exit does not re-flush a run that already finished. (6) SessionStart runs capture-resume.sh, which prints at most two lines: an unfinished run and how to resume it, and a stale pipeline-observation queue. (6b) session-brief.sh runs on the same event and is opt-in: it prints nothing until prefs.global.sessionBrief.enabled is true. Enabled, it prints, from a cache that a detached process rebuilds, a block of at most prefs.global.sessionBrief.maxChars characters (default 2400, about 350 tokens): the repository's learnings ledger as an index of pointers (inside an <untrusted-data> block, after the secret scan) and one line about its code graph, plus the skill indexes of the enabled toolkits; the working notes are a separate setting, discipline, also off. A repository with no ledger entries and no code graph gets nothing. It starts no node process on a warm cache, is silent in unattended and pipeline contexts and outside a git repository, writes its cache 0600 under ~/.claude/memory/multi-agent/_session-brief/, and exits 0 on every path. No capture hook calls a model or reads a payload - note-session.sh keeps a command's first word and an exit code, never an argument or any output - and all exit 0 on every path, because a hook that fails a session over bookkeeping costs more than the bookkeeping. A GitHub write gate ships too: (2a) pr-write-guard.sh on Bash answers `ask`, naming the PR and the operation, when the command runs `pr-threads.mjs apply` (directly, through a variable, inside `bash -c`, after `env` or as `node <path>`), so /multi-agent:address-review cannot reply, resolve or push without the person approving that one write at the host; with MULTI_AGENT_UNATTENDED=1 it answers `deny`. Every other Bash call gets no output, and it exits 0 on every path. A run-scoped PreToolUse gate ships too: (2b) run-scope-guard.sh on every Figma MCP tool (mcp__.*[Ff]igma.*) denies a Figma call above phases.json thresholds.mcpAllowedThroughPhase for the run bound to the session, unless the run is in analysis mode, and records each allowed call into telemetry.mcpCalls[]; on Edit|Write|NotebookEdit the same script warns, attended only, when the target is outside the bound run's worktree (additionalContext for the model, systemMessage for the user; the call proceeds). On Agent|Task, with prefs.global.costBudget.enabled true, it asks before a subagent starts while the bound run's estimated spend is over the ceiling (denies with onExceed halt) and adds a note for the model from the warn threshold. On Bash|WebFetch|AskUserQuestion it denies a question from a bound autopilot run, a Figma read over HTTP (figma.com or api.figma.com) under the same phase rule, and, in any session, a direct write to agent-state.json or tracker-state.json (Edit/Write, a shell redirect or tee), since write-state.mjs is their only writer; the shell wrapper starts node only when the payload mentions Figma or a state file. Outside a run it is silent, and it fails open. One PostToolUse hook ships as well and blocks nothing: (7) edit-syntax-gate.sh on Edit|Write|MultiEdit parses the file the edit just wrote (swiftc -parse, node --check, py_compile into a temp dir, JSON.parse, bash -n; Kotlin skipped) under a 2 s deadline and, when it no longer parses, hands the model the error as PostToolUse additionalContext; it exits 0 on every path, stays silent when a parser is missing or slow, and is inert until `prefs.global.editSyntaxGate.enabled` is true. A second PostToolUse hook blocks nothing either: (7b) task-mirror.sh on TaskCreate|TaskUpdate mirrors the native task list into the tracker of the run bound to the session (phase-tracker.sh task, tracker-contract.md, \"Mirroring the host's task list\"), skipping phase tiles, so the office panel shows the same list; silent outside a run, exit 0 on every path. A third blocks nothing: (7c) file-context.sh on Read (PostToolUse, and PreToolUse on Read|Grep|Glob) hands the model, once per file per session, what the repo's memory says about the file it reads or searches (ledger facts whose scope covers it, its latest review findings, its open known limits from debt-ledger.mjs) as additionalContext inside an <untrusted-data> block, after the secret scan and fitted to the host's 10,000-character hook output limit; a Grep with a path, or a Glob whose literal directory is inside the repo, is mapped to at most five files the stores know, and a whole-repo search gets nothing; inside a run bound to the session by default, everywhere with prefs.global.fileContext.enabled true, never with it false; exit 0 on every path. A fourth blocks nothing: (7d) answer-check.sh on AskUserQuestion names, as PostToolUse additionalContext, every question the user submitted without a choice, so an empty answer is asked again instead of resolved to the Recommended option; it runs in every session, since it only adds context, and exits 0 on every path. A fifth blocks nothing: (7e) graph-hint.sh on Grep|Glob (PreToolUse) adds, once per session, one line pointing at `/multi-agent:graph ask` and mcp__multi-agent__graph_query when the call searches the whole repo for a bare identifier and a current code graph (graphFreshness: build commit is HEAD, no indexed file changed) exists for the repo; silent with prefs.global.codeGraph.enabled false; exit 0 on every path. A sixth blocks nothing: (7f) note-skill-use.sh on Skill (PostToolUse and PostToolUseFailure) appends one row to the local <log root>/skill-usage.jsonl: the skill name (kept only when it matches a strict charset and length and carries no credential pattern, else the call is dropped), ok or error, the time, the host and the repo folder name (null outside a git repository and for a repository in prefs.global.memory.excludeProjects), never the arguments, the prompt or any output; past 1 MiB the log moves to skill-usage.jsonl.1; off with prefs.global.skillUsage.enabled false or prefs.global.usageLog.optOut true; it reads stdin for at most 1.5 s and exits 0 on every path. skill-usage.mjs summary and prune-candidates read it. A seventh blocks nothing: (7g) note-mcp-failure.sh on mcp__.* (PostToolUseFailure) appends one row to the local <log root>/mcp-failures.jsonl: the server and tool from the tool name (dropped unless both match a strict charset and length and carry no credential pattern), the time and a closed error class (the host's interrupt flag first, then a refusal by the user or the permission layer, then a JSON-RPC code in the error text, then a message opening with invalid or validation, then an HTTP status, then fixed patterns), never the arguments, the output or the error text itself; it probes nothing, is written by the same code as the skill-usage log, so it has the same 1 MiB cap and .1 generation, rotates under its own mcp-failures.jsonl.lock, never follows a symlink at the log path, is off with prefs.global.mcpFailures.enabled false or prefs.global.usageLog.optOut true, and exits 0 on every path; doctor's mcp-failures check reads it. note-mcp-call.sh is registered on PostToolUse for mcp__.* with \"async\": true (the host's hook schema defines `async`: if true, the hook runs in the background without blocking) and counts the calls that succeeded for the usage record: it starts no node process, reads the first 8 KiB of the payload, and does nothing unless the marker file <log root>/mcp-counting-on exists and is newer than the preferences file (the marker is written by the usage report and the failure hook, with a real parser, only while prefs.global.usageLog.enabled is true and neither usageLog.optOut nor mcpFailures.enabled false is set); it appends one line, the session id and the tool name, to <log root>/mcp-calls.log, which the next usage report folds into <log root>/mcp-calls.json (counts per host session, owner-only, at most 200 names per session and 20 sessions), under the same two off switches. note-command-use.sh is registered on UserPromptSubmit with \"async\": true and counts which /multi-agent commands are typed: it starts no node process, reads the first 8 KiB of the payload, looks only at a prompt whose first token is /multi-agent:<name> (or /multi-agent <name> for a shipped command), appends the shipped command name or the constant other to <log root>/cmd-calls.log, and stores no argument, text or length; it does nothing unless the marker file <log root>/cmd-counting-on exists and is newer than the preferences file (written only while prefs.global.usageLog.enabled is true and usageLog.optOut is not). One Stop hook ships as well: (8) run-stop-guard.sh answers {\"decision\":\"block\"} when the session driving an active pipeline run (bound through agent-state.json sessionId or hostSessionId, never by a worktree match) tries to stop while the run is in_progress below its mode's last phase with no haltReason or waitingFor; the reason says to finish the current phase, record the wait, or record a halt. A turn that ends on a question to the user, a session with background tasks or crons, and prefs.global.stopGuard.enabled false are never held, and run-stop-guard.sh is not registered on SubagentStop: a subagent's stop is the dispatching session's business. After three consecutive blocks it records the halt itself (status paused, haltReason <phase>:stop-guard), which write-state clears when the run advances a phase. It never blocks outside a run and fails open, with a line in <log root>/hook-failures.log, on any error. These registrations are Claude Code's; README \"Hooks per host\" lists which have no equivalent elsewhere. On Codex only the syntax gate is offered, from codex-hooks.json through host-hooks.mjs; Copilot CLI gets none, since as of 1.0.45 it discards postToolUse output; the other gates are Claude Code only. multi-agent:setup offers to merge this block.",
3
3
  "hooks": {
4
4
  "PreToolUse": [
5
5
  {
@@ -180,6 +180,31 @@
180
180
  "statusMessage": "Counting the skill call..."
181
181
  }
182
182
  ]
183
+ },
184
+ {
185
+ "matcher": "mcp__.*",
186
+ "hooks": [
187
+ {
188
+ "type": "command",
189
+ "command": "bash \"$HOME/.claude/scripts/note-mcp-call.sh\"",
190
+ "async": true,
191
+ "timeout": 5,
192
+ "statusMessage": "Counting the MCP call..."
193
+ }
194
+ ]
195
+ }
196
+ ],
197
+ "UserPromptSubmit": [
198
+ {
199
+ "hooks": [
200
+ {
201
+ "type": "command",
202
+ "command": "bash \"$HOME/.claude/scripts/note-command-use.sh\"",
203
+ "async": true,
204
+ "timeout": 5,
205
+ "statusMessage": "Counting the command..."
206
+ }
207
+ ]
183
208
  }
184
209
  ],
185
210
  "PostToolUseFailure": [
@@ -255,6 +280,12 @@
255
280
  "command": "bash \"$HOME/.claude/scripts/capture-resume.sh\"",
256
281
  "timeout": 10,
257
282
  "statusMessage": "Checking for unfinished runs..."
283
+ },
284
+ {
285
+ "type": "command",
286
+ "command": "bash \"$HOME/.claude/scripts/session-brief.sh\"",
287
+ "timeout": 5,
288
+ "statusMessage": "Loading the session brief..."
258
289
  }
259
290
  ]
260
291
  }