audit-docstrings

audit-docstrings is a command for Claude Code from strands-rl/strands-sglang. It costs 0 tokens per session (1,029 once invoked), scanned A, original, Apache-2.0.

A review and cleanup of docstrings and comments in a selected Python package or file, based on the project’s AGENTS.md style rules. Docstrings are documentation written inside Python code.

In plain words
What is it for?
Use it to audit one target under src/strands_sglang/, decide which function arguments need explanation, and update docstrings and comments that fail the stated style.
Why use it?
It removes comments that merely repeat the code and fixes documentation that does not explain important behavior or follow the project’s rules.

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/strands-rl/strands-sglang/audit-docstrings
Clone the repo
git clone --depth 1 https://github.com/strands-rl/strands-sglang

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 audit-docstrings

README.md
[![agentmods](https://agentmods.dev/badge/commands/strands-rl/strands-sglang/audit-docstrings.svg)](https://agentmods.dev/commands/strands-rl/strands-sglang/audit-docstrings)
Your own site
<a href="https://agentmods.dev/commands/strands-rl/strands-sglang/audit-docstrings"><img src="https://agentmods.dev/badge/commands/strands-rl/strands-sglang/audit-docstrings.svg" alt="Measured on agentmods" height="20"></a>
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 1,029 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.01029
Opus 5 $0.00000 $0.00515
Sonnet 5 $0.00000 $0.00206
Haiku 4.5 $0.00000 $0.00103

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

Security

Grade A, and why

audit-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 5d 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/audit-docstrings.md · 88 lines

How it starts

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

Audit a package's docstrings and comments against the style rules in AGENTS.md, and fix what fails.

Target is $ARGUMENTS — a package or file path under src/strands_sglang/ (e.g. eval, environments/harbor, sglang.py). If not provided, ask which one; never audit everything at once.

Read the files. Do not grep for candidates.

A script cannot tell a # ---- Task ---- section divider from an explanatory comment, or judge whether a private helper names a domain concept. Open each file in the target and read it. Counting tools are for reporting scale, not for deciding.

The decisions, in the order they resolve

1. Args: is all-or-nothing. D417 rejects a partial section, so the question is never "does this parameter need a line" but "do this function's parameters need explaining at all". Default no.

Delete the whole section when every line restates its annotation:

client: SGLangClient            # signature
    client: `SGLangClient` for HTTP communication with the server.   # the same fact

Keep it when a parameter's meaning isn't in its type: resolution order, ownership, what None falls back to, units, what happens when two arguments disagree, or a name that implies less than it does (env_hook_path: str is really a dotted path to a callable returning an AsyncEnvFactory).

2. Returns:/Yields: earn their place against the annotation. -> tuple[list[ToolResultContent], Literal["success", "error"]] needs no "a tuple of (content, status)". A -> str that is really a JSON envelope does. The poorer the type, the more the section is worth.

3. Notes: is a footnote; the body is the explanation. Delete the sentence and see what breaks. If the function stops making sense it was body text — why this method exists, which of two paths to take, what an empty return means. If all that's lost is a warning, it stays a footnote: thread-safety, a teardown contract, an upstream quirk, a deliberate divergence from a reference implementation.

Read the full file on GitHub · 88 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. 5d ago First seen · 88 lines · 0 tokens per session scan A 491a3d0f3e03

Subscribe to this mod's changes

audit-docstrings is a command published in the GitHub repository strands-rl/strands-sglang (77 stars, last pushed 5d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,029 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.