New claude plugin test command runs a plugin's hook tests in a sandboxed environment that mimics the real runtime
Claude Code adds a new command, claude plugin test [dir], which runs a plugin's function-hooks test files (files ending in .test.ts or .test.tsx) inside a sandboxed environment built to behave like the real hooks runtime. It imports a testing kit (with describe, expect, mock, test, and tier functions) from claude-code/testing, runs each test file in its own process (in parallel, up to a cap), and reports pass/fail counts.
- A
--filemode prints a JSON test report instead of the normal output. - The command checks whether the underlying hooks-modules feature is enabled and errors out if hooks modules are disabled, for example via
disableAllHooksorallowManagedHooksOnlysettings. - Plugins loaded through
claude plugin testget their own label wherever Claude Code lists where a plugin came from. - A related
limit-resetcommand was also added to the CLI's command list, loaded the same lazy way as other subcommands.
This gives plugin authors a way to write and run automated tests for their hooks (custom scripts that run at specific points, like before a tool call) without needing to exercise them inside a live Claude Code session.
What the new `limit-reset` command itself does is not described beyond its registration.