Skip to content

Evidence Claude Code

Alexander Kurganov edited this page Nov 26, 2026 · 15 revisions

Evidence for the facts about Claude Code that the repository states in docs/clients.md. A heading here matches a heading there.

Claude Code

Read in the documentation on 2026-11-05, except the pages of Subagent events, read on 2026-11-11.

  • How the runs were set up. Every run used the plugin of this repository, plugins/model-router, from a checkout, through a non-interactive command of the claude CLI. The command, the release, the date and the platform of each run are on its Seen: line.

Manifest

Read in the documentation on 2026-11-05.

  • The manifest file and the plugin root layout. Documentation: Plugin manifest reference, Manifest file
  • An unrecognized top-level field is stripped, the plugin loads, and claude plugin validate reports the field as a warning. Documentation: Plugin manifest reference, Unrecognized fields
  • An unknown key inside a userConfig option is an error. Documentation: Plugin manifest reference, Unrecognized fields
  • The required and accepted fields of a userConfig option. Documentation: Plugin manifest reference, User configuration
  • options limits a string option that is neither multiple nor sensitive, /config shows a picker, default is one of the listed values, and the release before which a plugin that declares options cannot load. Documentation: Plugin manifest reference, Limit a field to fixed options
  • Non-sensitive values are saved under pluginConfigs in settings.json, and sensitive values in the platform's secure credential store. Documentation: Plugin manifest reference, Where values are stored
  • Stored plugin options are read from the user settings, a --settings file and the managed settings, not from the project settings, and an option found in none takes its manifest default. Seen: Claude Code 2.1.318 on 2026-11-22, an interactive session with --debug-file <log> and no stored option. At the start of the session the debug log held no pluginConfigs["model-router" or "model-router@inline"].options in user, --settings or managed settings (project settings are not read); every option is its default.
  • A stored pluginConfigs value under a key that the manifest does not declare survives load and update. Source: the published package @anthropic-ai/claude-code, bundled code of 2.1.318, read on 2026-11-25. The loader merges the manifest defaults with the stored values. It drops a stored key only for an option that declares options when the stored value lies outside the list. No writer prunes the stored values by the manifest.
  • A stored pluginConfigs value under a key that the manifest does not declare reaches the options argument of register, when the manifest declares at least one option. Source: the published package @anthropic-ai/claude-code, bundled code of 2.1.318, read on 2026-11-25. The loader's merge copies every stored key. It drops only the value of a declared option that lies outside the option's options list. It returns nothing when the manifest declares no option. Documentation: Mods reference says options holds the declared fields. That is narrower than the code.
  • No settings surface lists such a key: not /config, not /plugin configure, not the desktop app's plugin settings. Source: the published package @anthropic-ai/claude-code, bundled code of 2.1.318, read on 2026-11-25. The rows of /config come from the manifest's userConfig. /plugin configure and claude plugin configure walk manifest.userConfig only. The desktop app's plugin settings keep only keys that the manifest declares, by Object.hasOwn(declared, key), Claude desktop 7.37095.0.
  • /config shows a row for each option, except sensitive options and multiple lists. Documentation: Plugin manifest reference, User configuration
  • commands takes an object map from a command name to source or content, each value sets exactly one of the two, description and argumentHint are optional, and the key becomes the command name after the plugin prefix. Documentation: Plugin manifest reference, commands
  • skills takes a path or an array of directory paths, "." names the plugin root, the listed directories add to the default skills/ scan, and the release that "." needs. Documentation: Plugin manifest reference, Path rules
  • Every component path starts with ./, exists, and resolves inside the plugin root. Documentation: Plugin manifest reference, Path rules
  • Anthropic's directory reads privacyPolicyUrl and four other listing fields from plugin.json only, and claude plugin validate reports each one as an unknown field in a catalogue entry. Documentation: Plugin manifest reference, Directory listing fields

Catalogue

Read in the documentation on 2026-11-05.

Install and update

Read in the documentation on 2026-11-05.

Hooks module

Read in the documentation on 2026-11-05.

  • A mod is a plugin whose hooks/hooks.json has a modules key that holds an array with one path, relative to that file. Documentation: Mods reference, Files
  • The hooks module is an ES module that exports register(on, options); options holds the userConfig values with their defaults filled in; when the list that the manifest's options key gives for an option does not hold the option's stored value, the options argument of register carries the default and not the stored value; the stored value stays under pluginConfigs. Documentation: Mods reference, Files Seen: Claude Code 2.1.318 on 2026-11-21, claude plugin install <plugin>@<marketplace> --config provider=auto, a claude plugin update to a version whose list lacks the value, then claude -p --output-format stream-json --verbose --debug-file <log>. The module got the manifest default for the value and for an option never set, and the stored value stayed in pluginConfigs; one stored value and one list change were tested.
  • .js and .ts files load directly with no build step, a hooks module imports only files inside the plugin directory by relative path, and the one bare import allowed is claude-code. Documentation: Create a mod, Check what Claude Code reads from your mod
  • $.ui.ask takes at most four options. Seen: Claude Code 2.1.318 on 2026-11-20, claude plugin test plugins/model-router with a dialog of five options. The call is refused with $.ui.ask takes at most 4 options (got 5).
  • A free string option that a manifest declares again hands its stored string to the plugin. Source: the published package @anthropic-ai/claude-code, bundled code of 2.1.318, read on 2026-11-25. For an option with no options list, the loader hands the stored string on as stored.
  • A config.describe hook returns { label, description, isHidden } for each /config row, keyed <plugin>.<field>, and a hidden row still answers $.config.set. Source: claude-code.d.ts L2540–L2573, L6181–L6190, L2614–L2619. The first gives the row's label, description and isHidden, and says in lines 2559–2561 that a hidden row still answers $.config.set. The second is the hook's own text. The third gives the key form <plugin>.<field> for a plugin's userConfig field.
  • $.config.set rejects a key with no /config row, an undeclared key included, with <plugin>: $.config.set: no /config row with key <key> ($.config.list names them). Source: the published package @anthropic-ai/claude-code, bundled code of 2.1.318, read on 2026-11-25. The /config rows, $.config.list, the config.describe event and $.config.set all use one row list, built from the manifest's userConfig. $.config.set throws for a key with no row.
  • No config.describe event fires for a key that the manifest does not declare. Source: the published package @anthropic-ai/claude-code, bundled code of 2.1.318, read on 2026-11-25. The config.describe event uses the one row list that the item above names, and a key outside the manifest has no row in it.
  • A failing hooks module is skipped and the session continues, so a broken mod can look like one that does nothing. Documentation: Troubleshoot a mod
  • A marketplace mod loads at the next start of Claude Code or at /reload-plugins in an open session. Documentation: Mods overview, Install or update a mod
  • When $.config.set writes an option of a mod in an open session, Claude Code reloads the mod's hooks module at once and runs its session.start hook again. Seen: Claude Code 2.1.318 on 2026-11-22, an interactive session with --plugin-dir and --debug-file <log>. After each of four writes the log held hooks module model-router@inline reloaded in <n>ms, the line options changed — reloaded (7 hooks: …) and a settled session.start; a command typed after the reloads printed the written values.
  • A running hooks-module call that writes twice with $.config.set completes its second write after the reload that its first write caused; both writes land, and the call returns its result after the second reload. Seen: Claude Code 2.1.318 on 2026-11-25, an interactive session with --plugin-dir and --debug-file <log>, one tool call of the mod that wrote one option and then cleared another. The log held the first atomic write of the settings file, hooks module model-router@inline reloaded, the second atomic write, a second reload, and then the tool call resolved with its result; the settings file held both values.
  • An option cleared with $.config.set to an empty text stays under pluginConfigs as an empty string, not as a deleted key. Seen: Claude Code 2.1.318 on 2026-11-25, the same run. After the call the cleared option's key was present in pluginConfigs with the value "".
  • A command typed at the prompt of an interactive session reaches command.run with the origin kind composer, and a command given as the prompt of claude -p reaches it with another origin. Seen: Claude Code 2.1.318 on 2026-11-21 and 2026-11-22. A hook that writes only for the kind composer wrote for the typed command and printed the current value, writing nothing, for the same command under claude -p; the run does not show the kind print mode gives.
  • In print mode, a turn that ends in a sign-in error exits with status 1, and it has loaded the hooks module and run its session.start hook. Seen: Claude Code 2.1.318 on 2026-11-21, claude -p --output-format stream-json --verbose --debug-file <log>. Both turns exited 1 with a sign-in error, and each debug log held the module's load and its settled session.start hook; the run does not show the order of the hook against the sign-in check.
  • An installed plugin is cached by version, and an edit reaches the installed copy only after the version rises and the user installs again. Documentation: Create a mod, Share your mod
  • A tool.describe hook with a { tool: "<name>" } matcher gets the tool, its description, an optional deferral flag and the provider, and answers a description and an optional deferral flag; the engine refuses a hook that passes on a changed tool or provider; and it caches the answer by tool name until $.ui.invalidate. Read on 2026-11-26. Source: Claude Code 2.1.296, the type declarations that Claude Code writes into a plugin's .claude-plugin/types/claude-code/index.d.ts: ToolDescribeInput lines 12917–12944, ToolDescribeResult lines 12954–12957, the matcher example lines 4228–4230 and the cache rule lines 4223–4225. Closed source, so no link. Source: Claude Code 2.1.308, the strings of the claude binary in the npm package @anthropic-ai/claude-code-darwin-arm64@2.1.308; the argument check of the tool.describe event refuses a changed tool, because the engine caches the description by it, and a changed provider. The 2.1.308 wrapper package @anthropic-ai/claude-code holds no declarations. Closed source, so no link.
  • The model sees the answer of a tool.describe hook as the tool's description, in the main session and in a subagent that has the tool. Seen: Claude Code 2.1.332 on 2026-11-26, claude -p --plugin-dir <plugin> --setting-sources project --model haiku --max-turns 4. The main agent quoted the added text word for word as the last three sentences of the Agent description, and a general-purpose subagent named the Agent tool among its tools and quoted the first sentence of the text from that tool's description.

Subagent events

Read at Claude Code 2.1.308 and 2.1.318, and in the documentation on 2026-11-11.

  • agent.spawn fires when a subagent or a teammate is about to start and when a finished or stopped subagent is about to run again, e.resume is { agentId } for a resumed run, a changed event passed to next is ignored there, and the release from which the resumed run raises the event. Documentation: Mods reference, Subagents
  • SendMessage resumes a completed subagent under the same ID with no new Agent call, Explore and Plan return no agent ID, a per-invocation model and effort stay in effect on the resumed run, and CLAUDE_CODE_EFFORT_LEVEL outranks the effort. Documentation: Create custom subagents, Resume subagents, Choose an effort level
  • A model set at agent.spawn stays on the resumed run. Seen: Claude Code 2.1.318, 2026-11-11, claude -p --model sonnet --output-format stream-json --verbose with the plugin loaded by --plugin-dir, one general-purpose Agent call, then one SendMessage to its agent id. The debug log held one routing line for the two runs. The subagent's messages carried message.model claude-haiku-5-5 on its first run and on the resumed run, and the session's own messages carried claude-sonnet-5-5.
  • turn.complete carries a subagent's agentId once for each run of its loop, and no event marks a subagent as gone: a completed, failed or stopped agent can still resume under its id. Documentation: the declarations Claude Code 2.1.308 writes beside a loaded mod, TurnCompleteFields.agentId and AgentStatus
  • turn.step carries the agentId, and a hook may rewrite its effort. Documentation: React to events, Follow a turn; the declarations Claude Code 2.1.308 writes beside a loaded mod, TurnStepInput.effort
  • The other fields of agent.spawn (provider, parentModel, parentAgentId, permissionMode, background, cwd) and agent.offer (provider). Documentation: claude-code.d.ts L203 and L259–L309, written by Claude Code 2.1.277; the declarations Claude Code 2.1.308 writes hold the same fields

Validate and test

Read in the documentation on 2026-11-05.

  • claude plugin validate <path> takes a manifest file or a directory, a directory with .claude-plugin/marketplace.json validates the marketplace, and the release from which a directory with both files validates the marketplace and then the plugin. Documentation: Plugin commands reference, Validate a directory
  • --strict treats warnings as errors, and the command then exits 1. Documentation: Plugin commands reference, plugin validate
  • A validation run does not check a SKILL.md at the plugin root. Documentation: Plugin commands reference, Validate a directory
  • For a mod, validation prints hooks: and calls: lines that list the events and the API calls found in the module, prints a line for each hook that can refuse an action, with or without a .catch handler, and notes that its checks apply none of the plugin directory's own rules for hooks modules. Documentation: Create a mod, Check what Claude Code reads from your mod Seen: Claude Code 2.1.308, 2026-11-04, claude plugin validate --strict plugins/model-router on Ubuntu and macOS. It printed the hooks: and calls: lines and ✔ Validation passed, and it noted that its checks apply none of the plugin directory's own rules for hooks modules.
  • claude plugin test [directory] runs every file under the directory whose name ends in .test.ts or .test.tsx, needs no session, sign-in or network, and exits 1 when a test fails. Documentation: Plugin commands reference, plugin test Seen: Claude Code 2.1.308, 2026-11-04, claude plugin test plugins/model-router on Ubuntu. It ran the plugin's test files with no session and passed.
  • Under claude plugin test, a $.ui.ask dialog given one option holds that option followed by Yes. Two or more options arrive as given. The type declarations Claude Code writes for a plugin say of $.ui.ask that fewer than two options are padded with Yes/No. Read in the type declarations of Claude Code 2.1.318 (AskOptions.options: "2-4 option labels; fewer than two are padded with Yes/No") on 2026-11-21. Seen: Claude Code 2.1.318, claude plugin test plugins/model-router, 2026-11-21: a plugin dialog with one option (provider) reached the tool.call hook of AskUserQuestion with two options, the plugin's option and Yes; dialogs with two (scope) and four (gateway) options arrived as given; a test answer of Yes to the one-option dialog was not one of the plugin's offered values, so the plugin reported the setting unchanged

Package files

Read in the documentation on 2026-11-05.

Claude Code project skills and configuration

Read in the documentation on 2026-11-19.

  • Project skills load from .claude/skills/ in the folder Claude Code starts in and in each parent up to the repository root. Documentation: Extend Claude with skills
  • CLAUDE_CONFIG_DIR replaces the configuration folder ~/.claude, which holds the settings, the session history and the plugins. Documentation: Environment variables
  • A model turn under CLAUDE_CONFIG_DIR set to a copy of the configuration folder ends in a sign-in error. Seen: Claude Code 2.1.318 on 2026-11-21 and Claude Code 2.1.332 on 2026-11-26, CLAUDE_CONFIG_DIR=<copy> claude -p "<prompt>" --model haiku --output-format stream-json --verbose --debug-file <log>. Each turn ended in a sign-in error; on 2.1.332 it read Not logged in · Please run /login.
  • --setting-sources loads only the sources it names, project leaves the user settings out, and a model turn under the real configuration folder with that flag is signed in. Documentation: CLI reference, CLI flags, read on 2026-11-26 Seen: Claude Code 2.1.332 on 2026-11-26, claude -p "<prompt>" --plugin-dir <plugin> --setting-sources project --strict-mcp-config --model haiku --max-turns 4 --output-format stream-json --verbose --debug-file <log>, started from an empty folder with no CLAUDE_CONFIG_DIR. The turn was signed in, called a subagent and ended with "is_error":false.
  • --strict-mcp-config skips the MCP servers of .mcp.json, ~/.claude.json and plugins, and loads those of --mcp-config. Documentation: CLI reference, CLI flags, read on 2026-11-26
  • --debug-file <path> writes the debug log to that path and turns debug mode on, and without it the debug log is ~/.claude/debug/<session-id>.txt. Documentation: CLI reference, CLI flags, Environment variables

Claude Code gaps

Read in the documentation on 2026-11-05.

  • The Mods reference gives no rule for the declaration form of register in a hooks module, for free setTimeout globals or for a size limit on the module. Documentation: Mods reference
  • No run has shown the effort of a resumed request: the stream carries no request's effort.
  • A run under --model haiku could not show whether a routed model stays on a resumed run: the plugin routed the same task to haiku.
  • No run has shown whether an options list may hold six values, or whether a userConfig string with no options list reaches the hooks module as stored.

Clone this wiki locally