SOURCE / docs/upstream-issue-host-declarations.mdAT / 2dbeaf1View on GitHub ↗History ↗

Draft issue for anthropics/claude-code (not filed)

Title: Officially supported unattended command to generate plugin host TypeScript declarations

Problem. A hooks-module plugin type-checks against declarations the host writes to .claude-plugin/types/ ("written by the engine each time it loads a mod from a folder the person owns"). There is no documented command that produces them without an interactive session, so a CI job cannot reproduce a complete TypeScript check of a plugin from a clean checkout.

What we observed (disposable clean clones, Linux, CI=true, DISABLE_AUTOUPDATER=1, CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1, fresh config directory, launch claude --plugin-dir "$PWD" -p '/cockpit version', a host-only slash command that needs no model call):

Claude CodeDeclarations written by that headless launch?Notes
2.1.294YesBut they lack $.ui.notify, which our plugin needs; the official plugin tests fail on this version for the same reason.
2.1.295NoLaunch succeeds, directory not created.
2.1.296NoSame. Also tried: relative --plugin-dir, the person's usual config directory, an already trusted working directory.
2.1.296, interactive session in a trusted folderYesWorking declarations, first line // Written by Claude Code 2.1.296.

claude plugin validate --strict and claude plugin test pass on 2.1.296 but do not write the declarations.

Request. One of: a subcommand (for example claude plugin types <dir>) that writes the declarations deterministically and exits non-zero on failure; or a documented flag or environment variable that makes the headless --plugin-dir launch write them; or published, versioned declarations (with a license that permits redistribution) that a plugin can install as a dev dependency.

Why it matters. Without it, a plugin's CI can pin the host and run tests and validation but cannot type-check, so TypeScript becomes a manual release step. Declarations are marked early access, so redistributing a copy ourselves is not something we are willing to do without permission.

No project files, credentials or paths are included.

SITE HUDSOURCE / 2dbeaf1 · mainVERSION / 0.6.5 (manifest on main)SYNC / via GitHub APIHow this page stays current

Suggested

  • PAGEInstall

    Two commands, then /cockpit

  • PAGECommands

    Every documented command

  • PAGEConfiguration

    Every option and its default

  • PAGEDiscovery, decisions and goal check

    What DONE requires

  • PAGESafety and trust

    What Cockpit observes, stores and never approves