validate_changed_docstrings

A command that checks Python docstrings—the documentation written inside code—for formatting errors using Sphinx, a documentation tool.

In plain words
What is it for?
Use it after editing Python files to locate changed files, inspect documented classes and functions, and report invalid reStructuredText syntax or other parsing issues.
Why use it?
It finds problems in documentation for files you have changed before they reach the wider documentation build.

Command for Claude Code

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/dagster-io/dagster/validate_changed_docstrings
Clone the repo
git clone --depth 1 https://github.com/dagster-io/dagster

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 324 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 $0.00000 $0.00324
Opus 5 $0.00000 $0.00162
Sonnet 5 $0.00000 $0.00065
Haiku 4.5 $0.00000 $0.00032

Measured 2d ago against content hash a74b4479fb12, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

validate_changed_docstrings 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 2d 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/validate_changed_docstrings.md · 40 lines

What it actually says

Validate Changed Docstrings

Validates Python docstrings in all uncommitted changed files using Sphinx parsing.

This command finds files with uncommitted changes (staged or unstaged), extracts Python symbols with docstrings, and validates them using the existing docstring validation tool to catch RST syntax errors and other docstring issues early in development.

Usage

Run the validation script on changed files:

dagster-docs check docstrings --changed

What it does

  1. Uses git diff --name-only HEAD to find uncommitted Python files
  2. Parses each file's AST to extract classes, functions, and methods with docstrings
  3. Validates each symbol's docstring using the Sphinx parsing pipeline
  4. Reports errors and warnings with clear symbol paths
  5. Returns non-zero exit code if any errors are found

Example output

Found 2 uncommitted Python files:
  python_modules/dagster/dagster/_core/definitions/decorators/asset_decorator.py
  python_modules/dagster/dagster/_core/definitions/asset.py

Validating 8 symbols with docstrings...

--- dagster._core.definitions.decorators.asset_decorator.asset ---
  ERROR: RST syntax: <string>:111: (WARNING/2) Cannot analyze code. No Pygments lexer found for "pythonkjdfkd".

Summary: 1 errors, 0 warnings
✗ Some docstring validations failed

This helps catch docstring issues before they reach the documentation build process.

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. 2d ago First seen · 40 lines · 0 tokens per session scan A a74b4479fb12

Subscribe to this mod's changes

validate_changed_docstrings is a command published in the GitHub repository dagster-io/dagster (16,073 stars, last pushed 4d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 324 tokens. 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.