Skip to content

diff: the command.run hook names its command by a literal the engine's scan reads - #96570

Merged
poteat merged 1 commit into
mainfrom
poteat/diff-literal-command-name
Sep 24, 2026
Merged

poteat merged 1 commit into
mainfrom
poteat/diff-literal-command-name

Conversation

@poteat

@poteat poteat commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

The mod's command.run hook matched its own command through a named constant ({ command: Names.COMMAND_NAME }). The engine's scan of a hooks module reads literal command names in command.run matchers, and uses them to decide which slash commands typed right at startup must wait for a module that is still loading. A constant it cannot read counts as "may hook any command", so while the diff mod was loading every early listed command (/help, /exit, ...) waited for it.

The matcher now spells the literal, { command: 'diff' }, the way the mod's clear/resume hook already does. Behaviour is unchanged (the constant's value is 'diff'); claude plugin validate mods/diff now reports command.run{command=diff}.

Checked:

  • claude plugin validate mods/diff passes and lists the hook as command.run{command=diff}.
  • With an engine that holds early commands by name, an early /help typed while a mod with a 3 s start loads opens in 4.5 to 4.9 s with this line and 8.2 s without it.

@poteat
poteat merged commit 384e28e into main Sep 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants