Skip to content
Giallo

Test a Claude Code Mod without login or model calls

Test a Claude Code Mod with claude plugin test: events, stubs, clocks and UI actions without login or network, covering success cases, errors and limits.

Reading time: 12 min

Test Claude Code Mod claude plugin test: synthetic events, service stubs and verification on two surfaces

You can test a Claude Code Mod without session, login or network through claude plugin test and the kit claude-code/testing. The test sends events to the plugin, replaces external responses with stubs and checks the result. It is a verification of the behavior of the component, not a quality assessment of Claude. Official Mods Test Guide.

Sources are verified on 9 October 2026. In this guide the cases are designed, with no results of invented suites. The route starts from two small functions: a counter and a read-only ticket lookup. For the structure of the package read create the first TypeScript mod; for integration see commands and tools of the Mods API.

In summary

  • Validates and tests answer different questions: structure and behavior.
  • Fixtures must represent inputs and responses with consistent synthetic data.
  • Stubs avoid involving tools, networks, and models in the test case.
  • Clocks and UI interactions allow you to verify streams without waiting for a real session.
  • The test result should be described with its perimeter, without turning it into a complete certification.

What do you validate and what does plugin testing check?

claude plugin validate check the manifest and static analysis of the module. It can discover an unknown event, a missing link, or a shape that the loader does not recognize. Narrow mode also considers warnings according to the reference. This helps to know what Claude Code will read from the package, before attributing an error to the session. Plugin Command Reference.

A test instead verifies a promise: given a known input, what result does the function produce? A command can be recorded correctly and show a wrong value. A tool can have a valid schema and confuse an absent record with a network error. These are problems that require expectations about behavior, not just a readable package.

Control Question Test available Limit
Validation Is the package recognized as expected? Manifest and Static Analysis Doesn't run all the workflow
Behavior Tests Does the case produce the expected outcome? Events, Fixtures and asserts It applies to cases designed
Interaction testing Does the UI action lead to the result? Mounted elements and simulated inputs Doesn't describe every real layout
Surface Test Does the component appear and can be used? Observation of the chosen environment Does not cover all machines
Proof of integration Does the real service comply with the contract? Authorized and controlled call Depends on access and environment

The reasonable sequence is to validate, test the contract and then test the affected surfaces. You don't need a call to the model to prove that a counter counts two synthetic events. Instead, another assessment is needed if the question is «Claude chooses this tool when appropriate?». The boundary must be explicit in the report.

How to choose useful cases instead of testing each line?

Start with the promised behavior, not the implementation. For a counter ask if it increases with the correct event, ignores foreign events and restarts or retains the value according to the requirement. For a lookup ask if it returns the expected fields, distinguishes absent record and error and prevents unauthorized data from being exposed.

A test that repeats exactly the internal structure can pass even when it changes what the user observes. The case must then use a component input and verify a recognizable result. If the requirement is to show 'observed calls', the expectation must control that meaning, not the presence of a variable called count.

Also write a negative proof before you finish the job. The function must know what to do when a field is missing, when the source is not responding, or when the user cancels. Not all errors must be blocking, but each result must be interpretable. The Guide to code review helps link these expectations to the reviewer's decision.

Fixtures and stubs: what is the practical difference?

A fixture is the data prepared for the test: dummy ticket, event or expected response. A stub is controlled behavior that responds in place of an addiction. You can have a valid fixture but a wrong stub, which returns an impossible shape in the real system. The test would pass on a fiction too comfortable.

In the designed lookup he prepares, for example, a record with synthetic identifier, technical title and status. Then he prepares the absence of the record and an error response. Fixture must not use customer data copied ‘for realism’: its purpose is to represent the contract. AI and Data Security explains why the test material also deserves a defined boundary.

The stubs must comply with the documented API responses used by the mod. The $ of the test kit sends events and does not coincide with the API received from the mod code. The official guide distinguishes these two responsibilities. Before writing a simulation then check which side of the contract you are replacing.

What results should the positive test check?

For the counter, use a known sequence, then call back the command and check the value. Decide first if a rejected attempt counts: don't let the code written first set the requirement. A number has meaning only when the definition of what matters is stable.

For positive lookup, check input, returned fields, and no write effects. The result must be consistent with the simulated source, with no invented enrichments. If the tool reads only title and state, a test that accepts a long free summary hides an enlargement of the promise. Better a small and verifiable contract.

The case may also include time data when needed. If the function states "current state", it must clarify when the data is read or which cache it uses. A fixture without this appearance does not prove the freshness of the result. However, do not introduce a clock in each test: use it when the weather really changes the behavior.

How to design error, delay and cancellation?

The proof of error must describe an outcome that the person responsible can recognize. For consultation, unavailable service and record not found are different. For a decision UI, user rejection and component error may require different messages. Don't use a generic "ok" for each branch just to get the suite through.

Delay is used when time is part of the requirement. Documentation offers a clock controlled through mock.clock(on): the test advances time without waiting for the real duration. You can verify that a message does not appear before the deadline and that it arrives once when it has to. It's a sequence control, not a performance benchmark. Timer tests.

For cancellation, check what must not happen. A Cancel button is not correct merely because it displays a label: the subsequent path must respect the refusal. A useful test observes the result and the permitted calls. If the component handles sensitive operations, isolate the case completely with stubs and synthetic data.

A test plan for a read-only lookup

Success: Returns the expected fields of the synthetic ticket. Absence: states that the record does not exist. Error: Communicates that the data has not been verified. Access denied: does not reveal the record. Invalid input: does not call the source. Delay, if relevant: does not produce early success. No case should initiate a writing.

How to verify the UI on terminal and desktop?

The kit allows you to mount a point of the UI, find items and interact with buttons or fields. The surface should be chosen explicitly when the project supports more than one. A terminal readable component should not be considered to be automatically identical in the desktop. The UI Test Guide It shows the principle.

However, do not copy a desktop case for a demo that states only the terminal. The proof matrix must follow the plugin contract. For an indicator such as Token Weather, cadence and data matter; for a view like Replay Theater, navigation and interpretation of passages are part of the requirement.

The interaction test can show that a button updates a value, but the actual test has yet to check for readability, space, and messages. It retains a distinction in the report: simulated behavior and observation on the surface. Thus a layout flaw is not hidden by a suite that only verifies the internal value.

How to read the result of the suite without inventing a verification?

A file .test.ts or .test.tsx must declare real tests. The documentation specifies that a file without test() fails: it is not enough to have a folder called tests. The command returns an error when a test fails. In the report it keeps case name and outcome, avoiding publishing an example screen as a result of your execution.

The commands to consider in the path are distinct:

claude plugin validate ./mod-esaminato --strict
claude plugin test ./mod-esaminato

mod-esaminato is a directory placeholder. These commands were not executed to produce a customer plugin in this guide. Before launching them on your package you must have examined the code and context. Networkless testing does not mean that any external file is reliable or that you have to perform it blindly.

Two hypothetical verification scenarios for an SME

Hypothetical example: a software house in Lecce maintains a summary command. The team defines a fixture with known events and verifies the result without calling the model. An error in the count is reproduced with a small case. Correction changes behavior and the test continues to control public entry, without depending on the name of the internal variables.

Before distribution, the manager tests the command in the adopted surface and notes the version of Claude Code. The suite is not sold as proof of increased productivity: it demonstrates the contract of the cases performed. If the function changes meaning, the description and expectations are also updated.

Hypothetical example: an SME from Trento prepares a lookup ticket. The team uses synthetic data for success, absence and denied access. The test checks that the error message does not reveal internal configurations. Only after the contract is connected to the authorised service in a test environment, with a separate verification of integration.

When a colleague fails to load the plugin, the group does not rewrite the tests to let them pass on its machine. Compare version, policy, and rejection message through the Diagnosis of Mods. An availability issue is not necessarily an error in the verified function.

What unnecessary or missing tests weaken the project?

The first error is to test only that a function exists. The second is to use a stub that always responds successfully. The third is to check the text of a button without verifying the result of its action. The fourth is to ignore status and reload when they are part of the requirement. The fifth is to declare ‘all verified’ by a single positive case.

It also avoids huge suites that repeat implementation without covering up new consequences. Each case should protect an important contract or a reproducible defect. If a copy change does not alter behavior, there is no need to build a disproportionate testing infrastructure. The least significant set remains easier to maintain and understand.

What evidence to add after finding a bug?

First it retains the minimum case that reproduces it. The new test must fail with faulty behavior and pass with correction, checking the observable contract. If it passes already before the change, it does not prove to protect that problem. Use a small fixture and precise expectation, avoiding copying an entire transcript.

It notes why chance exists and what consequence it avoids. This note helps those who modify the plugin retain the meaning of the test. There is no need to duplicate every internal branch: just protect the reproducible error and the boundaries that the correction may have altered.

How to make testing part of distribution?

Assign a manager to the contract and keep fixture, version and cases in the plugin project. Before publishing a change, check what that change can alter. If the pattern changes, try input and output; if the UI changes, try the interaction; if the persistence changes, try the life cycle. A targeted list makes the result reviewable.

To build a customization with evidence understandable to the team, a software house can prepare the package and its verification path. The guide to Mods and the one at API Mods help keep the project small before adding new integrations and authorities.

Giallo Studio guides: methodology and sources

How we apply it in the company

Related resources

AI consulting services and process automation

FAQ

Can you test a Claude Code Mod without login?

The documentation describes claude plugin test and the claude-code/testing kit operating without a session, login or network. Tests simulate events and provide responses through stubs. They do not test model quality or make calls to a client account.

What is the difference between validate and test?

Validate checks the manifest and performs static analysis of the module. Test sends events to the mod and checks what it does. A valid manifest can belong to a function that returns the wrong result.

What is a stub in the test of a mod?

It is a controlled response that takes the place of the function or service that the mod expects. It allows you to experience success, error and delay without involving the real system. Its form must comply with the simulated API contract.

How do you test timers and timeouts?

The kit documents a clock controlled by the test. Time is advanced by the test case, so there is no need to wait for real time. Both what happens at the deadline and what must not happen beforehand must be checked.

Can I test the UI buttons?

The kit lets you mount a surface and interact with the rendered elements. When a mod supports both terminal and desktop, check both relevant contracts. Testing the actual layout remains a separate check.

Does a passing test prove that the entire plugin is safe?

No. It only demonstrates the expectations verified by the case and the fixtures used. Review of the code, data boundaries and evidence of real integration remain necessary. Do not attribute to the kit a universal sandbox.

Put it into practice

Let's turn this guide into your first live workflow.

Tell us what process you want to lighten: we evaluate feasibility, return and first operational step.