tachi: Command for Claude Code

.claude/commands/tachi.threat-model.md

tachi.threat-model is a command for Claude Code from davidmatousek/tachi. It costs 23 tokens per session (2,695 once invoked), scanned A, original, Apache-2.0.

A threat-analysis command for a system architecture description. It identifies possible attacks and produces a written report, attack trees, a threats file, and SARIF output, a format security tools can read.

In plain words
What is it for?
Use it to analyze an architecture file and save each run in its own dated folder. You can choose the output directory, attach a version label, and use a default architecture path.
Why use it?
It helps find security problems in a design before the system is built or released. Separate outputs make the findings useful for people and automated security checks.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths.

This is davidmatousek/tachi's own configuration. It tells Claude Code how to work on tachi itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything tachi configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/populate-affected-assets.py \.

Reuse

Borrowing it

Nothing to install: this file belongs to davidmatousek/tachi. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/davidmatousek/tachi/main/.claude/commands/tachi.threat-model.md
Clone the repo
git clone --depth 1 https://github.com/davidmatousek/tachi

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tachi.threat-model

README.md
[![agentmods](https://agentmods.dev/badge/commands/davidmatousek/tachi/tachi.threat-model/github.svg)](https://agentmods.dev/commands/davidmatousek/tachi/tachi.threat-model)
Your own site
<a href="https://agentmods.dev/commands/davidmatousek/tachi/tachi.threat-model"><img src="https://agentmods.dev/badge/commands/davidmatousek/tachi/tachi.threat-model/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tachi.threat-model

Your own site · 80×15
<a href="https://agentmods.dev/commands/davidmatousek/tachi/tachi.threat-model"><img src="https://agentmods.dev/badge/commands/davidmatousek/tachi/tachi.threat-model.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,695 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.02695
Opus 5 $0.00012 $0.01347
Sonnet 5 $0.00005 $0.00539
Haiku 4.5 $0.00002 $0.00269

Measured 9d ago against content hash 634e2a84ce63, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

tachi.threat-model scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/tachi.threat-model.md · 253 lines

How it starts

The opening of the file, as written. The whole thing — 253 lines — stays where its author put it; the contents beside it link to each section on GitHub.

User Input

$ARGUMENTS

Consider user input before proceeding (if not empty).

Step 0: Parse Flags

  1. If $ARGUMENTS contains --output-dir <path>:

    • Set output_dir to the specified path
    • Strip --output-dir <path> from $ARGUMENTS (trim extra whitespace)
  2. Default: output_dir = docs/security/

  3. If $ARGUMENTS contains --version <tag>:

    • Set version_tag to the specified tag (e.g., v1.0.0)
    • Append version_tag to output_dir (e.g., docs/security/v1.0.0/)
    • Strip --version <tag> from $ARGUMENTS (trim extra whitespace)
  4. Default: version_tag = none (outputs go directly to output_dir)

  5. Remaining $ARGUMENTS is treated as the architecture file path.

  6. Default architecture path: docs/security/architecture.md

  7. Generate a unique run folder:

    • Compute timestamp: YYYY-MM-DDTHH-MM-SS (e.g., 2026-03-25T14-30-22)
    • Set parent_dir to the current output_dir value (before appending timestamp)
    • Append to output_dir: {output_dir}/{timestamp}/
    • This ensures each run produces output in a unique subfolder
    • Example: examples/agentic-app/test-output/2026-03-25T14-30-22/
  8. Auto-detect baseline from previous runs (unless --baseline was explicitly provided):

    • List all subdirectories in parent_dir
    • Exclude the current run's timestamp directory
    • Sort remaining directories lexicographically descending (ISO timestamps sort naturally)
    • Check each directory (most recent first) for a threats.md file
    • If found: set baseline_path to that file
    • If none found: baseline_path = null (first run — stateless mode)
    • Display when detected:
      Baseline detected: {baseline_path}
      

Overview

Single-command entry point for tachi threat modeling. Validates prerequisites, invokes the tachi orchestrator agent against an architecture description, and writes the full output suite to the target directory.

Flow: Validate → Analyze → Report

Output suite:

  • threats.md — structured threat model (7 sections + correlated findings)
  • threats.sarif — SARIF 2.1.0 for CI/CD integration
  • threat-report.md — narrative report with executive summary and remediation roadmap
  • attack-trees/ — Mermaid attack tree per Critical/High finding

Read the full file on GitHub · 253 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 253 lines · 23 tokens per session scan A 634e2a84ce63

Subscribe to this mod's changes

tachi.threat-model is a command published in the GitHub repository davidmatousek/tachi (91 stars, last pushed 27d ago), licensed Apache-2.0. It adds 23 tokens to every session and 2,695 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.