{"version":"2.1.271","anchor":"new-claude-plugin-test-cli-command-for-function-hooks-plug","canonical_anchor":"new-claude-plugin-test-cli-command-for-function-hooks-plug","heading":"New claude plugin test CLI command for function-hooks plugins","tier":"use","area":"Plugin Testing","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271\/e\/new-claude-plugin-test-cli-command-for-function-hooks-plug","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.271","markdown":"### New `claude plugin test` CLI command for function-hooks plugins\n\nNew `claude plugin test` command runs a plugin's hook tests in a sandboxed environment that mimics the real runtime\n\n**Unclear.** What the new `limit-reset` command itself does is not described beyond its registration.\n\n**What**\n\nClaude 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.\n\n- A `--file` mode prints a JSON test report instead of the normal output.\n\n- The command checks whether the underlying hooks-modules feature is enabled and errors out if hooks modules are disabled, for example via `disableAllHooks` or `allowManagedHooksOnly` settings.\n\n- Plugins loaded through `claude plugin test` get their own label wherever Claude Code lists where a plugin came from.\n\n- A related `limit-reset` command was also added to the CLI's command list, loaded the same lazy way as other subcommands.\n\n**Why**\n\nThis 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.\n\n- Area: Plugin Testing\n- Names: `claude plugin test`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 2\/5"}