tachi: Command for Claude Code

.claude/commands/tachi.compensating-controls.md

tachi.compensating-controls is a command for Claude Code from davidmatousek/tachi. It costs 41 tokens per session (2,042 once invoked), scanned A, original, Apache-2.0.

A security-control checker that compares scored threats with controls already present in a codebase. It reports missing controls and estimates the remaining risk in both a readable document and SARIF format, a standard format used by security tools.

In plain words
What is it for?
Use it with a threat-score directory to produce compensating-controls.md and compensating-controls.sarif. It can target a chosen codebase and output directory, or detect the newest matching security results.
Why use it?
It removes the need to inspect every threat and existing safeguard manually. It helps show which risks are covered, which need more protection, and what risk remains.

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 /compensating-controls --target ./my-app --output-dir ./reports/.

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.compensating-controls.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.compensating-controls

README.md
[![agentmods](https://agentmods.dev/badge/commands/davidmatousek/tachi/tachi.compensating-controls.svg)](https://agentmods.dev/commands/davidmatousek/tachi/tachi.compensating-controls)
Your own site
<a href="https://agentmods.dev/commands/davidmatousek/tachi/tachi.compensating-controls"><img src="https://agentmods.dev/badge/commands/davidmatousek/tachi/tachi.compensating-controls.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 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,042 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.00041 $0.02042
Opus 5 $0.00020 $0.01021
Sonnet 5 $0.00008 $0.00408
Haiku 4.5 $0.00004 $0.00204

Measured 8d ago against content hash 2e8631032b4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

tachi.compensating-controls 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 8d 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.compensating-controls.md · 194 lines

How it starts

The opening of the file, as written. The whole thing — 194 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 --target <path>:

    • Set target_path to the specified path
    • Strip --target <path> from $ARGUMENTS (trim extra whitespace)
  2. Default: target_path = "." (current working directory)

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

    • Set output_dir to the specified path
    • Strip --output-dir <path> from $ARGUMENTS (trim extra whitespace)
  4. Default: output_dir = null (outputs written to same directory as input risk-scores)

  5. Remaining $ARGUMENTS is treated as the risk-score input directory path.

  6. If no input directory was provided in $ARGUMENTS:

    • If ./docs/security/ exists in cwd: glob docs/security/*/, sort directory names descending (ISO-like YYYY-MM-DDTHH-MM-SS timestamps sort correctly as strings), and select the newest directory that contains risk-scores.md or risk-scores.sarif. Set input_dir to that path and display: Auto-detected input: {input_dir}.
    • Otherwise, default to current working directory (.).

Overview

Single-command entry point for tachi compensating controls analysis — the third link in the pipeline: /threat-model/risk-score/compensating-controls. Validates prerequisites, locates risk score input and target codebase, invokes the control-analyzer agent, and writes dual-format output files.

Flow: Validate → Locate Input → Analyze Controls → Report

Output suite:

  • compensating-controls.md — Coverage matrix, control details with file:line evidence, recommendations, residual risk summary
  • compensating-controls.sarif — SARIF 2.1.0 with per-finding residual scores, control properties, and preserved fingerprints

Step 1: Validate Prerequisites

  1. Check tachi agents are installed:
    • Verify .claude/agents/tachi/control-analyzer.md exists
    • If missing, display:
      TACHI CONTROL ANALYZER NOT INSTALLED
      Run: cp -r <tachi-repo>/adapters/claude-code/agents/control-analyzer.md .claude/agents/tachi/
      See: https://github.com/davidmatousek/tachi
      
    • Halt if missing.

Read the full file on GitHub · 194 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. 8d ago First seen · 194 lines · 41 tokens per session scan A 2e8631032b4b

Subscribe to this mod's changes

tachi.compensating-controls is a command published in the GitHub repository davidmatousek/tachi (90 stars, last pushed 25d ago), licensed Apache-2.0. It adds 41 tokens to every session and 2,042 once invoked, about $0.0002 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.