Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Threatcl Cloud — Claude Code Plugin

A Claude Code plugin that brings Threatcl Cloud into your AI coding workflow. Bundles:

  • Skillthreatcl skill auto-triggers on threat-modeling work and guides the agent through the right commands.
  • Slash commands — five workflow commands for review, code analysis, drift detection, CI scaffolding, and new-model creation.
  • MCP server — the Threatcl Cloud MCP server (threatcl) for direct read access to your org's threat models, library, and analytics. Authenticated via Claude Code's built-in OAuth flow on first use.

A separate, opt-in threatcl-lsp plugin in the same marketplace adds live language-server diagnostics while Claude edits HCL threat models — see Optional: threatcl-lsp language server.

Install

claude plugin marketplace add threatcl/claude-plugin
claude plugin install threatcl-cloud@threatcl

Or, install within claude using the /plugin command.

The first time you use a Threatcl Cloud feature, Claude Code will open a browser to complete OAuth — pick your org and you're done.

Optional — language server. For live diagnostics as Claude edits HCL threat models, also install the companion plugin (read the trade-offs first — it claims all *.hcl files):

claude plugin install threatcl-lsp@threatcl

Prerequisites

  • Claude Code — this plugin is Claude Code-specific. Codex and other agents should follow the agent setup guide instead.
  • threatcl CLI — required for write operations (validate, push, library import, policy create) and local file work. Install:
  • A Threatcl Cloud account at https://threatcl.com.

What's in the box

Skill

skills/threatcl/SKILL.md — the same instruction set you'd get from https://threatcl.com/threatcl.SKILL.md, with a short preamble explaining the plugin's MCP/CLI split. Auto-triggers when the agent detects threat-modeling intent.

Slash commands

Command Purpose
/threat-review <model> Run a structured security review of a model: unmitigated threats, STRIDE coverage, policy evaluation, library-fit suggestions, prioritized next actions.
/threat-for-code <path-or-diff> Analyze code (file, directory, or git diff range) and suggest threats from the org library — plus novel threats worth modeling, with HCL snippets.
/threat-drift [diff-range] Detect drift between recent code changes and the documented threat model. Surfaces stale threat assertions, phantom controls, new unmodeled surface, DFD drift, and dependency drift. Defaults to main...HEAD.
/threat-ci <flavor> Scaffold CI integration. Flavors: github-actions, gitlab-ci, pre-commit generate threatcl cloud validate on PR and threatcl cloud policy evaluate on merge. drift scaffolds threatcl/drift-action — automated threat-model drift review on every PR, the CI counterpart of /threat-drift.
/threat-hcl-new <name> Scaffold a new HCL threat model file with the cloud backend block pre-populated and a placeholder threat to fill in.

MCP server

.mcp.json declares the threatcl MCP server at the Threatcl Cloud API endpoint. The agent gets read tools automatically (list_threat_models, get_threat_model, search, library lookups, usage analytics). Auth is handled by Claude Code via OAuth 2.1 with PKCE — no tokens to copy around.

For write operations (push, validate, library import, policy edits), the skill falls back to the threatcl CLI.

Optional: threatcl-lsp language server

threatcl-lsp is a separate, opt-in plugin in this marketplace. It wires the threatcl lsp language server (shipping in threatcl 0.5.0+) into Claude Code so the agent gets live diagnostics — syntax errors, unknown blocks/attributes, missing required attributes, and invalid enum values — pushed into its context every time it edits an HCL threat model. That lets Claude catch and fix invalid HCL in the same turn it writes it.

claude plugin install threatcl-lsp@threatcl

Requires the threatcl CLI (≥ 0.5.0) on your PATH — the plugin only tells Claude Code how to launch the server, it doesn't bundle it.

Why it's separate, and the *.hcl caveat

Claude Code matches language servers on a file's final extension segment only. A file named model.tm.hcl resolves to .hcl, so there is no way to scope the server to threatcl's preferred *.tm.hcl suffix — threatcl-lsp necessarily claims all *.hcl files. Consequences:

  • It also attaches to Terraform / Packer / Nomad HCL and may report spurious "unknown block" diagnostics there.
  • If you also install a Terraform/HCL LSP plugin, only one server can own .hcl (whichever Claude Code loads first wins; the other is dropped).

That's why it isn't bundled into threatcl-cloud: cloud users who also edit Terraform shouldn't be opted into this trade-off automatically. Install threatcl-lsp if you primarily work in threatcl HCL; skip it if your repos are mostly Terraform. Full details in threatcl-lsp/README.md.

Architecture

┌──────────────────────────────────────────┐
│             Claude Code                  │
│                                           │
│  Skill ──► picks the right tool          │
│                                           │
│  /threat-review  ─┐                      │
│  /threat-for-code │                      │
│  /threat-drift    ┼─► structured prompt  │
│  /threat-ci       │                      │
│  /threat-hcl-new ─┘                      │
└──────────┬─────────────────┬─────────────┘
           │                 │
           ▼                 ▼
   ┌──────────────┐   ┌──────────────┐
   │ MCP server   │   │ threatcl CLI │
   │ (reads, OAuth)│   │ (writes,     │
   │              │   │  local ops)  │
   └──────┬───────┘   └──────┬───────┘
          │                  │
          ▼                  ▼
     Threatcl Cloud (beta-api.threatcl.com)

Configuration

The plugin points at the beta Threatcl Cloud API (https://beta-api.threatcl.com), declared in .mcp.json. The CLI needs the same endpoint set explicitly:

export THREATCL_API_URL=https://beta-api.threatcl.com

If your org is on a different endpoint, edit .mcp.json after install and set THREATCL_API_URL to match.

/threat-ci drift is the exception — threatcl/drift-action is self-hosted and needs no Threatcl Cloud account or endpoint. It talks only to the LLM provider you configure, under your own API key.

License

MIT - see LICENSE.

Links

About

A Claude Code plugin that brings threatcl.com into your AI coding workflow.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors