modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -272,6 +272,16 @@ * **The VS Code extension is older than 2.1.299** : the chat panel draws for mods from [extension version](</docs/en/vs-code#install-the-extension>) 2.1.299. Check the version in VS Code’s Extensions view and update the extension there. * **The extension is older than 2.1.304 and the session doesn’t fetch feature flags** : update the extension, or run `claude` in VS Code’s integrated terminal instead. Sessions on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry skip the fetch. For the others that skip it, such as a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, see [Features that need feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>). +## An audio clip doesn’t play + +If [`$.audio.play`](</docs/en/plugins/mods/reference#look-up>) is silent in a [cloud session](</docs/en/claude-code-on-the-web>) in the Desktop app’s Code tab, check whether sound is off, whether the window has focus, and whether the call rejects: + + * **Sound is off** : once the app receives a clip, a speaker button appears in the session’s title bar. If the button is crossed out, select it to turn on sound, then trigger the clip again. + * **The window doesn’t have focus, or a permission prompt or question is waiting** : a clip that starts then is skipped unless it loops. Click in the window or respond, then trigger the clip again. + * **The call rejects** : catch the error and pass `error.message` to [`$.ui.log`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>), then fix the cause it names. If the message includes `the app that shows this session can't play the clip`, convert the clip to a PCM WAV file of at most 1 MiB. + +If the clip stays silent after these checks, or the speaker button is missing, follow Find out why a mod does nothing. + ## An edit or a value is lost The mod runs, and a change you made or a value it kept isn’t there.
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -156,7 +156,7 @@ ### `$.agent.register refused: the hooks module that made the call is no longer loaded` -The line starts with your mod’s name, as in `first-mod: $.agent.register refused: the hooks module that made the call is no longer loaded (it was reloaded or removed)`, and the agent isn’t registered. Your mod was reloaded or unloaded before the call. A reload loads a fresh copy of the hooks module, and this call came from code still running in the old copy, such as a hook that hadn’t returned yet. If that hook doesn’t catch the rejection, it fails and Claude Code skips it. To register the agent from the copy that stays loaded, make the call in your [`session.start`](</docs/en/plugins/mods/reference#session>) hook, which runs again in each fresh copy after a reload. +The line starts with your mod’s name, as in `first-mod: $.agent.register refused: the hooks module that made the call is no longer loaded (it was reloaded or removed)`, and the agent isn’t registered. Your mod was reloaded or unloaded before the call. A reload loads a fresh copy of the hooks module, and this call came from code still running in the old copy, such as a hook that hadn’t returned yet. If that hook doesn’t catch the rejection, it fails and Claude Code skips it. To register the agent from the copy that stays loaded, make the call in your [`session.start`](</docs/en/plugins/mods/api#add-a-command-or-a-tool>) hook, which runs again in each fresh copy after a reload. ### `mods that run in the hooks worker are off for this session` @@ -168,7 +168,7 @@ ### `a hook changed this call's input after the model wrote it` -In auto mode, a denied tool call gives this reason. A hook changed the tool call’s input after the [server-side classifier](</docs/en/permission-modes#server-side-classifier-review>) reviewed it, so that review doesn’t cover what would run. The hook can be a mod’s [`tool.call`](</docs/en/plugins/mods/reference#tools>) or [`turn.step`](</docs/en/plugins/mods/reference#turns>) hook, or a [`PreToolUse`](</docs/en/hooks#pretooluse>) settings hook. The message doesn’t say which. The message tells Claude to issue the call once more as recorded. If that’s denied too, the hook changes the input every time, so turn off the mod or hook, or leave auto mode and approve the call yourself. +In auto mode, a denied tool call gives this reason. A hook changed the tool call’s input after the [server-side classifier](</docs/en/permission-modes#server-side-classifier-review>) reviewed it, so that review doesn’t cover what would run. The hook can be a mod’s [`tool.call`](</docs/en/plugins/mods/events#guard-or-change-a-tool-call>) or [`turn.step`](</docs/en/plugins/mods/events#follow-a-turn>) hook, or a [`PreToolUse`](</docs/en/hooks#pretooluse>) settings hook. The message doesn’t say which. The message tells Claude to issue the call once more as recorded. If that’s denied too, the hook changes the input every time, so turn off the mod or hook, or leave auto mode and approve the call yourself. In [some interactive terminal sessions and VS Code sessions](</docs/en/hooks#pretooluse-updatedinput-in-auto-mode>), the same denial gives the reason `a hook changed this call's input after auto mode reviewed it`. The repeated call there carries the mod’s first change, and a `tool.call` hook still runs on it, but a further change is dropped. You don’t need to change your mod unless Claude tells you in its reply that [auto mode couldn’t check the call](</docs/en/errors#hook-changed-input-after-review>). @@ -226,7 +226,7 @@ ### A `ui.render` line says `threw while drawn` -The line names the [render site](</docs/en/plugins/mods/reference#render-sites>), then says `threw while drawn:` and the error, as in `first-mod: ui.render (ToolUse) threw while drawn: <error>; the engine drew its own`. Claude Code hit that error while drawing the tree your [`ui.render`](</docs/en/plugins/mods/reference#interface>) hook returned, or while drawing the site from the [`props` your hook passed to `next`](</docs/en/plugins/mods/interface#change-what-claude-code-already-draws>). The ending `the engine drew its own` means the site shows Claude Code’s usual content. Read the error and fix the value in your hook that caused it. Before v2.1.289, this error in a transcript row ended the session with [`Claude Code exited after an unrecoverable interface error`](</docs/en/errors#exited-after-an-unrecoverable-interface-error>). +The line names the [render site](</docs/en/plugins/mods/reference#render-sites>), then says `threw while drawn:` and the error, as in `first-mod: ui.render (ToolUse) threw while drawn: <error>; the engine drew its own`. Claude Code hit that error while drawing the tree your [`ui.render`](</docs/en/plugins/mods/interface#pick-where-to-draw>) hook returned, or while drawing the site from the [`props` your hook passed to `next`](</docs/en/plugins/mods/interface#change-what-claude-code-already-draws>). The ending `the engine drew its own` means the site shows Claude Code’s usual content. Read the error and fix the value in your hook that caused it. Before v2.1.289, this error in a transcript row ended the session with [`Claude Code exited after an unrecoverable interface error`](</docs/en/errors#exited-after-an-unrecoverable-interface-error>). ### `the module failed without a message` @@ -268,7 +268,7 @@ Either that app doesn’t draw the site or element, or the session is one where the VS Code extension draws nothing for mods. The mod’s other hooks still run. Check for these causes: - * **The site or element isn’t drawn in that app** : look up your site in the [render sites](</docs/en/plugins/mods/reference#render-sites>) table and your elements in the [elements](</docs/en/plugins/mods/reference#elements>) table. For an element the app lacks, check `e.surface` in the hook and return a tree the app can draw. + * **The site or element isn’t drawn in that app** : look up your site in the [render sites](</docs/en/plugins/mods/reference#render-sites>) table and your elements in the [elements](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) table. For an element the app lacks, check `e.surface` in the hook and return a tree the app can draw. * **The VS Code extension is older than 2.1.299** : the chat panel draws for mods from [extension version](</docs/en/vs-code#install-the-extension>) 2.1.299. Check the version in VS Code’s Extensions view and update the extension there. * **The extension is older than 2.1.304 and the session doesn’t fetch feature flags** : update the extension, or run `claude` in VS Code’s integrated terminal instead. Sessions on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry skip the fetch. For the others that skip it, such as a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, see [Features that need feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>). @@ -278,7 +278,7 @@ ### Your edits don’t take effect -If your plugin was [copied at install](</docs/en/plugins/loading#in-place-and-copied-plugins>), Claude Code runs that copy. Develop with `--plugin-dir` pointed at your working copy, as in `claude --plugin-dir ./first-mod`, which reloads when you save. +If your plugin was [copied at install](</docs/en/plugins/loading#in-place-and-copied-plugins>), Claude Code runs that copy. Develop with `--plugin-dir` pointed at your working copy, as in `claude --plugin-dir ./first-mod`. ### A value resets when the module reloads
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -2,7 +2,7 @@ ## Find out why a mod does nothing -When a mod does nothing, check what Claude Code reads from the mod’s files, and the line it writes when it skips something. For the first, in your shell run [`claude plugin validate`](</docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod>) with the mod’s directory, as in `claude plugin validate ./first-mod`. It catches a misspelled event, a bad manifest, and a module Claude Code can’t read, without starting a session. When a module doesn’t load, a hook is skipped, or another mod refuses yours, Claude Code writes one line that names your mod. Where you read that line depends on the session: +When a mod does nothing, check what Claude Code reads from the mod’s files, and the line it writes when it skips something. To check the files, in your shell run [`claude plugin validate`](</docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod>) with the mod’s directory, as in `claude plugin validate ./first-mod`. It catches a bad manifest and a module Claude Code can’t read, without starting a session. Claude Code writes one line naming your mod in cases such as a code error that stops it from loading, a skipped hook, or a refusal by another mod. Look for that line in the transcript, the debug log, or stderr, by session type: * **A session that hot-reloads a plugin directory** : a dim line in the transcript. That’s an interactive session you started with `--plugin-dir`, or one where [hot reloading is on](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) for mods Claude wrote. * **Any other interactive session, such as one that runs a mod you installed from a marketplace** : the debug log. To get one, start the session with `claude --debug`. @@ -45,6 +45,7 @@ ---|--- `hooks modules are turned off for installed plugins in this process: the rollout switch served off`| Anthropic has turned installed mods off remotely. `hooks modules are turned off for installed plugins in this process: the rollout switch was saved off by an earlier session`| The session used a value an earlier session saved, which may be out of date. Start Claude Code again to refresh it. +`hooks modules a person installed wait for the rollout switch in this process`| In a [cloud session](</docs/en/claude-code-on-the-web>), your mods are waiting to load, so send another message. If the line includes `could not be read`, or you see `Mods you installed aren't running in this session`, start a new session instead. `disableAllHooks in managed settings`| Your organization turned off hooks from installed plugins `only managed plugins and built-in plugins run`| `allowManagedHooksOnly` is set, or `disableAllHooks` is set in a settings file other than managed settings `installed plugins that are not managed load no hooks module in this mode (--bare)`| You started Claude Code with `--bare` @@ -109,6 +110,15 @@ The line names the mod and the event, then says `hook skipped:` and a reason, as in `first-mod: tool.call hook skipped: threw Error: boom`. A hook threw, exceeded its [time limit](</docs/en/plugins/mods/reference#limits>), or returned a result of the wrong shape. The line appears once for each event and kind of failure until the mod reloads. Fix the error. The debug log has a line for every occurrence. +### `call refused` or `result withheld` + +Either line means Claude Code couldn’t copy a value to or from a hook that checks an action, such as a `tool.call` hook. Match the transcript or debug log line to see whether the action ran: + + * `call refused`: Claude Code refused the action in your hook’s place + * `result withheld`: what the tool did stays done, and Claude reads a note in place of its result + +What Claude gets back can include `could not be given to a hook that checks it` or `a hook that checks this result could not hand back its answer`. If the line includes `could not be given its argument`, your hook didn’t run, so leave it as it is. If it includes `is not plain data: nesting deeper than 28000 levels`, reduce the nesting in the values your hook returns or passes on. + ### `no command.run hook answered it` You run a command your mod added, and the reply names the mod and the command, as in `first-mod registered /tally but no command.run hook answered it`, then tells you to add a hook. Claude Code prints that reply when the command reaches the end of the chain with no answer, which happens in two cases: @@ -224,7 +234,10 @@ ### `$.ui.open` runs and no pane appears -The call didn’t come from something the user did, and the terminal is narrower than [the width that pane needs](</docs/en/plugins/mods/interface#when-a-pane-waits-for-a-wider-terminal>). Open the pane from a command or a button, or check the call’s `isPlaced` result. See [Open a pane at the right time](</docs/en/plugins/mods/interface#open-a-pane-at-the-right-time>). +Check the call’s result. When `isPlaced` is `false`, the start of `reason` says why, as in these cases: + + * **`unasked below`** : open the pane from a command or a button, or use [a wider terminal](</docs/en/plugins/mods/interface#when-a-pane-waits-for-a-wider-terminal>). + * **`no-surface`** : nothing is attached to draw on, as in a `claude -p` or Agent SDK run. From a `command.run` hook, return `{ text }` instead. ### A toast doesn’t appear @@ -265,7 +278,7 @@ ### Your edits don’t take effect -You’re editing a plugin you installed. Claude Code runs the cached copy for the installed version. Develop with `--plugin-dir` pointed at your working copy, as in `claude --plugin-dir ./first-mod`, which reloads when you save. +If your plugin was [copied at install](</docs/en/plugins/loading#in-place-and-copied-plugins>), Claude Code runs that copy. Develop with `--plugin-dir` pointed at your working copy, as in `claude --plugin-dir ./first-mod`, which reloads when you save. ### A value resets when the module reloads @@ -285,10 +298,10 @@ `settings.read bypassed by cc-plugin-sec-default`, on a line that names your mod ahead of it| The [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) skipped your hook. Ask your organization’s administrator to [install the mod as one of the organization’s mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>). `settings.read: the answer for <key> is no value the key can hold`| Claude Code refused the value a hook returned for that key. The hook may be yours or another mod’s. Follow the step for your case. `settings.read: the merge never settles for <key>`| The keys the line names keep the settings sources’ values. Set them in a settings file. -`answered settings.read without next()`, after a mod’s name| Your hook is affected if the named mod [runs before yours](</docs/en/plugins/mods/events#the-order-mods-run-in>). Then your hook didn’t run on that read. [Turn that mod off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>), or if your organization deployed it, ask its administrator to. +`answered settings.read without next()`, after a mod’s name| Your hook is affected if the named mod [runs before yours](</docs/en/plugins/mods/events#the-order-mods-run-in>). Then your hook didn’t run on that read. [Turn that mod off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>), or if you’re in an organization that deployed it, ask your administrator to. `settings.read: refused to the engine`| Your value didn’t apply because Claude Code’s own read was refused. Find what refused it. -If no line explains the key, check the mods that run before yours for a `settings.read` hook that [changes the key](</docs/en/plugins/mods/events#settings-read-example>). Turn that mod off, or ask your organization’s administrator to. If no hook does, set the key in a settings file. +If no line explains the key, check the mods that run before yours for a `settings.read` hook that [changes the key](</docs/en/plugins/mods/events#settings-read-example>). Turn that mod off, or if you’re in an organization that deployed it, ask your administrator to. If no hook does, set the key in a settings file. ### `the answer for <key> is no value the key can hold` @@ -312,7 +325,7 @@ Search your code for the reason in the parentheses: * **Your code has it** : your hook refused the read. Make it return `{ value }` when [`next.origin`](</docs/en/plugins/mods/events#settings-read-origin>) shows Claude Code’s own read. - * **Your code doesn’t have it** : [turn off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>) your other mods one at a time. If your organization deployed a mod, ask its administrator to turn it off. After each: + * **Your code doesn’t have it** : [turn off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>) your other mods one at a time, or if you’re in an organization that deployed one, ask your administrator to. After each: 1. Start the session from your shell with `claude --debug-file ./settings-read-2.log`, followed by the flags it started with. Use a new path each time. 2. Search that file for `refused to the engine`. If the line is there, turn off the next mod. If not, the last mod you turned off refused the read, so keep it off.
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -52,13 +52,15 @@ ### Messages from the built-in guard -Where the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) loads, it can refuse a mod or one of its answers. Some messages name the option your organization’s administrator sets to change the rule. +Where the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) loads, it can refuse a mod or one of its answers or calls. Some messages name the option your organization’s administrator sets to change the rule. Message contains| What it means| Where it appears ---|---|--- `mods are limited to your organization's by policy (allowManagedModsOnly)`| Your organization allows only [its own mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>), so yours was refused| The debug log, and the transcript in a session that hot-reloads a plugin directory -`tried to lift a deny rule in your settings`| Your mod’s [`tool.check`](</docs/en/plugins/mods/reference#tools>) hook approved a call that a `deny` rule refuses. The call stays denied.| The transcript and the debug log, once for each mod in a session. In a `claude -p` run, the debug log. +`tried to lift` or `tried to reword`, such as `tried to lift a deny rule in your settings`| A hook in your mod, such as [`tool.check`](</docs/en/plugins/mods/events#approve-or-refuse-a-tool-call-before-the-user-is-asked>), tried to loosen or reword the decision the message names. That decision stands. Return what `await next(e)` gives you, or a stricter decision.| The transcript and the debug log. In a `claude -p` run, the debug log. `the rules and hooks in your settings could not be checked for this call, so it is refused`| The guard failed while checking a call that a mod approved, so it refused the call| The reason Claude reads for the denied call +`is not for plugins outside policy to change`| Your mod tried to change an environment variable the guard refuses. Remove that `$.env.set` call.| The error `$.env.set` throws +`would be named as a tool of one of the organization's servers`| One cause is a plugin name that matches one of your organization’s MCP server or plugin names. Rename the plugin and update hooks that match the tool’s old [full name](</docs/en/plugins/mods/api#add-a-tool>). If the error stays, ask an administrator whether [`managed-mcp.json`](</docs/en/managed-mcp#deploy-managed-mcp-json>) is readable and valid.| The error `$.tool.register` throws ### `validate` passes and lists no `hooks` line
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -166,7 +166,7 @@ ## A toast appears after a turn is stopped -### `Stopped: type a message to continue; a mod cannot resume work after Stop` +### `stopped · type a message to continue` This toast means that after you stopped the turn, for example with Esc, a mod tried to start work on its own and Claude Code didn’t let it. Nothing needs fixing. After your next message, mods can start work again and [some of that work comes back](</docs/en/plugins/mods/api#work-your-mod-started-before-the-interruption>) on its own. If what you expected from the mod doesn’t come back, ask for it again or run the mod’s command again. If you wrote the mod, see [Calls and background work after the user interrupts a turn](</docs/en/plugins/mods/api#calls-and-background-work-after-the-user-interrupts-a-turn>).
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -66,7 +66,7 @@ ### `hooks module did not load` -The line starts with the mod’s name, then `hooks module did not load:` and a reason, which gives the file and line when the problem is in your code. Claude Code couldn’t load the module, for example because its top-level code threw. Fix the error the reason names. If the reason ends with `; the version loaded before is unloaded`, no version of the mod is running now. Once you fix the error, run [`/reload-plugins`](</docs/en/plugins/cli-reference#reload-plugins>) in the session to load the mod again. If you installed the mod and didn’t write it, ask its author to fix the error. +The line starts with the mod’s name, then `hooks module did not load:` and a reason, which gives the file and line for a syntax error. Claude Code couldn’t load the module, for example because its top-level code threw. Fix the error the reason names. If the reason ends with `; the version loaded before is unloaded`, no version of the mod is running now. Once you fix the error, run [`/reload-plugins`](</docs/en/plugins/cli-reference#reload-plugins>) in the session to load the mod again. If you installed the mod and didn’t write it, ask its author to fix the error. ### `options do not fit plugin.json userConfig`
modified
Show diff (128 lines)
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -5,8 +5,8 @@ When a mod does nothing, check what Claude Code reads from the mod’s files, and the line it writes when it skips something. For the first, in your shell run [`claude plugin validate`](</docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod>) with the mod’s directory, as in `claude plugin validate ./first-mod`. It catches a misspelled event, a bad manifest, and a module Claude Code can’t read, without starting a session. When a module doesn’t load, a hook is skipped, or another mod refuses yours, Claude Code writes one line that names your mod. Where you read that line depends on the session: * **A session that hot-reloads a plugin directory** : a dim line in the transcript. That’s an interactive session you started with `--plugin-dir`, or one where [hot reloading is on](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) for mods Claude wrote. - * **Any other interactive session, such as one that runs a mod you installed from a marketplace** : the debug log only. To get one, start the session with `claude --debug`. - * **A`claude -p` run with `--plugin-dir`**: stderr, in the default text output format. A refusal by another mod goes to the debug log only. + * **Any other interactive session, such as one that runs a mod you installed from a marketplace** : the debug log. To get one, start the session with `claude --debug`. + * **A`claude -p` run with `--plugin-dir`**: stderr, in the default text output format. A refusal by another mod goes to the debug log. ## Check whether mods can load @@ -52,13 +52,13 @@ ### Messages from the built-in guard -Where the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) loads, it can refuse a mod or one of its answers. Each message names the option your organization’s administrator sets to change the rule. +Where the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) loads, it can refuse a mod or one of its answers. Some messages name the option your organization’s administrator sets to change the rule. Message contains| What it means| Where it appears ---|---|--- `mods are limited to your organization's by policy (allowManagedModsOnly)`| Your organization allows only [its own mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>), so yours was refused| The debug log, and the transcript in a session that hot-reloads a plugin directory -`tried to lift a deny rule in your settings`| Your mod’s [`tool.check`](</docs/en/plugins/mods/reference#tools>) hook approved a call that a `deny` rule refuses. The call stays denied.| The transcript and the debug log, once for each mod in a session. In a `claude -p` run, the debug log only. -`the deny rules in your settings could not be checked for this call, so it is refused`| The guard failed while checking a call that a mod approved, so it refused the call| The reason Claude reads for the denied call +`tried to lift a deny rule in your settings`| Your mod’s [`tool.check`](</docs/en/plugins/mods/reference#tools>) hook approved a call that a `deny` rule refuses. The call stays denied.| The transcript and the debug log, once for each mod in a session. In a `claude -p` run, the debug log. +`the rules and hooks in your settings could not be checked for this call, so it is refused`| The guard failed while checking a call that a mod approved, so it refused the call| The reason Claude reads for the denied call ### `validate` passes and lists no `hooks` line @@ -103,8 +103,6 @@ ## A hook is skipped or a mod is unloaded -The mod loaded, and then Claude Code skipped one of its hooks or unloaded it. - ### `hook skipped` The line names the mod and the event, then says `hook skipped:` and a reason, as in `first-mod: tool.call hook skipped: threw Error: boom`. A hook threw, exceeded its [time limit](</docs/en/plugins/mods/reference#limits>), or returned a result of the wrong shape. The line appears once for each event and kind of failure until the mod reloads. Fix the error. The debug log has a line for every occurrence. @@ -135,6 +133,15 @@ Claude doesn’t see this line, so paste it into your next message when you ask Claude for a fix. +### `reload failed` + +Match the line to find out whether your mod’s last working version is still loaded: + + * `reload failed, the previous version stays loaded: <reason>`: your mod keeps running its last working version. If your change still fails to load the next time Claude Code reloads all plugins, such as when you run `/reload-plugins`, the last working version unloads. + * `reload failed: <reason>`: run `/plugin` at the Claude Code prompt, and widen the terminal if the [`mods active` line](</docs/en/plugins/mods/overview#see-which-mods-a-session-loaded>) cuts off names. If it names the mod, its last working version is still loaded. If it doesn’t, or there’s no such line, no version is. + +Fix what the reason names and save your change. A `reloaded` line shows that it loaded. + ### `$.agent.register refused: the hooks module that made the call is no longer loaded` The line starts with your mod’s name, as in `first-mod: $.agent.register refused: the hooks module that made the call is no longer loaded (it was reloaded or removed)`, and the agent isn’t registered. Your mod was reloaded or unloaded before the call. A reload loads a fresh copy of the hooks module, and this call came from code still running in the old copy, such as a hook that hadn’t returned yet. If that hook doesn’t catch the rejection, it fails and Claude Code skips it. To register the agent from the copy that stays loaded, make the call in your [`session.start`](</docs/en/plugins/mods/reference#session>) hook, which runs again in each fresh copy after a reload. @@ -155,7 +162,7 @@ ### A message about the deny rules in your settings -`tried to lift a deny rule in your settings` and `the deny rules in your settings could not be checked for this call, so it is refused` both come from the built-in guard. Look them up in Messages from the built-in guard. +`tried to lift a deny rule in your settings` and `the rules and hooks in your settings could not be checked for this call, so it is refused` both come from the built-in guard. Look them up in Messages from the built-in guard. ## A toast appears after a turn is stopped @@ -169,13 +176,17 @@ ### Another mod’s band shows and yours doesn’t -There is one band above the prompt, and every mod shares it. A mod that runs [before yours](</docs/en/plugins/mods/events#the-order-mods-run-in>) replaces your band when it returns a tree without the result of `next(e)` in it. To show both bands, change that mod’s hook, or ask its author to: - - * **Keep the bands after it** : put the result of `await next(e)` among the children of a `Box` in its tree, as in the Band above the prompt tab of [Pick where to draw](</docs/en/plugins/mods/interface#pick-where-to-draw>) +Each mod that draws above the prompt gets its own row, so when yours is missing while another’s shows, check for these causes: + + * **Your tree doesn’t validate** : write a debug log, search it for `ui.render hook skipped` or `does not validate`, and fix what the line names. + * **The rows together exceed a limit** : write a debug log and search it for `past the limits of the band`. The rows [share one tree’s limits](</docs/en/plugins/mods/reference#limits>), so draw a smaller tree, or ask the other mods’ authors to. + * **Another mod hides or draws over your row** : if the log has none of these lines, [turn off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>) the other mods one at a time. If your row comes back, ask that mod’s author to change it. + +Before v2.1.323, all mods shared one drawing in the band. A mod that ran [before yours](</docs/en/plugins/mods/events#the-order-mods-run-in>) replaced your drawing when it returned a tree without the result of `next(e)` in it. Update Claude Code, or ask that mod’s author to make these changes: + + * **Keep later mods’ drawings** : put the result of `await next(e)` among the children of a `Box` in its tree * **Keep the tree valid** : don’t give that `Box`, or any `Box` around it, a `width`, `height`, `minWidth`, `minHeight`, `position`, `top`, `left`, `right`, `bottom`, `display`, or `overflow` prop -To find that mod, write a debug log and search it for `answered ui.render without next()`. A line such as `other-mod (user) answered ui.render without next()` names a mod that returned its tree without calling `next(e)`. It doesn’t name the [render site](</docs/en/plugins/mods/reference#render-sites>), so a pane-only mod can appear too. A mod that calls `next(e)` and drops the result gets no line, so check the hooks before yours too. A mod’s band is also missing when the tree its own hook returned doesn’t validate, and the other mods’ bands stay. To find which mod and why, write a debug log and search it for `ui.render hook skipped`. - ### A pane or band is empty or shows Claude Code’s usual content The [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) your hook returned didn’t validate. A `hook skipped` line in the transcript or the debug log names your mod and the reason, as in this one for a `Box` in a pane: @@ -186,11 +197,11 @@ ### A `ui.render` line says `refused` -`ui.render (<site>) refused:`, or `ui.render (<site>): the chain settled on a tree that does not validate` in the debug log, means the [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) at that site exceeds a [size limit](</docs/en/plugins/mods/reference#limits>). Either line names the [render site](</docs/en/plugins/mods/reference#render-sites>) and then the reason, and the reason names the limit. Change the mods that draw at that site so their [`ui.render`](</docs/en/plugins/mods/reference#interface>) hooks return smaller trees, or ask their authors to. If the transcript line starts with `hooks`, more than one loaded mod has a `ui.render` hook for that site, so check each of those mods’ trees. For several mods whose bands above the prompt nest into a tree more than 32 levels deep, the line reads: - - hooks: ui.render (AbovePrompt) refused: deeper than 32; nothing was drawn - -Before v2.1.307, a `refused:` line for any site reported any tree that didn’t validate, and for `Pane` and `AbovePrompt` it ended `; the engine drew its own`. On those releases, fix what the reason names. +`ui.render (<site>) refused:`, or `ui.render (<site>): the chain settled on a tree that does not validate` in the debug log, means the [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) at that site exceeds a [size limit](</docs/en/plugins/mods/reference#limits>). Either line names the [render site](</docs/en/plugins/mods/reference#render-sites>) and then the reason. Change the mods that draw at that site so their [`ui.render`](</docs/en/plugins/mods/reference#interface>) hooks return smaller trees, or ask their authors to. If the transcript line starts with `hooks`, more than one loaded mod has a `ui.render` hook for that site, so check each of those mods’ trees. For rows above the prompt that don’t fit the band’s limits together, the line reads: + + hooks: ui.render (AbovePrompt) refused: a row past the limits of the band; nothing was drawn + +Despite that ending, the rows that fit still draw. Before v2.1.307, a `refused:` line for any site reported any tree that didn’t validate, and for `Pane` and `AbovePrompt` it ended `; the engine drew its own`. On those releases, fix what the reason names. ### `needs a key`, `is drawn twice`, or `key each once` @@ -231,11 +242,12 @@ ### Hotkeys do nothing -Your pane or band doesn’t have keyboard focus, your button is in a collapsed band, or the drawing is in the VS Code extension, where buttons have no hotkeys. Do the one that matches: +Your pane or band doesn’t have keyboard focus, your button is in a collapsed band, another mod uses the same key, or the drawing is in the VS Code extension. * **No keyboard focus** : press Ctrl+X then Tab or, in [fullscreen rendering](</docs/en/fullscreen>), click the pane or band. To have the pane take focus when it opens, open it with `focus: true` from a command. * **The button is in a collapsed band** : the band shows one dim row that starts with `▸ plugin panel hidden`. Press the keys the row names, Ctrl+X then Ctrl+A by default, to expand it. - * **In the VS Code extension** : click the button, or press Enter on it once it has focus + * **Another mod’s row in the band uses the same hotkey** : in the terminal, the key presses neither button. To check, [turn off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>) the other mods that draw rows, one at a time, until the key works. Change your button’s `hotkey`, or ask that mod’s author to change theirs. + * **In the VS Code extension, where buttons have no hotkeys** : click the button, or press Enter on it once it has focus ### A drawing works in the terminal and not in the Desktop app or VS Code @@ -318,7 +330,7 @@ hooks module first-mod@inline loaded (worker, environment 2, tier user); events: session.start,tool.call,command.run,ui.render -To write your own lines in the log, call [`$.ui.log`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>) with a second argument, as in `$.ui.log('message', { to: 'debug' })`. Without the second argument, `$.ui.log` adds a dim line to the transcript. While you edit a mod loaded with `--plugin-dir`, the transcript shows a line for each reload that names the mod and lists its hooks. If a save breaks the module, the line says `reload failed, the previous version stays loaded:` with the reason, and the last working version keeps running until Claude Code next reloads plugins, such as when you run `/reload-plugins`. +To write your own lines in the log, call [`$.ui.log`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>) with a second argument, as in `$.ui.log('message', { to: 'debug' })`. Without the second argument, `$.ui.log` adds a dim line to the transcript. ## Next steps
modified
Show diff (537 lines)
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -1,10 +1,6 @@ When a mod’s module or one of its hooks fails, Claude Code skips it and the session continues, so a broken mod can look like one that does nothing. Start by checking what Claude Code read from your mod and where it reports a problem, then find the symptom or message you have. -## - -​ - -Find out why a mod does nothing +## Find out why a mod does nothing When a mod does nothing, check what Claude Code reads from the mod’s files, and the line it writes when it skips something. For the first, in your shell run [`claude plugin validate`](</docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod>) with the mod’s directory, as in `claude plugin validate ./first-mod`. It catches a misspelled event, a bad manifest, and a module Claude Code can’t read, without starting a session. When a module doesn’t load, a hook is skipped, or another mod refuses yours, Claude Code writes one line that names your mod. Where you read that line depends on the session: @@ -12,11 +8,7 @@ * **Any other interactive session, such as one that runs a mod you installed from a marketplace** : the debug log only. To get one, start the session with `claude --debug`. * **A`claude -p` run with `--plugin-dir`**: stderr, in the default text output format. A refusal by another mod goes to the debug log only. -## - -​ - -Check whether mods can load +## Check whether mods can load To check whether your setup lets mods load at all, without installing one, run `claude plugin test` in your shell, from a directory that doesn’t hold a mod. You don’t need a session. The message it prints tells you the state: @@ -29,43 +21,23 @@ An organization can also set `allowManagedModsOnly` to allow only its own mods, which this command doesn’t report. In that case Claude Code refuses a mod you install, and [a message says why](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>). -## - -​ - -The mod doesn’t load +## The mod doesn’t load Nothing the mod adds appears: no command, no drawing, and no change in behavior. -### - -​ - -Your version is too old +### Your version is too old See [which version to use and how to check yours](</docs/en/plugins/mods/overview#turn-mods-on-or-off>). -### - -​ - -The `mods active` line doesn’t name the mod +### The `mods active` line doesn’t name the mod Nothing the mod adds appears, and the [`mods active` line](</docs/en/plugins/mods/overview#see-which-mods-a-session-loaded>) in `/plugin` doesn’t name it. The hooks module didn’t load. When Claude Code refused it, the debug log has a line that starts with `hooks module`, the mod’s name, and `not loaded:`, as in `hooks module first-mod@inline not loaded: disableAllHooks in managed settings` for a mod loaded with `--plugin-dir`. Read the reason after the colon. The refusal messages section lists each one. If the log has no such line, work through the other entries in this group. Some settings stop a mod and leave the rest of its plugin working. [Turn mods on or off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>) names them. -### - -​ - -A `claude -p` run prints `hooks module not loaded` +### A `claude -p` run prints `hooks module not loaded` The line starts with the mod’s name and goes to stderr. The hooks module was refused. A non-interactive run has no transcript, so the message goes to stderr. Read the reason after the colon. The refusal messages section lists each one. -### - -​ - -Refusal messages +### Refusal messages Each of these follows `hooks module`, the mod’s name, and `not loaded:` in the debug log. @@ -78,11 +50,7 @@ `installed plugins that are not managed load no hooks module in this mode (--bare)`| You started Claude Code with `--bare` `another plugin of that name loads first`| Another enabled plugin has the same name as your mod and [holds the name](</docs/en/plugins/loading#hooks-when-two-enabled-plugins-share-a-name>), so your hooks module doesn’t load -### - -​ - -Messages from the built-in guard +### Messages from the built-in guard Where the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) loads, it can refuse a mod or one of its answers. Each message names the option your organization’s administrator sets to change the rule. @@ -92,51 +60,27 @@ `tried to lift a deny rule in your settings`| Your mod’s [`tool.check`](</docs/en/plugins/mods/reference#tools>) hook approved a call that a `deny` rule refuses. The call stays denied.| The transcript and the debug log, once for each mod in a session. In a `claude -p` run, the debug log only. `the deny rules in your settings could not be checked for this call, so it is refused`| The guard failed while checking a call that a mod approved, so it refused the call| The reason Claude reads for the denied call -### - -​ - -`validate` passes and lists no `hooks` line +### `validate` passes and lists no `hooks` line `hooks/hooks.json` has no `modules` key, or the key is misspelled. Add `"modules": ["./register.js"]`. -### - -​ - -`hooks module did not load` +### `hooks module did not load` The line starts with the mod’s name, then `hooks module did not load:` and a reason, which gives the file and line when the problem is in your code. Claude Code couldn’t load the module, for example because its top-level code threw. Fix the error the reason names. If the reason ends with `; the version loaded before is unloaded`, no version of the mod is running now. Once you fix the error, run [`/reload-plugins`](</docs/en/plugins/cli-reference#reload-plugins>) in the session to load the mod again. If you installed the mod and didn’t write it, ask its author to fix the error. -### - -​ - -`options do not fit plugin.json userConfig` +### `options do not fit plugin.json userConfig` The line starts with the mod’s name, then `hooks module did not load: options do not fit plugin.json userConfig:` and a reason. An option fails validation against its [`userConfig`](</docs/en/plugins/components#user-configuration>) field, such as a number above the field’s `max`, or a required field has no value. Set or change the value. The end of the line names its `pluginConfigs` entry in `settings.json`. -### - -​ - -`code nested too deep to scan: more than 2000 scopes` +### `code nested too deep to scan: more than 2000 scopes` The line starts with the mod’s name, then `hooks module did not load:`, the file, and `code nested too deep to scan: more than 2000 scopes`. A file in a hooks module can’t nest scopes, such as functions, blocks, and loops, more than [2,000 deep](</docs/en/plugins/mods/reference#limits>). [`claude plugin validate`](</docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod>) reports the same reason. Rewrite the code so its scopes nest less deeply. -### - -​ - -`the engine ran out of stack linking the file and its imports` +### `the engine ran out of stack linking the file and its imports` Code in the hooks module is nested too deeply, or its chain of imports is too long, for Claude Code to load it. The line starts with the mod’s name and `hooks module did not load:`, then gives a file’s name and this reason. In that file and the files its imports reach, find the most deeply nested code and rewrite it to nest less, or shorten the chain of imports. If you didn’t write the mod, ask its author to fix it. -### - -​ - -`the parser stopped` or `the engine ran out of stack loading the file` +### `the parser stopped` or `the engine ran out of stack loading the file` Code in one file of the hooks module is nested so deeply that Claude Code ran out of stack reading it. The line starts with the mod’s name and `hooks module did not load:`, then gives that file’s name and one of these reasons: @@ -145,51 +89,27 @@ The reason gives no line number and doesn’t say what kind of code is nested, so look through the file yourself for its most deeply nested part. Rewrite that part to nest less. If you installed the mod and didn’t write it, ask its author to. -### - -​ - -No mod loads in a directory you opened for the first time +### No mod loads in a directory you opened for the first time You haven’t answered the trust prompt for the directory. Start an interactive session in that directory with `claude`, and accept the trust prompt it opens with. -### - -​ - -No installed plugin loads at all +### No installed plugin loads at all You started Claude Code with `--safe-mode`. Start without the flag. -### - -​ - -Claude Code stops asking to enable hot reloading +### Claude Code stops asking to enable hot reloading Claude writes a mod in an interactive session, nothing loads, and Claude Code doesn’t ask again [whether to enable hot reloading](</docs/en/plugins/mods/create#ask-claude-for-a-mod>). If the question ends three times without an answer picked, hot reloading stays off. For example, the question ends that way when you set [`askUserQuestionTimeout`](</docs/en/settings-reference#askuserquestiontimeout>) and the time passes before you answer. That setting applies here because Claude Code asks in the same [question dialog that `AskUserQuestion` uses](</docs/en/tools-reference#question-auto-continue-timeout>). A question you dismiss yourself doesn’t count toward the three. To run the mod, [copy its directory out of the mods folder](</docs/en/plugins/mods/create#use-the-mod-in-other-sessions>), then in your shell start a new session with `--plugin-dir`, as in `claude --plugin-dir ~/mods/git-branch`. -## - -​ - -A hook is skipped or a mod is unloaded +## A hook is skipped or a mod is unloaded The mod loaded, and then Claude Code skipped one of its hooks or unloaded it. -### - -​ - -`hook skipped` +### `hook skipped` The line names the mod and the event, then says `hook skipped:` and a reason, as in `first-mod: tool.call hook skipped: threw Error: boom`. A hook threw, exceeded its [time limit](</docs/en/plugins/mods/reference#limits>), or returned a result of the wrong shape. The line appears once for each event and kind of failure until the mod reloads. Fix the error. The debug log has a line for every occurrence. -### - -​ - -`no command.run hook answered it` +### `no command.run hook answered it` You run a command your mod added, and the reply names the mod and the command, as in `first-mod registered /tally but no command.run hook answered it`, then tells you to add a hook. Claude Code prints that reply when the command reaches the end of the chain with no answer, which happens in two cases: @@ -198,27 +118,15 @@ If the module already has the hook the reply describes, look for a `hook skipped` line that names `command.run`, which gives the reason. A [test](</docs/en/plugins/mods/test>) that runs the command fails with the same reason. -### - -​ - -`it crashed the hooks worker` +### `it crashed the hooks worker` The line starts with the mod’s name, as in `first-mod was unloaded: it crashed the hooks worker`. Installed mods share one worker thread. The worker stopped responding or crashed, and Claude Code traced that to this mod and unloaded it. A hook that blocks the thread, such as a loop that never awaits, is one cause. Fix the hook. -### - -​ - -`its session.start ran again in a fresh copy` +### `its session.start ran again in a fresh copy` The line starts with the mod’s name and names a `$.prompt.submit`, `$.command.run`, or `$.agent.spawn` call, as in `first-mod: its session.start ran again in a fresh copy; the $.prompt.submit call it had already made was not made again`. Claude Code loaded the mod’s module again, for example after the hooks worker crashed and was replaced, and the fresh copy’s [`session.start`](</docs/en/plugins/mods/reference#session>) hook ran. The call the line names resolved with the result of its first run instead of running again, so your mod doesn’t submit the prompt, run the command, or start the subagent twice. The rest of the hook ran as usual. There’s nothing to fix. Before v2.1.292, the call ran a second time, so the prompt was submitted, the command run, or the subagent started twice. -### - -​ - -`This mod's change didn't load` or `the earlier version is no longer running` +### `This mod's change didn't load` or `the earlier version is no longer running` A change to a [mod Claude wrote in this session](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) couldn’t load. The transcript line starts with the mod’s name and ends with the reason: @@ -227,75 +135,39 @@ Claude doesn’t see this line, so paste it into your next message when you ask Claude for a fix. -### - -​ - -`$.agent.register refused: the hooks module that made the call is no longer loaded` +### `$.agent.register refused: the hooks module that made the call is no longer loaded` The line starts with your mod’s name, as in `first-mod: $.agent.register refused: the hooks module that made the call is no longer loaded (it was reloaded or removed)`, and the agent isn’t registered. Your mod was reloaded or unloaded before the call. A reload loads a fresh copy of the hooks module, and this call came from code still running in the old copy, such as a hook that hadn’t returned yet. If that hook doesn’t catch the rejection, it fails and Claude Code skips it. To register the agent from the copy that stays loaded, make the call in your [`session.start`](</docs/en/plugins/mods/reference#session>) hook, which runs again in each fresh copy after a reload. -### - -​ - -`mods that run in the hooks worker are off for this session` +### `mods that run in the hooks worker are off for this session` The line reads `hooks: mods that run in the hooks worker are off for this session: it crashed 3 times`. The worker stopped three times and Claude Code couldn’t trace the stops to one mod, so it unloaded every mod that isn’t built in, including mods your organization installs. This line reaches the transcript in every interactive session. Run `/reload-plugins` to load them again. -## - -​ - -A tool call is denied +## A tool call is denied The mod loaded and its hooks run, and a tool call it touched is refused. -### - -​ - -`a hook changed this call's input after the model wrote it` +### `a hook changed this call's input after the model wrote it` In auto mode, a denied tool call gives this reason. A hook changed the tool call’s input after the [server-side classifier](</docs/en/permission-modes#server-side-classifier-review>) reviewed it, so that review doesn’t cover what would run. The hook can be a mod’s [`tool.call`](</docs/en/plugins/mods/reference#tools>) or [`turn.step`](</docs/en/plugins/mods/reference#turns>) hook, or a [`PreToolUse`](</docs/en/hooks#pretooluse>) settings hook. The message doesn’t say which. The message tells Claude to issue the call once more as recorded. If that’s denied too, the hook changes the input every time, so turn off the mod or hook, or leave auto mode and approve the call yourself. In [some interactive terminal sessions and VS Code sessions](</docs/en/hooks#pretooluse-updatedinput-in-auto-mode>), the same denial gives the reason `a hook changed this call's input after auto mode reviewed it`. The repeated call there carries the mod’s first change, and a `tool.call` hook still runs on it, but a further change is dropped. You don’t need to change your mod unless Claude tells you in its reply that [auto mode couldn’t check the call](</docs/en/errors#hook-changed-input-after-review>). -### - -​ - -A message about the deny rules in your settings +### A message about the deny rules in your settings `tried to lift a deny rule in your settings` and `the deny rules in your settings could not be checked for this call, so it is refused` both come from the built-in guard. Look them up in Messages from the built-in guard. -## - -​ - -A toast appears after a turn is stopped - -### - -​ - -`Stopped: type a message to continue; a mod cannot resume work after Stop` +## A toast appears after a turn is stopped + +### `Stopped: type a message to continue; a mod cannot resume work after Stop` This toast means that after you stopped the turn, for example with Esc, a mod tried to start work on its own and Claude Code didn’t let it. Nothing needs fixing. After your next message, mods can start work again and [some of that work comes back](</docs/en/plugins/mods/api#work-your-mod-started-before-the-interruption>) on its own. If what you expected from the mod doesn’t come back, ask for it again or run the mod’s command again. If you wrote the mod, see [Calls and background work after the user interrupts a turn](</docs/en/plugins/mods/api#calls-and-background-work-after-the-user-interrupts-a-turn>). -## - -​ - -A drawing doesn’t appear or respond +## A drawing doesn’t appear or respond The mod loaded, and its pane, band, toast, or controls don’t behave as you expect. -### - -​ - -Another mod’s band shows and yours doesn’t +### Another mod’s band shows and yours doesn’t There is one band above the prompt, and every mod shares it. A mod that runs [before yours](</docs/en/plugins/mods/events#the-order-mods-run-in>) replaces your band when it returns a tree without the result of `next(e)` in it. To show both bands, change that mod’s hook, or ask its author to: @@ -304,11 +176,7 @@ To find that mod, write a debug log and search it for `answered ui.render without next()`. A line such as `other-mod (user) answered ui.render without next()` names a mod that returned its tree without calling `next(e)`. It doesn’t name the [render site](</docs/en/plugins/mods/reference#render-sites>), so a pane-only mod can appear too. A mod that calls `next(e)` and drops the result gets no line, so check the hooks before yours too. A mod’s band is also missing when the tree its own hook returned doesn’t validate, and the other mods’ bands stay. To find which mod and why, write a debug log and search it for `ui.render hook skipped`. -### - -​ - -A pane or band is empty or shows Claude Code’s usual content +### A pane or band is empty or shows Claude Code’s usual content The [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) your hook returned didn’t validate. A `hook skipped` line in the transcript or the debug log names your mod and the reason, as in this one for a `Box` in a pane: @@ -316,11 +184,7 @@ Fix what the reason names. If the reason is cut short, write a debug log and search it for `a hook returned a tree that does not validate` to read the rest. If the line instead says `refused:` right after the site’s name, as in `ui.render (Pane) refused:`, see A `ui.render` line says `refused`. -### - -​ - -A `ui.render` line says `refused` +### A `ui.render` line says `refused` `ui.render (<site>) refused:`, or `ui.render (<site>): the chain settled on a tree that does not validate` in the debug log, means the [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) at that site exceeds a [size limit](</docs/en/plugins/mods/reference#limits>). Either line names the [render site](</docs/en/plugins/mods/reference#render-sites>) and then the reason, and the reason names the limit. Change the mods that draw at that site so their [`ui.render`](</docs/en/plugins/mods/reference#interface>) hooks return smaller trees, or ask their authors to. If the transcript line starts with `hooks`, more than one loaded mod has a `ui.render` hook for that site, so check each of those mods’ trees. For several mods whose bands above the prompt nest into a tree more than 32 levels deep, the line reads: @@ -328,11 +192,7 @@ Before v2.1.307, a `refused:` line for any site reported any tree that didn’t validate, and for `Pane` and `AbovePrompt` it ended `; the engine drew its own`. On those releases, fix what the reason names. -### - -​ - -`needs a key`, `is drawn twice`, or `key each once` +### `needs a key`, `is drawn twice`, or `key each once` An element in the tree your `ui.render` hook returns has no valid [`key`](</docs/en/plugins/mods/interface#which-controls-need-a-key>), or two elements share one. Find the message you got: @@ -341,35 +201,19 @@ * **`is drawn twice; each takes its own key`** : two elements of the kind the message names have the same `key`, as in `Input "size" is drawn twice; each takes its own key`. Give each element its own `key`. * **`key each once` from `press` in a [test](</docs/en/plugins/mods/test#test-a-drawing>)**: the drawing has more than one button with the key you passed. Buttons with the same label and no `key` prop share that label as their key. Give each button its own `key`. -### - -​ - -A `ui.render` line says `threw while drawn` +### A `ui.render` line says `threw while drawn` The line names the [render site](</docs/en/plugins/mods/reference#render-sites>), then says `threw while drawn:` and the error, as in `first-mod: ui.render (ToolUse) threw while drawn: <error>; the engine drew its own`. Claude Code hit that error while drawing the tree your [`ui.render`](</docs/en/plugins/mods/reference#interface>) hook returned, or while drawing the site from the [`props` your hook passed to `next`](</docs/en/plugins/mods/interface#change-what-claude-code-already-draws>). The ending `the engine drew its own` means the site shows Claude Code’s usual content. Read the error and fix the value in your hook that caused it. Before v2.1.289, this error in a transcript row ended the session with [`Claude Code exited after an unrecoverable interface error`](</docs/en/errors#exited-after-an-unrecoverable-interface-error>). -### - -​ - -`the module failed without a message` +### `the module failed without a message` A [`Client`](</docs/en/plugins/mods/interface#when-a-client-fails>) failed with an error that has no message, such as `throw new Error()`. The line in its place reads like `my-mod: Client client/spinner.js: the module failed without a message`. Find the throw in your `Client`’s code and give the error a message. The line then shows that message. Before v2.1.289, the line showed `Error` as the reason instead. -### - -​ - -`$.ui.open` runs and no pane appears +### `$.ui.open` runs and no pane appears The call didn’t come from something the user did, and the terminal is narrower than [the width that pane needs](</docs/en/plugins/mods/interface#when-a-pane-waits-for-a-wider-terminal>). Open the pane from a command or a button, or check the call’s `isPlaced` result. See [Open a pane at the right time](</docs/en/plugins/mods/interface#open-a-pane-at-the-right-time>). -### - -​ - -A toast doesn’t appear +### A toast doesn’t appear Your mod calls [`$.ui.toast`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>) in an interactive terminal session and you don’t see the toast. To confirm that the call ran, look in the debug log for a line with your mod’s name and the toast’s text, as in `$.ui.toast (first-mod): build finished`. Then check for causes such as these: @@ -381,19 +225,11 @@ Before v2.1.290, Claude Code dropped a toast raised within two seconds of the last one it showed for your mod, and the debug log line for the dropped toast said `within 2000ms of the last; dropped`. -### - -​ - -The band shows `plugin panel hidden` +### The band shows `plugin panel hidden` The band is [collapsed](</docs/en/plugins/mods/interface#when-the-user-collapses-the-band>). It collapses when you press Ctrl+X then Ctrl+A, or the keys you bound in their place, and in [fullscreen rendering](</docs/en/fullscreen>) when you click the `[-]` on its first row. It stays collapsed until you expand it or start Claude Code again, and meanwhile no hotkey or `action` binding presses a button in it. To expand the band, press the keys the row names, Ctrl+X then Ctrl+A by default, or in fullscreen rendering click the row. -### - -​ - -Hotkeys do nothing +### Hotkeys do nothing Your pane or band doesn’t have keyboard focus, your button is in a collapsed band, or the drawing is in the VS Code extension, where buttons have no hotkeys. Do the one that matches: @@ -401,11 +237,7 @@ * **The button is in a collapsed band** : the band shows one dim row that starts with `▸ plugin panel hidden`. Press the keys the row names, Ctrl+X then Ctrl+A by default, to expand it. * **In the VS Code extension** : click the button, or press Enter on it once it has focus -### - -​ - -A drawing works in the terminal and not in the Desktop app or VS Code +### A drawing works in the terminal and not in the Desktop app or VS Code Either that app doesn’t draw the site or element, or the session is one where the VS Code extension draws nothing for mods. The mod’s other hooks still run. Check for these causes: @@ -413,43 +245,23 @@ * **The VS Code extension is older than 2.1.299** : the chat panel draws for mods from [extension version](</docs/en/vs-code#install-the-extension>) 2.1.299. Check the version in VS Code’s Extensions view and update the extension there. * **The extension is older than 2.1.304 and the session doesn’t fetch feature flags** : update the extension, or run `claude` in VS Code’s integrated terminal instead. Sessions on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry skip the fetch. For the others that skip it, such as a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, see [Features that need feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>). -## - -​ - -An edit or a value is lost +## An edit or a value is lost The mod runs, and a change you made or a value it kept isn’t there. -### - -​ - -Your edits don’t take effect +### Your edits don’t take effect You’re editing a plugin you installed. Claude Code runs the cached copy for the installed version. Develop with `--plugin-dir` pointed at your working copy, as in `claude --plugin-dir ./first-mod`, which reloads when you save. -### - -​ - -A value resets when the module reloads +### A value resets when the module reloads Module-level variables are re-initialized on each reload. [Keep the value in `$.state` or `$.store`](</docs/en/plugins/mods/interface#keep-state>). -### - -​ - -A value resets after `/clear`, `/resume`, or `/branch` +### A value resets after `/clear`, `/resume`, or `/branch` A value resets, or a saved value is replaced by its default. Each of those commands resets `$.state` to its defaults, and `session.start` doesn’t fire again. [Load the saved value again](</docs/en/plugins/mods/interface#load-a-saved-value-again-after-clear>) in a `classic.SessionStart` hook. -### - -​ - -A key your `settings.read` hook returns doesn’t take effect +### A key your `settings.read` hook returns doesn’t take effect If you return permission rules or `env` on [Claude Code’s own read](</docs/en/plugins/mods/events#settings-read-hook>), the rules aren’t checked on tool calls and the `env` entries don’t become environment variables. Use a [settings file](</docs/en/settings>) for both, or [`$.env.set`](</docs/en/plugins/mods/api#reach-files-processes-and-the-network>) for `env`. For another key, check [which mods get `settings.read` and from which version](</docs/en/plugins/mods/events#settings-read-hook>), then search the debug log for `settings.read` and look for one of these lines: @@ -464,11 +276,7 @@ If no line explains the key, check the mods that run before yours for a `settings.read` hook that [changes the key](</docs/en/plugins/mods/events#settings-read-example>). Turn that mod off, or ask your organization’s administrator to. If no hook does, set the key in a settings file. -### - -​ - -`the answer for <key> is no value the key can hold` +### `the answer for <key> is no value the key can hold` This debug log line means Claude Code refused the value a [`settings.read`](</docs/en/plugins/mods/events#settings-read-hook>) hook returned for the named key, and that key alone: @@ -481,11 +289,7 @@ While the value doesn’t fit, the key keeps the value merged from the settings sources before any hook answered. The line calls it the settings’ own value. -### - -​ - -`settings.read: refused to the engine` +### `settings.read: refused to the engine` You see this line in the debug log when [Claude Code’s own read](</docs/en/plugins/mods/events#settings-read-hook>) is refused, and Claude Code drops every hook’s value. When a `settings.read` hook refuses that read with [`{ deny: reason }`](</docs/en/plugins/mods/events#settings-read-returns>), the line carries that hook’s reason: @@ -500,11 +304,7 @@ If the line stays with no other mod left, set the keys your hook returns in a [settings file](</docs/en/settings>). Its values hold while the read is refused. -## - -​ - -Read the debug log +## Read the debug log The debug log has a line for every module Claude Code loads or refuses, every hook that fails, and every result it refuses, so it’s where to look when the transcript shows nothing. To write one, in your shell start Claude Code with `--debug`, or with `--debug-file <path>` to choose where it goes: @@ -520,11 +320,7 @@ To write your own lines in the log, call [`$.ui.log`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>) with a second argument, as in `$.ui.log('message', { to: 'debug' })`. Without the second argument, `$.ui.log` adds a dim line to the transcript. While you edit a mod loaded with `--plugin-dir`, the transcript shows a line for each reload that names the mod and lists its hooks. If a save breaks the module, the line says `reload failed, the previous version stays loaded:` with the reason, and the last working version keeps running until Claude Code next reloads plugins, such as when you run `/reload-plugins`. -## - -​ - -Next steps +## Next steps * [Test a mod](</docs/en/plugins/mods/test>): catch problems before they reach a session * [Troubleshoot plugins](</docs/en/plugins/troubleshooting>): problems with installing and loading a plugin that aren’t specific to mods
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -8,7 +8,7 @@ When a mod does nothing, check what Claude Code reads from the mod’s files, and the line it writes when it skips something. For the first, in your shell run [`claude plugin validate`](</docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod>) with the mod’s directory, as in `claude plugin validate ./first-mod`. It catches a misspelled event, a bad manifest, and a module Claude Code can’t read, without starting a session. When a module doesn’t load, a hook is skipped, or another mod refuses yours, Claude Code writes one line that names your mod. Where you read that line depends on the session: - * **A session that hot-reloads a plugin directory** : a dim line in the transcript. That’s an interactive session you started with `--plugin-dir`, or one where you [enabled hot reloading](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) for mods Claude wrote. + * **A session that hot-reloads a plugin directory** : a dim line in the transcript. That’s an interactive session you started with `--plugin-dir`, or one where [hot reloading is on](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) for mods Claude wrote. * **Any other interactive session, such as one that runs a mod you installed from a marketplace** : the debug log only. To get one, start the session with `claude --debug`. * **A`claude -p` run with `--plugin-dir`**: stderr, in the default text output format. A refusal by another mod goes to the debug log only. @@ -84,7 +84,7 @@ Messages from the built-in guard -On a machine with managed settings, or in a session whose credential is a Team or Enterprise `/login`, the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) can refuse a mod or one of its answers. Each message names the option your organization’s administrator sets to change the rule. +Where the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) loads, it can refuse a mod or one of its answers. Each message names the option your organization’s administrator sets to change the rule. Message contains| What it means| Where it appears ---|---|---
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -259,6 +259,8 @@ In auto mode, a denied tool call gives this reason. A hook changed the tool call’s input after the [server-side classifier](</docs/en/permission-modes#server-side-classifier-review>) reviewed it, so that review doesn’t cover what would run. The hook can be a mod’s [`tool.call`](</docs/en/plugins/mods/reference#tools>) or [`turn.step`](</docs/en/plugins/mods/reference#turns>) hook, or a [`PreToolUse`](</docs/en/hooks#pretooluse>) settings hook. The message doesn’t say which. The message tells Claude to issue the call once more as recorded. If that’s denied too, the hook changes the input every time, so turn off the mod or hook, or leave auto mode and approve the call yourself. +In [some interactive terminal sessions and VS Code sessions](</docs/en/hooks#pretooluse-updatedinput-in-auto-mode>), the same denial gives the reason `a hook changed this call's input after auto mode reviewed it`. The repeated call there carries the mod’s first change, and a `tool.call` hook still runs on it, but a further change is dropped. You don’t need to change your mod unless Claude tells you in its reply that [auto mode couldn’t check the call](</docs/en/errors#hook-changed-input-after-review>). + ### ​
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -449,16 +449,16 @@ A key your `settings.read` hook returns doesn’t take effect -Returned `env` entries don’t become environment variables. Returned `allow`, `ask`, and `deny` rules aren’t checked on tool calls. Set those in a [settings file](</docs/en/settings>), or call [`$.env.set`](</docs/en/plugins/mods/api#reach-files-processes-and-the-network>) for environment variables. For another key, check [which mods get `settings.read` and from which version](</docs/en/plugins/mods/events#settings-read-hook>), then search the debug log for `settings.read` and look for one of these lines: +If you return permission rules or `env` on [Claude Code’s own read](</docs/en/plugins/mods/events#settings-read-hook>), the rules aren’t checked on tool calls and the `env` entries don’t become environment variables. Use a [settings file](</docs/en/settings>) for both, or [`$.env.set`](</docs/en/plugins/mods/api#reach-files-processes-and-the-network>) for `env`. For another key, check [which mods get `settings.read` and from which version](</docs/en/plugins/mods/events#settings-read-hook>), then search the debug log for `settings.read` and look for one of these lines: Log line| Meaning and step ---|--- `settings.read hook skipped`, after your mod’s name| Your hook failed. Fix the error the line reports. `settings.read bypassed by cc-plugin-sec-default`, on a line that names your mod ahead of it| The [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) skipped your hook. Ask your organization’s administrator to [install the mod as one of the organization’s mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>). -`settings.read: the answer for <key> is no value the key can hold`| The returned value doesn’t fit the key’s schema. Return one it allows. +`settings.read: the answer for <key> is no value the key can hold`| Claude Code refused the value a hook returned for that key. The hook may be yours or another mod’s. Follow the step for your case. `settings.read: the merge never settles for <key>`| The keys the line names keep the settings sources’ values. Set them in a settings file. -`answered settings.read without next()`, after a mod’s name| Relevant only if that mod [runs before yours](</docs/en/plugins/mods/events#the-order-mods-run-in>). Then your hook didn’t run on that read. [Turn that mod off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>), or if your organization deployed it, ask its administrator to. -`settings.read: refused to the engine`| The read was refused, so no hook’s `{ value }` applied. Find what refused it. +`answered settings.read without next()`, after a mod’s name| Your hook is affected if the named mod [runs before yours](</docs/en/plugins/mods/events#the-order-mods-run-in>). Then your hook didn’t run on that read. [Turn that mod off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>), or if your organization deployed it, ask its administrator to. +`settings.read: refused to the engine`| Your value didn’t apply because Claude Code’s own read was refused. Find what refused it. If no line explains the key, check the mods that run before yours for a `settings.read` hook that [changes the key](</docs/en/plugins/mods/events#settings-read-example>). Turn that mod off, or ask your organization’s administrator to. If no hook does, set the key in a settings file. @@ -468,11 +468,16 @@ `the answer for <key> is no value the key can hold` -This debug log line means Claude Code refused the value your [`settings.read`](</docs/en/plugins/mods/events#settings-read-hook>) hook returned for the named key, and that key alone: +This debug log line means Claude Code refused the value a [`settings.read`](</docs/en/plugins/mods/events#settings-read-hook>) hook returned for the named key, and that key alone: settings.read: the answer for <key> is no value the key can hold; the settings' own value stands -The value you returned for the named key didn’t fit that key’s schema, for example by type or by range. Return a value that the key’s [settings reference](</docs/en/settings-reference>) entry allows. While your value doesn’t fit, the key keeps the value merged from the settings sources before any hook answered. The line calls it the settings’ own value. +The value returned for the named key didn’t fit that key’s schema, for example by type or by range. + + * **Your value doesn’t fit the key’s schema** : return one the key’s [settings reference](</docs/en/settings-reference>) entry allows. + * **Your value fits** : the value that doesn’t fit came from another mod’s `settings.read` hook. To find that mod, follow the steps to turn off mods one at a time. Search each new log for this line instead of `refused to the engine`. + +While the value doesn’t fit, the key keeps the value merged from the settings sources before any hook answered. The line calls it the settings’ own value. ### @@ -480,16 +485,18 @@ `settings.read: refused to the engine` -This debug log line means [Claude Code’s own read](</docs/en/plugins/mods/events#settings-read-hook>) was refused, so no hook’s `{ value }` applied, yours included. When a `settings.read` hook refuses that read with [`{ deny: reason }`](</docs/en/plugins/mods/events#settings-read-returns>), the line carries that hook’s reason: +You see this line in the debug log when [Claude Code’s own read](</docs/en/plugins/mods/events#settings-read-hook>) is refused, and Claude Code drops every hook’s value. When a `settings.read` hook refuses that read with [`{ deny: reason }`](</docs/en/plugins/mods/events#settings-read-returns>), the line carries that hook’s reason: settings.read: refused to the engine (engine: $.settings.read: <reason>); the settings' own values stand -Search your own hook’s code for the `<reason>` text: +Search your code for the reason in the parentheses: * **Your code has it** : your hook refused the read. Make it return `{ value }` when [`next.origin`](</docs/en/plugins/mods/events#settings-read-origin>) shows Claude Code’s own read. - * **Your code doesn’t have it** : [turn off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>) your other mods one at a time. After each, rerun this session’s command from your shell with one `--debug-file` on a new path, and search that file for `refused to the engine`. If the line is there, turn off the next mod. If not, the last mod you turned off refused the read, so keep it off. - -With no other mod left, use a [settings file](</docs/en/settings>) for the keys your hook returns. Its values hold while the read is refused. + * **Your code doesn’t have it** : [turn off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>) your other mods one at a time. If your organization deployed a mod, ask its administrator to turn it off. After each: + 1. Start the session from your shell with `claude --debug-file ./settings-read-2.log`, followed by the flags it started with. Use a new path each time. + 2. Search that file for `refused to the engine`. If the line is there, turn off the next mod. If not, the last mod you turned off refused the read, so keep it off. + +If the line stays with no other mod left, set the keys your hook returns in a [settings file](</docs/en/settings>). Its values hold while the read is refused. ##
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -300,7 +300,7 @@ * **Keep the bands after it** : put the result of `await next(e)` among the children of a `Box` in its tree, as in the Band above the prompt tab of [Pick where to draw](</docs/en/plugins/mods/interface#pick-where-to-draw>) * **Keep the tree valid** : don’t give that `Box`, or any `Box` around it, a `width`, `height`, `minWidth`, `minHeight`, `position`, `top`, `left`, `right`, `bottom`, `display`, or `overflow` prop -To find that mod, write a debug log and search it for `answered ui.render without next()`. A line such as `other-mod (user) answered ui.render without next()` names a mod that returned its tree without calling `next(e)`. It doesn’t name the [render site](</docs/en/plugins/mods/reference#render-sites>), so a pane-only mod can appear too. A mod that calls `next(e)` and drops the result gets no line, so check the hooks before yours too. After the change, you see nothing in the band if any of the mods returns a tree that doesn’t validate. To read the reason, look for a `ui.render (AbovePrompt) refused:` line in the transcript of a `--plugin-dir` session, or search the debug log for `does not validate`. With several mods in the band, neither line names a mod, so check each mod’s tree. +To find that mod, write a debug log and search it for `answered ui.render without next()`. A line such as `other-mod (user) answered ui.render without next()` names a mod that returned its tree without calling `next(e)`. It doesn’t name the [render site](</docs/en/plugins/mods/reference#render-sites>), so a pane-only mod can appear too. A mod that calls `next(e)` and drops the result gets no line, so check the hooks before yours too. A mod’s band is also missing when the tree its own hook returned doesn’t validate, and the other mods’ bands stay. To find which mod and why, write a debug log and search it for `ui.render hook skipped`. ### @@ -308,7 +308,23 @@ A pane or band is empty or shows Claude Code’s usual content -The [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) your hook returned didn’t validate. With `--plugin-dir`, the transcript says `ui.render (Pane) refused:` with the reason, as in `first-mod: ui.render (Pane) refused: Box prop "flexDirection" must be one of row, column, row-reverse, column-reverse; the engine drew its own`. The debug log has `a hook returned a tree that does not validate` with the same reason. Read the reason on that line. Common causes are a prop the element doesn’t take and an element the app doesn’t have. +The [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) your hook returned didn’t validate. A `hook skipped` line in the transcript or the debug log names your mod and the reason, as in this one for a `Box` in a pane: + + first-mod: ui.render hook skipped: returned the wrong shape (a tree Pane refuses: Box prop "flexDirection" must be one of row, column, row-reverse, column-reverse) + +Fix what the reason names. If the reason is cut short, write a debug log and search it for `a hook returned a tree that does not validate` to read the rest. If the line instead says `refused:` right after the site’s name, as in `ui.render (Pane) refused:`, see A `ui.render` line says `refused`. + +### + +​ + +A `ui.render` line says `refused` + +`ui.render (<site>) refused:`, or `ui.render (<site>): the chain settled on a tree that does not validate` in the debug log, means the [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) at that site exceeds a [size limit](</docs/en/plugins/mods/reference#limits>). Either line names the [render site](</docs/en/plugins/mods/reference#render-sites>) and then the reason, and the reason names the limit. Change the mods that draw at that site so their [`ui.render`](</docs/en/plugins/mods/reference#interface>) hooks return smaller trees, or ask their authors to. If the transcript line starts with `hooks`, more than one loaded mod has a `ui.render` hook for that site, so check each of those mods’ trees. For several mods whose bands above the prompt nest into a tree more than 32 levels deep, the line reads: + + hooks: ui.render (AbovePrompt) refused: deeper than 32; nothing was drawn + +Before v2.1.307, a `refused:` line for any site reported any tree that didn’t validate, and for `Pane` and `AbovePrompt` it ended `; the engine drew its own`. On those releases, fix what the reason names. ### @@ -493,7 +509,7 @@ hooks module first-mod@inline loaded (worker, environment 2, tier user); events: session.start,tool.call,command.run,ui.render -A drawing that didn’t validate counts as a refused result and gets a line too. To write your own lines in the log, call [`$.ui.log`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>) with a second argument, as in `$.ui.log('message', { to: 'debug' })`. Without the second argument, `$.ui.log` adds a dim line to the transcript. While you edit a mod loaded with `--plugin-dir`, the transcript shows a line for each reload that names the mod and lists its hooks. If a save breaks the module, the line says `reload failed, the previous version stays loaded:` with the reason, and the last working version keeps running until Claude Code next reloads plugins, such as when you run `/reload-plugins`. +To write your own lines in the log, call [`$.ui.log`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>) with a second argument, as in `$.ui.log('message', { to: 'debug' })`. Without the second argument, `$.ui.log` adds a dim line to the transcript. While you edit a mod loaded with `--plugin-dir`, the transcript shows a line for each reload that names the mod and lists its hooks. If a save breaks the module, the line says `reload failed, the previous version stays loaded:` with the reason, and the last working version keeps running until Claude Code next reloads plugins, such as when you run `/reload-plugins`. ##
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -218,6 +218,19 @@ ​ +`This mod's change didn't load` or `the earlier version is no longer running` + +A change to a [mod Claude wrote in this session](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) couldn’t load. The transcript line starts with the mod’s name and ends with the reason: + + * `This mod's change didn't load, so the earlier version is still running: <reason>.` + * `This mod didn't load, and the earlier version is no longer running: <reason>.` + +Claude doesn’t see this line, so paste it into your next message when you ask Claude for a fix. + +### + +​ + `$.agent.register refused: the hooks module that made the call is no longer loaded` The line starts with your mod’s name, as in `first-mod: $.agent.register refused: the hooks module that made the call is no longer loaded (it was reloaded or removed)`, and the agent isn’t registered. Your mod was reloaded or unloaded before the call. A reload loads a fresh copy of the hooks module, and this call came from code still running in the old copy, such as a hook that hadn’t returned yet. If that hook doesn’t catch the rejection, it fails and Claude Code skips it. To register the agent from the copy that stays loaded, make the call in your [`session.start`](</docs/en/plugins/mods/reference#session>) hook, which runs again in each fresh copy after a reload. @@ -296,6 +309,19 @@ A pane or band is empty or shows Claude Code’s usual content The [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) your hook returned didn’t validate. With `--plugin-dir`, the transcript says `ui.render (Pane) refused:` with the reason, as in `first-mod: ui.render (Pane) refused: Box prop "flexDirection" must be one of row, column, row-reverse, column-reverse; the engine drew its own`. The debug log has `a hook returned a tree that does not validate` with the same reason. Read the reason on that line. Common causes are a prop the element doesn’t take and an element the app doesn’t have. + +### + +​ + +`needs a key`, `is drawn twice`, or `key each once` + +An element in the tree your `ui.render` hook returns has no valid [`key`](</docs/en/plugins/mods/interface#which-controls-need-a-key>), or two elements share one. Find the message you got: + + * **`<Input> needs a key` or `<Select> needs a key`**: the element has no `key` prop, or its `key` is empty or isn’t a string, as in `key: 3`. Give it a non-empty string as its `key`. + * **`<Button> needs a key`**: give the button a non-empty string as its `key` + * **`is drawn twice; each takes its own key`** : two elements of the kind the message names have the same `key`, as in `Input "size" is drawn twice; each takes its own key`. Give each element its own `key`. + * **`key each once` from `press` in a [test](</docs/en/plugins/mods/test#test-a-drawing>)**: the drawing has more than one button with the key you passed. Buttons with the same label and no `key` prop share that label as their key. Give each button its own `key`. ### @@ -401,6 +427,54 @@ A value resets, or a saved value is replaced by its default. Each of those commands resets `$.state` to its defaults, and `session.start` doesn’t fire again. [Load the saved value again](</docs/en/plugins/mods/interface#load-a-saved-value-again-after-clear>) in a `classic.SessionStart` hook. +### + +​ + +A key your `settings.read` hook returns doesn’t take effect + +Returned `env` entries don’t become environment variables. Returned `allow`, `ask`, and `deny` rules aren’t checked on tool calls. Set those in a [settings file](</docs/en/settings>), or call [`$.env.set`](</docs/en/plugins/mods/api#reach-files-processes-and-the-network>) for environment variables. For another key, check [which mods get `settings.read` and from which version](</docs/en/plugins/mods/events#settings-read-hook>), then search the debug log for `settings.read` and look for one of these lines: + +Log line| Meaning and step +---|--- +`settings.read hook skipped`, after your mod’s name| Your hook failed. Fix the error the line reports. +`settings.read bypassed by cc-plugin-sec-default`, on a line that names your mod ahead of it| The [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) skipped your hook. Ask your organization’s administrator to [install the mod as one of the organization’s mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>). +`settings.read: the answer for <key> is no value the key can hold`| The returned value doesn’t fit the key’s schema. Return one it allows. +`settings.read: the merge never settles for <key>`| The keys the line names keep the settings sources’ values. Set them in a settings file. +`answered settings.read without next()`, after a mod’s name| Relevant only if that mod [runs before yours](</docs/en/plugins/mods/events#the-order-mods-run-in>). Then your hook didn’t run on that read. [Turn that mod off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>), or if your organization deployed it, ask its administrator to. +`settings.read: refused to the engine`| The read was refused, so no hook’s `{ value }` applied. Find what refused it. + +If no line explains the key, check the mods that run before yours for a `settings.read` hook that [changes the key](</docs/en/plugins/mods/events#settings-read-example>). Turn that mod off, or ask your organization’s administrator to. If no hook does, set the key in a settings file. + +### + +​ + +`the answer for <key> is no value the key can hold` + +This debug log line means Claude Code refused the value your [`settings.read`](</docs/en/plugins/mods/events#settings-read-hook>) hook returned for the named key, and that key alone: + + settings.read: the answer for <key> is no value the key can hold; the settings' own value stands + +The value you returned for the named key didn’t fit that key’s schema, for example by type or by range. Return a value that the key’s [settings reference](</docs/en/settings-reference>) entry allows. While your value doesn’t fit, the key keeps the value merged from the settings sources before any hook answered. The line calls it the settings’ own value. + +### + +​ + +`settings.read: refused to the engine` + +This debug log line means [Claude Code’s own read](</docs/en/plugins/mods/events#settings-read-hook>) was refused, so no hook’s `{ value }` applied, yours included. When a `settings.read` hook refuses that read with [`{ deny: reason }`](</docs/en/plugins/mods/events#settings-read-returns>), the line carries that hook’s reason: + + settings.read: refused to the engine (engine: $.settings.read: <reason>); the settings' own values stand + +Search your own hook’s code for the `<reason>` text: + + * **Your code has it** : your hook refused the read. Make it return `{ value }` when [`next.origin`](</docs/en/plugins/mods/events#settings-read-origin>) shows Claude Code’s own read. + * **Your code doesn’t have it** : [turn off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>) your other mods one at a time. After each, rerun this session’s command from your shell with one `--debug-file` on a new path, and search that file for `refused to the engine`. If the line is there, turn off the next mod. If not, the last mod you turned off refused the read, so keep it off. + +With no other mod left, use a [settings file](</docs/en/settings>) for the keys your hook returns. Its values hold while the read is refused. + ## ​
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -130,7 +130,7 @@ `the engine ran out of stack linking the file and its imports` -Code in the hooks module is nested too deeply, or its chain of imports is too long, for Claude Code to load it. The line starts with the mod’s name and `hooks module did not load:`, then gives a file’s name and this reason. Look through that file and the files reached through its imports for the most deeply nested part and rewrite it to nest less, or shorten the chain of imports. If you installed the mod and didn’t write it, ask its author to. +Code in the hooks module is nested too deeply, or its chain of imports is too long, for Claude Code to load it. The line starts with the mod’s name and `hooks module did not load:`, then gives a file’s name and this reason. In that file and the files its imports reach, find the most deeply nested code and rewrite it to nest less, or shorten the chain of imports. If you didn’t write the mod, ask its author to fix it. ###
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -128,6 +128,14 @@ ​ +`the engine ran out of stack linking the file and its imports` + +Code in the hooks module is nested too deeply, or its chain of imports is too long, for Claude Code to load it. The line starts with the mod’s name and `hooks module did not load:`, then gives a file’s name and this reason. Look through that file and the files reached through its imports for the most deeply nested part and rewrite it to nest less, or shorten the chain of imports. If you installed the mod and didn’t write it, ask its author to. + +### + +​ + `the parser stopped` or `the engine ran out of stack loading the file` Code in one file of the hooks module is nested so deeply that Claude Code ran out of stack reading it. The line starts with the mod’s name and `hooks module did not load:`, then gives that file’s name and one of these reasons: @@ -333,11 +341,20 @@ ​ +The band shows `plugin panel hidden` + +The band is [collapsed](</docs/en/plugins/mods/interface#when-the-user-collapses-the-band>). It collapses when you press Ctrl+X then Ctrl+A, or the keys you bound in their place, and in [fullscreen rendering](</docs/en/fullscreen>) when you click the `[-]` on its first row. It stays collapsed until you expand it or start Claude Code again, and meanwhile no hotkey or `action` binding presses a button in it. To expand the band, press the keys the row names, Ctrl+X then Ctrl+A by default, or in fullscreen rendering click the row. + +### + +​ + Hotkeys do nothing -Your pane doesn’t have keyboard focus, or the drawing is in the VS Code extension, where buttons have no hotkeys. Do the one that matches: - - * **No keyboard focus** : press Ctrl+X then Tab, or click the pane. To have the pane take focus when it opens, open it with `focus: true` from a command. +Your pane or band doesn’t have keyboard focus, your button is in a collapsed band, or the drawing is in the VS Code extension, where buttons have no hotkeys. Do the one that matches: + + * **No keyboard focus** : press Ctrl+X then Tab or, in [fullscreen rendering](</docs/en/fullscreen>), click the pane or band. To have the pane take focus when it opens, open it with `focus: true` from a command. + * **The button is in a collapsed band** : the band shows one dim row that starts with `▸ plugin panel hidden`. Press the keys the row names, Ctrl+X then Ctrl+A by default, to expand it. * **In the VS Code extension** : click the button, or press Enter on it once it has focus ###
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -106,7 +106,7 @@ `hooks module did not load` -The line starts with the mod’s name, then `hooks module did not load:` and a reason, which gives the file and line when the problem is in your code. Claude Code couldn’t load the module, for example because its top-level code threw. Fix the error the reason names. +The line starts with the mod’s name, then `hooks module did not load:` and a reason, which gives the file and line when the problem is in your code. Claude Code couldn’t load the module, for example because its top-level code threw. Fix the error the reason names. If the reason ends with `; the version loaded before is unloaded`, no version of the mod is running now. Once you fix the error, run [`/reload-plugins`](</docs/en/plugins/cli-reference#reload-plugins>) in the session to load the mod again. If you installed the mod and didn’t write it, ask its author to fix the error. ### @@ -123,6 +123,19 @@ `code nested too deep to scan: more than 2000 scopes` The line starts with the mod’s name, then `hooks module did not load:`, the file, and `code nested too deep to scan: more than 2000 scopes`. A file in a hooks module can’t nest scopes, such as functions, blocks, and loops, more than [2,000 deep](</docs/en/plugins/mods/reference#limits>). [`claude plugin validate`](</docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod>) reports the same reason. Rewrite the code so its scopes nest less deeply. + +### + +​ + +`the parser stopped` or `the engine ran out of stack loading the file` + +Code in one file of the hooks module is nested so deeply that Claude Code ran out of stack reading it. The line starts with the mod’s name and `hooks module did not load:`, then gives that file’s name and one of these reasons: + + * `code nested too deep to scan (the parser stopped: <message>)` + * `the engine ran out of stack loading the file (code nested too deep): <message>` + +The reason gives no line number and doesn’t say what kind of code is nested, so look through the file yourself for its most deeply nested part. Rewrite that part to nest less. If you installed the mod and didn’t write it, ask its author to. ###
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -84,7 +84,7 @@ Messages from the built-in guard -On a machine with managed settings, or for a user signed in with a Team or Enterprise plan, the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) can refuse a mod or one of its answers. Each message names the option your organization’s administrator sets to change the rule. +On a machine with managed settings, or in a session whose credential is a Team or Enterprise `/login`, the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) can refuse a mod or one of its answers. Each message names the option your organization’s administrator sets to change the rule. Message contains| What it means| Where it appears ---|---|--- @@ -237,6 +237,20 @@ ​ +A toast appears after a turn is stopped + +### + +​ + +`Stopped: type a message to continue; a mod cannot resume work after Stop` + +This toast means that after you stopped the turn, for example with Esc, a mod tried to start work on its own and Claude Code didn’t let it. Nothing needs fixing. After your next message, mods can start work again and [some of that work comes back](</docs/en/plugins/mods/api#work-your-mod-started-before-the-interruption>) on its own. If what you expected from the mod doesn’t come back, ask for it again or run the mod’s command again. If you wrote the mod, see [Calls and background work after the user interrupts a turn](</docs/en/plugins/mods/api#calls-and-background-work-after-the-user-interrupts-a-turn>). + +## + +​ + A drawing doesn’t appear or respond The mod loaded, and its pane, band, toast, or controls don’t behave as you expect. @@ -323,7 +337,7 @@ * **The site or element isn’t drawn in that app** : look up your site in the [render sites](</docs/en/plugins/mods/reference#render-sites>) table and your elements in the [elements](</docs/en/plugins/mods/reference#elements>) table. For an element the app lacks, check `e.surface` in the hook and return a tree the app can draw. * **The VS Code extension is older than 2.1.299** : the chat panel draws for mods from [extension version](</docs/en/vs-code#install-the-extension>) 2.1.299. Check the version in VS Code’s Extensions view and update the extension there. - * **The VS Code session doesn’t fetch feature flags** : drawing in the chat panel requires it. Sessions on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or through a [Claude apps gateway](</docs/en/claude-apps-gateway>), skip it, among others that [Features that need feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) lists. To see the drawing in such a session, run `claude` in a terminal instead, such as VS Code’s integrated terminal. + * **The extension is older than 2.1.304 and the session doesn’t fetch feature flags** : update the extension, or run `claude` in VS Code’s integrated terminal instead. Sessions on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry skip the fetch. For the others that skip it, such as a [Claude apps gateway](</docs/en/claude-apps-gateway>) session, see [Features that need feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>). ##
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -245,6 +245,19 @@ ​ +Another mod’s band shows and yours doesn’t + +There is one band above the prompt, and every mod shares it. A mod that runs [before yours](</docs/en/plugins/mods/events#the-order-mods-run-in>) replaces your band when it returns a tree without the result of `next(e)` in it. To show both bands, change that mod’s hook, or ask its author to: + + * **Keep the bands after it** : put the result of `await next(e)` among the children of a `Box` in its tree, as in the Band above the prompt tab of [Pick where to draw](</docs/en/plugins/mods/interface#pick-where-to-draw>) + * **Keep the tree valid** : don’t give that `Box`, or any `Box` around it, a `width`, `height`, `minWidth`, `minHeight`, `position`, `top`, `left`, `right`, `bottom`, `display`, or `overflow` prop + +To find that mod, write a debug log and search it for `answered ui.render without next()`. A line such as `other-mod (user) answered ui.render without next()` names a mod that returned its tree without calling `next(e)`. It doesn’t name the [render site](</docs/en/plugins/mods/reference#render-sites>), so a pane-only mod can appear too. A mod that calls `next(e)` and drops the result gets no line, so check the hooks before yours too. After the change, you see nothing in the band if any of the mods returns a tree that doesn’t validate. To read the reason, look for a `ui.render (AbovePrompt) refused:` line in the transcript of a `--plugin-dir` session, or search the debug log for `does not validate`. With several mods in the band, neither line names a mod, so check each mod’s tree. + +### + +​ + A pane or band is empty or shows Claude Code’s usual content The [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) your hook returned didn’t validate. With `--plugin-dir`, the transcript says `ui.render (Pane) refused:` with the reason, as in `first-mod: ui.render (Pane) refused: Box prop "flexDirection" must be one of row, column, row-reverse, column-reverse; the engine drew its own`. The debug log has `a hook returned a tree that does not validate` with the same reason. Read the reason on that line. Common causes are a prop the element doesn’t take and an element the app doesn’t have.
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -295,15 +295,22 @@ Hotkeys do nothing -Your pane doesn’t have keyboard focus. Press Ctrl+X then Tab, or click the pane. Open it with `focus: true` from a command. - -### - -​ - -A drawing works in the terminal and not in the Desktop app - -The site or element isn’t available there. Check the [render sites](</docs/en/plugins/mods/reference#render-sites>) and [elements](</docs/en/plugins/mods/reference#elements>) tables. +Your pane doesn’t have keyboard focus, or the drawing is in the VS Code extension, where buttons have no hotkeys. Do the one that matches: + + * **No keyboard focus** : press Ctrl+X then Tab, or click the pane. To have the pane take focus when it opens, open it with `focus: true` from a command. + * **In the VS Code extension** : click the button, or press Enter on it once it has focus + +### + +​ + +A drawing works in the terminal and not in the Desktop app or VS Code + +Either that app doesn’t draw the site or element, or the session is one where the VS Code extension draws nothing for mods. The mod’s other hooks still run. Check for these causes: + + * **The site or element isn’t drawn in that app** : look up your site in the [render sites](</docs/en/plugins/mods/reference#render-sites>) table and your elements in the [elements](</docs/en/plugins/mods/reference#elements>) table. For an element the app lacks, check `e.surface` in the hook and return a tree the app can draw. + * **The VS Code extension is older than 2.1.299** : the chat panel draws for mods from [extension version](</docs/en/vs-code#install-the-extension>) 2.1.299. Check the version in VS Code’s Extensions view and update the extension there. + * **The VS Code session doesn’t fetch feature flags** : drawing in the chat panel requires it. Sessions on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, or through a [Claude apps gateway](</docs/en/claude-apps-gateway>), skip it, among others that [Features that need feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) lists. To see the drawing in such a session, run `claude` in a terminal instead, such as VS Code’s integrated terminal. ##
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -76,7 +76,7 @@ `disableAllHooks in managed settings`| Your organization turned off hooks from installed plugins `only managed plugins and built-in plugins run`| `allowManagedHooksOnly` is set, or `disableAllHooks` is set in a settings file other than managed settings `installed plugins that are not managed load no hooks module in this mode (--bare)`| You started Claude Code with `--bare` -`another plugin of that name loads first`| Two plugins share a name. The managed one, or the one loaded first, is used. +`another plugin of that name loads first`| Another enabled plugin has the same name as your mod and [holds the name](</docs/en/plugins/loading#hooks-when-two-enabled-plugins-share-a-name>), so your hooks module doesn’t load ### @@ -197,6 +197,14 @@ ​ +`$.agent.register refused: the hooks module that made the call is no longer loaded` + +The line starts with your mod’s name, as in `first-mod: $.agent.register refused: the hooks module that made the call is no longer loaded (it was reloaded or removed)`, and the agent isn’t registered. Your mod was reloaded or unloaded before the call. A reload loads a fresh copy of the hooks module, and this call came from code still running in the old copy, such as a hook that hadn’t returned yet. If that hook doesn’t catch the rejection, it fails and Claude Code skips it. To register the agent from the copy that stays loaded, make the call in your [`session.start`](</docs/en/plugins/mods/reference#session>) hook, which runs again in each fresh copy after a reload. + +### + +​ + `mods that run in the hooks worker are off for this session` The line reads `hooks: mods that run in the hooks worker are off for this session: it crashed 3 times`. The worker stopped three times and Claude Code couldn’t trace the stops to one mod, so it unloaded every mod that isn’t built in, including mods your organization installs. This line reaches the transcript in every interactive session. Run `/reload-plugins` to load them again.
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -120,6 +120,14 @@ ​ +`code nested too deep to scan: more than 2000 scopes` + +The line starts with the mod’s name, then `hooks module did not load:`, the file, and `code nested too deep to scan: more than 2000 scopes`. A file in a hooks module can’t nest scopes, such as functions, blocks, and loops, more than [2,000 deep](</docs/en/plugins/mods/reference#limits>). [`claude plugin validate`](</docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod>) reports the same reason. Rewrite the code so its scopes nest less deeply. + +### + +​ + No mod loads in a directory you opened for the first time You haven’t answered the trust prompt for the directory. Start an interactive session in that directory with `claude`, and accept the trust prompt it opens with. @@ -131,6 +139,14 @@ No installed plugin loads at all You started Claude Code with `--safe-mode`. Start without the flag. + +### + +​ + +Claude Code stops asking to enable hot reloading + +Claude writes a mod in an interactive session, nothing loads, and Claude Code doesn’t ask again [whether to enable hot reloading](</docs/en/plugins/mods/create#ask-claude-for-a-mod>). If the question ends three times without an answer picked, hot reloading stays off. For example, the question ends that way when you set [`askUserQuestionTimeout`](</docs/en/settings-reference#askuserquestiontimeout>) and the time passes before you answer. That setting applies here because Claude Code asks in the same [question dialog that `AskUserQuestion` uses](</docs/en/tools-reference#question-auto-continue-timeout>). A question you dismiss yourself doesn’t count toward the three. To run the mod, [copy its directory out of the mods folder](</docs/en/plugins/mods/create#use-the-mod-in-other-sessions>), then in your shell start a new session with `--plugin-dir`, as in `claude --plugin-dir ~/mods/git-branch`. ##
modified
Show diff (101 lines)
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -24,7 +24,8 @@ ---|--- `no hooks module to load`| Mods can load. The command found no mod to test in this directory. `hooks modules are turned off here`| A setting is blocking your mods: `disableAllHooks` in your own settings, or your organization’s policy -`hooks modules are turned off in this process`| Anthropic has turned installed mods off remotely. No setting on your machine turns them back on. +`hooks modules are turned off in this process: the rollout switch served off`| Anthropic has turned installed mods off remotely. +`hooks modules are turned off in this process: the rollout switch was saved off by an earlier session`| The command used a value an earlier session saved, which may be out of date. Start `claude` once to refresh it, then run the command again. An organization can also set `allowManagedModsOnly` to allow only its own mods, which this command doesn’t report. In that case Claude Code refuses a mod you install, and [a message says why](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>). @@ -70,7 +71,8 @@ Message starts with| What it means ---|--- -`hooks modules are turned off for installed plugins in this process`| Anthropic has turned installed mods off remotely. No setting on your machine turns them back on. +`hooks modules are turned off for installed plugins in this process: the rollout switch served off`| Anthropic has turned installed mods off remotely. +`hooks modules are turned off for installed plugins in this process: the rollout switch was saved off by an earlier session`| The session used a value an earlier session saved, which may be out of date. Start Claude Code again to refresh it. `disableAllHooks in managed settings`| Your organization turned off hooks from installed plugins `only managed plugins and built-in plugins run`| `allowManagedHooksOnly` is set, or `disableAllHooks` is set in a settings file other than managed settings `installed plugins that are not managed load no hooks module in this mode (--bare)`| You started Claude Code with `--bare` @@ -171,6 +173,14 @@ ​ +`its session.start ran again in a fresh copy` + +The line starts with the mod’s name and names a `$.prompt.submit`, `$.command.run`, or `$.agent.spawn` call, as in `first-mod: its session.start ran again in a fresh copy; the $.prompt.submit call it had already made was not made again`. Claude Code loaded the mod’s module again, for example after the hooks worker crashed and was replaced, and the fresh copy’s [`session.start`](</docs/en/plugins/mods/reference#session>) hook ran. The call the line names resolved with the result of its first run instead of running again, so your mod doesn’t submit the prompt, run the command, or start the subagent twice. The rest of the hook ran as usual. There’s nothing to fix. Before v2.1.292, the call ran a second time, so the prompt was submitted, the command run, or the subagent started twice. + +### + +​ + `mods that run in the hooks worker are off for this session` The line reads `hooks: mods that run in the hooks worker are off for this session: it crashed 3 times`. The worker stopped three times and Claude Code couldn’t trace the stops to one mod, so it unloaded every mod that isn’t built in, including mods your organization installs. This line reaches the transcript in every interactive session. Run `/reload-plugins` to load them again. @@ -205,7 +215,7 @@ A drawing doesn’t appear or respond -The mod loaded, and its pane, band, or controls don’t behave as you expect. +The mod loaded, and its pane, band, toast, or controls don’t behave as you expect. ### @@ -219,6 +229,22 @@ ​ +A `ui.render` line says `threw while drawn` + +The line names the [render site](</docs/en/plugins/mods/reference#render-sites>), then says `threw while drawn:` and the error, as in `first-mod: ui.render (ToolUse) threw while drawn: <error>; the engine drew its own`. Claude Code hit that error while drawing the tree your [`ui.render`](</docs/en/plugins/mods/reference#interface>) hook returned, or while drawing the site from the [`props` your hook passed to `next`](</docs/en/plugins/mods/interface#change-what-claude-code-already-draws>). The ending `the engine drew its own` means the site shows Claude Code’s usual content. Read the error and fix the value in your hook that caused it. Before v2.1.289, this error in a transcript row ended the session with [`Claude Code exited after an unrecoverable interface error`](</docs/en/errors#exited-after-an-unrecoverable-interface-error>). + +### + +​ + +`the module failed without a message` + +A [`Client`](</docs/en/plugins/mods/interface#when-a-client-fails>) failed with an error that has no message, such as `throw new Error()`. The line in its place reads like `my-mod: Client client/spinner.js: the module failed without a message`. Find the throw in your `Client`’s code and give the error a message. The line then shows that message. Before v2.1.289, the line showed `Error` as the reason instead. + +### + +​ + `$.ui.open` runs and no pane appears The call didn’t come from something the user did, and the terminal is narrower than [the width that pane needs](</docs/en/plugins/mods/interface#when-a-pane-waits-for-a-wider-terminal>). Open the pane from a command or a button, or check the call’s `isPlaced` result. See [Open a pane at the right time](</docs/en/plugins/mods/interface#open-a-pane-at-the-right-time>). @@ -227,6 +253,22 @@ ​ +A toast doesn’t appear + +Your mod calls [`$.ui.toast`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>) in an interactive terminal session and you don’t see the toast. To confirm that the call ran, look in the debug log for a line with your mod’s name and the toast’s text, as in `$.ui.toast (first-mod): build finished`. Then check for causes such as these: + + * **The line for the call is missing** : look for one that says why Claude Code refused the call, as in `first-mod: $.ui.toast dropped: timeoutMs is a whole number of ms, 1 to 60000`. + * **A pane is holding toasts** : your mod or another one passed [`holdToasts`](</docs/en/plugins/mods/interface#hold-toasts-behind-a-dialog>) when it opened the pane that’s showing. Close the pane to end the hold. If the pane is yours and is meant to stay open, remove `holdToasts` from its `$.ui.open` call and open the pane again. + * **The toast is under the prompt** : in the [classic renderer](</docs/en/fullscreen#enable-fullscreen-rendering>), look at the right under the prompt. A toast there is one line that starts with the mod’s name, rather than a box at the top right. + * **Your mod raised a newer toast** : in the classic renderer, a newer toast from your mod can take the place of one that’s showing or waiting to show. The debug log has another line for the older toast, which ends with `gave way, cut short` when it was showing, or `gave way, unseen` when it never appeared. To show both messages, put them in one toast. + * **The toast ran out of time undrawn** : in fullscreen rendering, Claude Code draws at most three toasts at a time, so a toast can run out of time before it’s drawn. The debug log has another line for that toast, which ends with `left the stack, never drawn`. When your mod raises several at once, put the messages in one toast. + +Before v2.1.290, Claude Code dropped a toast raised within two seconds of the last one it showed for your mod, and the debug log line for the dropped toast said `within 2000ms of the last; dropped`. + +### + +​ + Hotkeys do nothing Your pane doesn’t have keyboard focus. Press Ctrl+X then Tab, or click the pane. Open it with `focus: true` from a command. @@ -289,7 +331,7 @@ hooks module first-mod@inline loaded (worker, environment 2, tier user); events: session.start,tool.call,command.run,ui.render -A drawing that didn’t validate counts as a refused result and gets a line too. To write your own lines in the log, call [`$.ui.log`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>) with a second argument, as in `$.ui.log('message', { to: 'debug' })`. Without the second argument, `$.ui.log` adds a dim line to the transcript. While you edit a mod loaded with `--plugin-dir`, the transcript shows a line for each reload that names the mod and lists its hooks. If a save breaks the module, the line says `reload failed, the previous version stays loaded:` with the reason, and the last working version keeps running. +A drawing that didn’t validate counts as a refused result and gets a line too. To write your own lines in the log, call [`$.ui.log`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>) with a second argument, as in `$.ui.log('message', { to: 'debug' })`. Without the second argument, `$.ui.log` adds a dim line to the transcript. While you edit a mod loaded with `--plugin-dir`, the transcript shows a line for each reload that names the mod and lists its hooks. If a save breaks the module, the line says `reload failed, the previous version stays loaded:` with the reason, and the last working version keeps running until Claude Code next reloads plugins, such as when you run `/reload-plugins`. ##
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -26,7 +26,7 @@ `hooks modules are turned off here`| A setting is blocking your mods: `disableAllHooks` in your own settings, or your organization’s policy `hooks modules are turned off in this process`| Anthropic has turned installed mods off remotely. No setting on your machine turns them back on. -An organization can also set `allowManagedModsOnly` to allow only its own mods, which this command doesn’t report. In that case a mod you install doesn’t load, and [a message says why](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>). +An organization can also set `allowManagedModsOnly` to allow only its own mods, which this command doesn’t report. In that case Claude Code refuses a mod you install, and [a message says why](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>). ## @@ -86,7 +86,7 @@ Message contains| What it means| Where it appears ---|---|--- -`mods are limited to your organization's by policy (allowManagedModsOnly)`| Your organization allows only [its own mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>), so yours wasn’t loaded| The debug log, and the transcript in a session that hot-reloads a plugin directory +`mods are limited to your organization's by policy (allowManagedModsOnly)`| Your organization allows only [its own mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>), so yours was refused| The debug log, and the transcript in a session that hot-reloads a plugin directory `tried to lift a deny rule in your settings`| Your mod’s [`tool.check`](</docs/en/plugins/mods/reference#tools>) hook approved a call that a `deny` rule refuses. The call stays denied.| The transcript and the debug log, once for each mod in a session. In a `claude -p` run, the debug log only. `the deny rules in your settings could not be checked for this call, so it is refused`| The guard failed while checking a call that a mod approved, so it refused the call| The reason Claude reads for the denied call
modified
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -40,9 +40,9 @@ ​ -Your version is older than 2.1.287 - -`claude --version` prints a version older than 2.1.287. Your version predates mods being on by default. [Update Claude Code](</docs/en/setup#update-claude-code>). +Your version is too old + +See [which version to use and how to check yours](</docs/en/plugins/mods/overview#turn-mods-on-or-off>). ###
added
Show diff (304 lines)
--- a/troubleshoot.md +++ b/troubleshoot.md @@ -0,0 +1,301 @@ +When a mod’s module or one of its hooks fails, Claude Code skips it and the session continues, so a broken mod can look like one that does nothing. Start by checking what Claude Code read from your mod and where it reports a problem, then find the symptom or message you have. + +## + +​ + +Find out why a mod does nothing + +When a mod does nothing, check what Claude Code reads from the mod’s files, and the line it writes when it skips something. For the first, in your shell run [`claude plugin validate`](</docs/en/plugins/mods/create#check-what-claude-code-reads-from-your-mod>) with the mod’s directory, as in `claude plugin validate ./first-mod`. It catches a misspelled event, a bad manifest, and a module Claude Code can’t read, without starting a session. When a module doesn’t load, a hook is skipped, or another mod refuses yours, Claude Code writes one line that names your mod. Where you read that line depends on the session: + + * **A session that hot-reloads a plugin directory** : a dim line in the transcript. That’s an interactive session you started with `--plugin-dir`, or one where you [enabled hot reloading](</docs/en/plugins/mods/create#ask-claude-for-a-mod>) for mods Claude wrote. + * **Any other interactive session, such as one that runs a mod you installed from a marketplace** : the debug log only. To get one, start the session with `claude --debug`. + * **A`claude -p` run with `--plugin-dir`**: stderr, in the default text output format. A refusal by another mod goes to the debug log only. + +## + +​ + +Check whether mods can load + +To check whether your setup lets mods load at all, without installing one, run `claude plugin test` in your shell, from a directory that doesn’t hold a mod. You don’t need a session. The message it prints tells you the state: + +Message includes| What it means +---|--- +`no hooks module to load`| Mods can load. The command found no mod to test in this directory. +`hooks modules are turned off here`| A setting is blocking your mods: `disableAllHooks` in your own settings, or your organization’s policy +`hooks modules are turned off in this process`| Anthropic has turned installed mods off remotely. No setting on your machine turns them back on. + +An organization can also set `allowManagedModsOnly` to allow only its own mods, which this command doesn’t report. In that case a mod you install doesn’t load, and [a message says why](</docs/en/plugins/mods/troubleshoot#messages-from-the-built-in-guard>). + +## + +​ + +The mod doesn’t load + +Nothing the mod adds appears: no command, no drawing, and no change in behavior. + +### + +​ + +Your version is older than 2.1.287 + +`claude --version` prints a version older than 2.1.287. Your version predates mods being on by default. [Update Claude Code](</docs/en/setup#update-claude-code>). + +### + +​ + +The `mods active` line doesn’t name the mod + +Nothing the mod adds appears, and the [`mods active` line](</docs/en/plugins/mods/overview#see-which-mods-a-session-loaded>) in `/plugin` doesn’t name it. The hooks module didn’t load. When Claude Code refused it, the debug log has a line that starts with `hooks module`, the mod’s name, and `not loaded:`, as in `hooks module first-mod@inline not loaded: disableAllHooks in managed settings` for a mod loaded with `--plugin-dir`. Read the reason after the colon. The refusal messages section lists each one. If the log has no such line, work through the other entries in this group. Some settings stop a mod and leave the rest of its plugin working. [Turn mods on or off](</docs/en/plugins/mods/overview#turn-mods-on-or-off>) names them. + +### + +​ + +A `claude -p` run prints `hooks module not loaded` + +The line starts with the mod’s name and goes to stderr. The hooks module was refused. A non-interactive run has no transcript, so the message goes to stderr. Read the reason after the colon. The refusal messages section lists each one. + +### + +​ + +Refusal messages + +Each of these follows `hooks module`, the mod’s name, and `not loaded:` in the debug log. + +Message starts with| What it means +---|--- +`hooks modules are turned off for installed plugins in this process`| Anthropic has turned installed mods off remotely. No setting on your machine turns them back on. +`disableAllHooks in managed settings`| Your organization turned off hooks from installed plugins +`only managed plugins and built-in plugins run`| `allowManagedHooksOnly` is set, or `disableAllHooks` is set in a settings file other than managed settings +`installed plugins that are not managed load no hooks module in this mode (--bare)`| You started Claude Code with `--bare` +`another plugin of that name loads first`| Two plugins share a name. The managed one, or the one loaded first, is used. + +### + +​ + +Messages from the built-in guard + +On a machine with managed settings, or for a user signed in with a Team or Enterprise plan, the [built-in guard](</docs/en/plugins/mods/admin#know-what-happens-by-default>) can refuse a mod or one of its answers. Each message names the option your organization’s administrator sets to change the rule. + +Message contains| What it means| Where it appears +---|---|--- +`mods are limited to your organization's by policy (allowManagedModsOnly)`| Your organization allows only [its own mods](</docs/en/plugins/mods/admin#install-your-organizations-mods>), so yours wasn’t loaded| The debug log, and the transcript in a session that hot-reloads a plugin directory +`tried to lift a deny rule in your settings`| Your mod’s [`tool.check`](</docs/en/plugins/mods/reference#tools>) hook approved a call that a `deny` rule refuses. The call stays denied.| The transcript and the debug log, once for each mod in a session. In a `claude -p` run, the debug log only. +`the deny rules in your settings could not be checked for this call, so it is refused`| The guard failed while checking a call that a mod approved, so it refused the call| The reason Claude reads for the denied call + +### + +​ + +`validate` passes and lists no `hooks` line + +`hooks/hooks.json` has no `modules` key, or the key is misspelled. Add `"modules": ["./register.js"]`. + +### + +​ + +`hooks module did not load` + +The line starts with the mod’s name, then `hooks module did not load:` and a reason, which gives the file and line when the problem is in your code. Claude Code couldn’t load the module, for example because its top-level code threw. Fix the error the reason names. + +### + +​ + +`options do not fit plugin.json userConfig` + +The line starts with the mod’s name, then `hooks module did not load: options do not fit plugin.json userConfig:` and a reason. An option fails validation against its [`userConfig`](</docs/en/plugins/components#user-configuration>) field, such as a number above the field’s `max`, or a required field has no value. Set or change the value. The end of the line names its `pluginConfigs` entry in `settings.json`. + +### + +​ + +No mod loads in a directory you opened for the first time + +You haven’t answered the trust prompt for the directory. Start an interactive session in that directory with `claude`, and accept the trust prompt it opens with. + +### + +​ + +No installed plugin loads at all + +You started Claude Code with `--safe-mode`. Start without the flag. + +## + +​ + +A hook is skipped or a mod is unloaded + +The mod loaded, and then Claude Code skipped one of its hooks or unloaded it. + +### + +​ + +`hook skipped` + +The line names the mod and the event, then says `hook skipped:` and a reason, as in `first-mod: tool.call hook skipped: threw Error: boom`. A hook threw, exceeded its [time limit](</docs/en/plugins/mods/reference#limits>), or returned a result of the wrong shape. The line appears once for each event and kind of failure until the mod reloads. Fix the error. The debug log has a line for every occurrence. + +### + +​ + +`no command.run hook answered it` + +You run a command your mod added, and the reply names the mod and the command, as in `first-mod registered /tally but no command.run hook answered it`, then tells you to add a hook. Claude Code prints that reply when the command reaches the end of the chain with no answer, which happens in two cases: + + * **No hook answered the command** : the module has no `command.run` hook, the hook’s [filter](</docs/en/plugins/mods/events#filter-which-events-a-hook-handles>) names a different command, or the hook returned `next(e)` + * **Claude Code skipped the hook** : `hook skipped` lists the reasons. Passing `focus: false` to [`$.ui.open`](</docs/en/plugins/mods/interface#open-a-pane-at-the-right-time>) is one way to get there. + +If the module already has the hook the reply describes, look for a `hook skipped` line that names `command.run`, which gives the reason. A [test](</docs/en/plugins/mods/test>) that runs the command fails with the same reason. + +### + +​ + +`it crashed the hooks worker` + +The line starts with the mod’s name, as in `first-mod was unloaded: it crashed the hooks worker`. Installed mods share one worker thread. The worker stopped responding or crashed, and Claude Code traced that to this mod and unloaded it. A hook that blocks the thread, such as a loop that never awaits, is one cause. Fix the hook. + +### + +​ + +`mods that run in the hooks worker are off for this session` + +The line reads `hooks: mods that run in the hooks worker are off for this session: it crashed 3 times`. The worker stopped three times and Claude Code couldn’t trace the stops to one mod, so it unloaded every mod that isn’t built in, including mods your organization installs. This line reaches the transcript in every interactive session. Run `/reload-plugins` to load them again. + +## + +​ + +A tool call is denied + +The mod loaded and its hooks run, and a tool call it touched is refused. + +### + +​ + +`a hook changed this call's input after the model wrote it` + +In auto mode, a denied tool call gives this reason. A hook changed the tool call’s input after the [server-side classifier](</docs/en/permission-modes#server-side-classifier-review>) reviewed it, so that review doesn’t cover what would run. The hook can be a mod’s [`tool.call`](</docs/en/plugins/mods/reference#tools>) or [`turn.step`](</docs/en/plugins/mods/reference#turns>) hook, or a [`PreToolUse`](</docs/en/hooks#pretooluse>) settings hook. The message doesn’t say which. The message tells Claude to issue the call once more as recorded. If that’s denied too, the hook changes the input every time, so turn off the mod or hook, or leave auto mode and approve the call yourself. + +### + +​ + +A message about the deny rules in your settings + +`tried to lift a deny rule in your settings` and `the deny rules in your settings could not be checked for this call, so it is refused` both come from the built-in guard. Look them up in Messages from the built-in guard. + +## + +​ + +A drawing doesn’t appear or respond + +The mod loaded, and its pane, band, or controls don’t behave as you expect. + +### + +​ + +A pane or band is empty or shows Claude Code’s usual content + +The [tree](</docs/en/plugins/mods/interface#build-a-tree-from-elements>) your hook returned didn’t validate. With `--plugin-dir`, the transcript says `ui.render (Pane) refused:` with the reason, as in `first-mod: ui.render (Pane) refused: Box prop "flexDirection" must be one of row, column, row-reverse, column-reverse; the engine drew its own`. The debug log has `a hook returned a tree that does not validate` with the same reason. Read the reason on that line. Common causes are a prop the element doesn’t take and an element the app doesn’t have. + +### + +​ + +`$.ui.open` runs and no pane appears + +The call didn’t come from something the user did, and the terminal is narrower than [the width that pane needs](</docs/en/plugins/mods/interface#when-a-pane-waits-for-a-wider-terminal>). Open the pane from a command or a button, or check the call’s `isPlaced` result. See [Open a pane at the right time](</docs/en/plugins/mods/interface#open-a-pane-at-the-right-time>). + +### + +​ + +Hotkeys do nothing + +Your pane doesn’t have keyboard focus. Press Ctrl+X then Tab, or click the pane. Open it with `focus: true` from a command. + +### + +​ + +A drawing works in the terminal and not in the Desktop app + +The site or element isn’t available there. Check the [render sites](</docs/en/plugins/mods/reference#render-sites>) and [elements](</docs/en/plugins/mods/reference#elements>) tables. + +## + +​ + +An edit or a value is lost + +The mod runs, and a change you made or a value it kept isn’t there. + +### + +​ + +Your edits don’t take effect + +You’re editing a plugin you installed. Claude Code runs the cached copy for the installed version. Develop with `--plugin-dir` pointed at your working copy, as in `claude --plugin-dir ./first-mod`, which reloads when you save. + +### + +​ + +A value resets when the module reloads + +Module-level variables are re-initialized on each reload. [Keep the value in `$.state` or `$.store`](</docs/en/plugins/mods/interface#keep-state>). + +### + +​ + +A value resets after `/clear`, `/resume`, or `/branch` + +A value resets, or a saved value is replaced by its default. Each of those commands resets `$.state` to its defaults, and `session.start` doesn’t fire again. [Load the saved value again](</docs/en/plugins/mods/interface#load-a-saved-value-again-after-clear>) in a `classic.SessionStart` hook. + +## + +​ + +Read the debug log + +The debug log has a line for every module Claude Code loads or refuses, every hook that fails, and every result it refuses, so it’s where to look when the transcript shows nothing. To write one, in your shell start Claude Code with `--debug`, or with `--debug-file <path>` to choose where it goes: + + claude --debug-file ./mod-debug.log --plugin-dir ./first-mod + +In another terminal, follow the file and filter for your mod’s name: + + tail -f ./mod-debug.log | grep first-mod + +A mod that loaded has a line that names it and lists the events it handles. A mod loaded with `--plugin-dir` appears under its name followed by `@inline`: + + hooks module first-mod@inline loaded (worker, environment 2, tier user); events: session.start,tool.call,command.run,ui.render + +A drawing that didn’t validate counts as a refused result and gets a line too. To write your own lines in the log, call [`$.ui.log`](</docs/en/plugins/mods/api#show-something-without-starting-a-turn>) with a second argument, as in `$.ui.log('message', { to: 'debug' })`. Without the second argument, `$.ui.log` adds a dim line to the transcript. While you edit a mod loaded with `--plugin-dir`, the transcript shows a line for each reload that names the mod and lists its hooks. If a save breaks the module, the line says `reload failed, the previous version stays loaded:` with the reason, and the last working version keeps running. + +## + +​ + +Next steps + + * [Test a mod](</docs/en/plugins/mods/test>): catch problems before they reach a session + * [Troubleshoot plugins](</docs/en/plugins/troubleshooting>): problems with installing and loading a plugin that aren’t specific to mods