sweep-doctor-glm-escalation

sweep-doctor-glm-escalation is a command for Claude Code from rjwalters/kicad-tools. It costs 0 tokens per session (1,235 once invoked), scanned A, original, MIT.

A retry rule for a specific sweep workflow when its Doctor step is rejected by a GLM model. It changes when the existing escalation path is tried, without adding a new escalation path.

In plain words
What is it for?
Use it when configuring or maintaining the sweep lifecycle and its checkpoint state for GLM-based Doctor runs.
Why use it?
It limits and records repeated Doctor rejections instead of letting that failure case proceed without a defined retry policy.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./.loom/scripts/sweep-checkpoint.sh doctor-attempt N --pr P --head <headRefOid> --runtime <runtime> --profile <model_profile> --kind fix.

Good fit Use it when configuring or maintaining the sweep lifecycle and its checkpoint state for GLM-based Doctor runs.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/rjwalters/kicad-tools
agentmods
npx agentmods add commands/rjwalters/kicad-tools/sweep-doctor-glm-escalation

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 sweep-doctor-glm-escalation

README.md
[![agentmods](https://agentmods.dev/badge/commands/rjwalters/kicad-tools/sweep-doctor-glm-escalation/github.svg)](https://agentmods.dev/commands/rjwalters/kicad-tools/sweep-doctor-glm-escalation)
Your own site
<a href="https://agentmods.dev/commands/rjwalters/kicad-tools/sweep-doctor-glm-escalation"><img src="https://agentmods.dev/badge/commands/rjwalters/kicad-tools/sweep-doctor-glm-escalation/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 sweep-doctor-glm-escalation

Your own site · 80×15
<a href="https://agentmods.dev/commands/rjwalters/kicad-tools/sweep-doctor-glm-escalation"><img src="https://agentmods.dev/badge/commands/rjwalters/kicad-tools/sweep-doctor-glm-escalation.svg" alt="Reviewed on agentmods" width="80" 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,235 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.00000 $0.01235
Opus 5.5 $0.00000 $0.00494
Sonnet 5.5 $0.00000 $0.00247
Haiku 4.5 $0.00000 $0.00123

Measured 1mo ago against content hash 07f201cd4045, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sweep-doctor-glm-escalation 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 1mo 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/loom/sweep-doctor-glm-escalation.md · 74 lines

How it starts

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

Sweep: bounded GLM Doctor rejections (#11359)

Load only when a Doctor phase is about to dispatch AND runtimes.rolePreference.doctor (or the fleet runtimes.preference) can resolve a GLM tap. Applies identically to Modes A/B (sweep-wave-lifecycle.md §6) and Mode C (sweep-mode-c-lifecycle.md C1b). It is a retry policy on the existing Doctor cycle and the existing sweep.escalation ladder; it adds no ladder and never changes sweep.max_doctor_cycles.

Config

sweep.glmDoctorRejectionsBeforeEscalation = K, a positive integer, default 2. Anything else is a config error naming the key (loom-daemon validate, and exit 78 from doctor-rejection); do not guess a value.

State

Written only through sweep-checkpoint.sh. Scope N is the PR's single closing issue (in scope even with no checkpoint file yet: still write doctor-done, which creates it); with zero/multiple closing issues pass - and write no doctor-done. State lives in the issue checkpoint when one exists, else in a PR-scoped pr-P-doctor.json beside it (no phase, never listed, so no phase is faked to hold it); the first issue write adopts it and removes that file. Record the first attempt before its doctor-done write, so a checkpoint-less Mode C entry loses nothing. Later writes retain it; curator-done/builder-done resets it (the PR file too, given --pr-number); delete N [--pr P] resets both stores (pass --pr when no checkpoint names P). doctor-clear N|- --pr P right after merge-pr.sh succeeds, or when the PR is parked, drops it all; an absent key (legacy) means zero. Keyed to the PR number.

Procedure

  1. After every completed Doctor attempt (it pushed and re-labeled the PR), before the follow-up Judge, record the head it produced and where it ACTUALLY ran, from the worker run --json report (runtime, model_profile), not from configuration (no runtime in the report: treat as a launcher failure, record nothing). --kind fix answers Judge feedback; --kind rebase is a conflict-only rebase pass (recorded, never counted):
    ./.loom/scripts/sweep-checkpoint.sh doctor-attempt N --pr P --head <headRefOid> --runtime <runtime> --profile <model_profile> --kind fix
    
  2. On each Judge rejection, before dispatching the next Doctor and in addition to the judge-rejected write, report the head the verdict reviewed:
    ./.loom/scripts/sweep-checkpoint.sh doctor-rejection N --pr P --head <reviewed-head>
    
    It counts only a rejection of the head a completed GLM Doctor produced, once (a replay prints replay). An initial Builder rejection, a stale/unrelated head, a Claude attempt, a launcher failure, no seat, or a rebase pass (not-counted rebase-pass) does not count.
  3. Before each Doctor dispatch ask for the route (<cap> is the effective sweep.max_doctor_cycles, including any granted grace cycle):
    ./.loom/scripts/sweep-checkpoint.sh doctor-route N --pr P --attempt <attempt> --cap <cap>
    
    • route=preference -> unchanged: worker run --role doctor --pr P --json.
    • route=cap-exhausted -> do NOT run another Doctor; block per the cap rule. K never extends the cap (with the default cap of 1 the cap stops first).
    • route=claude reason=... -> run worker run --role doctor --pr P --escalate-claude "<reason>" --json (it never launches or falls back to the GLM tap), then dispatch the Doctor as a Claude Task with the model from sweep.escalation (ladder[min(attempt - 1, len - 1)]; pins and a disabled ladder resolve as in the Execution Model, and neither may send the attempt back to GLM). A non-Claude LOOM_RUNTIME_DOCTOR/LOOM_RUNTIME pin makes --escalate-claude exit 78 with a diagnostic: park the PR per the cap rule and say so.
  4. Attribution: the doctor-done write carries the real model; log the escalation reason with it (PR #P Doctor escalated to Claude: <reason>). No seat or exhausted Claude capacity takes the existing bounded wait/failure path; log the escalation reason, never return to the GLM tap. If the GLM pool is empty the preference already falls back to Claude by its own rules: step 1 then records a non-GLM attempt and nothing counts.

Read the full file on GitHub · 74 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. 1mo ago First seen · 74 lines · 0 tokens per session scan A 07f201cd4045

Subscribe to this mod's changes

sweep-doctor-glm-escalation is a command published in the GitHub repository rjwalters/kicad-tools (77 stars, last pushed 15d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,235 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-10-12.

Related

sweep-doctor-glm-escalation compared with commands from other repositories

sweep-doctor-glm-escalation next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sweep-doctor-glm-escalationrjwalters/kicad-toolsCommand7715d agoMITA0Claude Code
checklistgithub/spec-kitCommand153ktodayMITA13Claude Code
clarifygithub/spec-kitCommand153ktodayMITA27Claude Code
specifygithub/spec-kitCommand153ktodayMITA13Claude Code
analyzegithub/spec-kitCommand153ktodayMITA26Claude Code
convergegithub/spec-kitCommand153ktodayMITA35Claude Code
implementgithub/spec-kitCommand153ktodayMITA14Claude Code