guard

guard is a command for Claude Code from Kaddo-kdd/kaddo. It costs 12 tokens per session (1,415 once invoked), scanned A, original, MIT.

A check for related project files that may have been missed after code changes. It compares the Git diff with declared artifact ownership and reports possible knowledge drift.

In plain words
What is it for?
Use it on staged or unstaged changes, in CI, or optionally across mapped repositories to flag potentially outdated artifacts.
Why use it?
It helps find documentation or other maintained artifacts that should have been updated when related code changed.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/kaddo-kdd/kaddo/guard
Clone the repo
git clone --depth 1 https://github.com/Kaddo-kdd/kaddo

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 guard

README.md
[![agentmods](https://agentmods.dev/badge/commands/kaddo-kdd/kaddo/guard.svg)](https://agentmods.dev/commands/kaddo-kdd/kaddo/guard)
Your own site
<a href="https://agentmods.dev/commands/kaddo-kdd/kaddo/guard"><img src="https://agentmods.dev/badge/commands/kaddo-kdd/kaddo/guard.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,415 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00012 $0.01415
Opus 5 $0.00006 $0.00707
Sonnet 5 $0.00002 $0.00283
Haiku 4.5 $0.00001 $0.00142

Measured 6d ago against content hash 7a82accafbb1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

guard 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 6d 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.

apps/docs/src/content/docs/commands/guard.md · 154 lines

How it starts

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

kaddo guard              # checks staged + unstaged files in the current repo
kaddo guard --staged     # checks only staged files
kaddo guard --ci         # JSON output for CI/PR, non-blocking
kaddo guard --workspace  # also check local mapped module repos (multirepo, opt-in)

Guard Lite reads git diff, finds artifacts with matching code: globs, and shows a non-blocking FYI if the artifact was not updated in the same diff.

Touched files:
  - src/payments/payments.service.ts

  ⚠ Possible knowledge drift: WI-001 (feature, K2)
    Changed code matching this artifact:
      - src/payments/payments.service.ts
    Declared ownership:
      - src/payments/**
    WI-001 was not updated in this diff.
    Evidence: 1/1 globs matched · artifact K2 · domain: payments
    Suggested action: review WI-001 and update it if the behavior changed,
    or ignore this artifact below if the change does not affect the knowledge.

Untracked files

Guard reads the Git diff (modified/staged files), so brand-new files Git does not track yet are invisible to it. When untracked files exist, Guard prints a non-blocking FYI so you are not misled by a "no modified files detected" message:

Untracked files detected (3):
  - package.json
  - src/index.ts
  - tsconfig.json
Guard may not fully evaluate these files until they are tracked. (FYI — non-blocking)

Track the files (git add) for Guard to relate them to artifact ownership.

Unified discovery

Guard discovers knowledge artifacts through the same shared service as explain, context, understand and owners suggest, so every command sees exactly the same artifacts. Work Items are found recursively across lifecycle subfolders (draft/, ready/, in-progress/, …) and are recognized by their front matter, not their path or file name.

Recording history (--record)

By default Guard writes nothing. kaddo guard --record persists the run to .kaddo/history/guard-runs.jsonl (+ a summary) so kaddo drift can report drift trends over time and feed kaddo impact / kaddo savings. It records only paths, artifact ids and warnings — never git authors or personal data — and never blocks, edits source/knowledge or runs git.

Read the full file on GitHub · 154 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. 6d ago First seen · 154 lines · 12 tokens per session scan A 7a82accafbb1

Subscribe to this mod's changes

guard is a command published in the GitHub repository Kaddo-kdd/kaddo (47 stars, last pushed 1mo ago), licensed MIT. It adds 12 tokens to every session and 1,415 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.