Skip to content
Automation
Command

/legal-loop

Iterate a worker-evaluator cycle against a Goal Record until the success condition is met or a stop limit is reached. The evaluator (a different agent than the worker) judges each iteration using MCP verification tools. Produces an auditable verdict trail and a final MET / NOT

From plugin
bettercallclaude
4629 skills21 agents29 commands10 MCP
> /plugin marketplace add fedec65/bettercallclaude
> /plugin install bettercallclaude@bettercallclaude-marketplace

Command definition

legal-loop.md
description: "Iterate a worker-evaluator cycle against a Goal Record until the success condition is met or a stop limit is reached. The evaluator (a different agent than the worker) judges each iteration using MCP verification tools. Produces an auditable verdict trail and a final MET / NOT MET status."
tools:
  - Read
  - Grep
  - Glob
  - Bash
  - WebSearch
  - WebFetch
  - mcp__plugin_bettercallclaude_bge-search__search_bge
  - mcp__bge-search__search_bge
  - mcp__plugin_bettercallclaude_bge-search__get_bge_decision
  - mcp__bge-search__get_bge_decision
  - mcp__plugin_bettercallclaude_entscheidsuche__search_decisions
  - mcp__entscheidsuche__search_decisions
  - mcp__plugin_bettercallclaude_fedlex-sparql__search_legislation
  - mcp__fedlex-sparql__search_legislation
  - mcp__plugin_bettercallclaude_fedlex-sparql__get_article
  - mcp__fedlex-sparql__get_article
  - mcp__plugin_bettercallclaude_fedlex-sparql__lookup_statute
  - mcp__fedlex-sparql__lookup_statute
  - mcp__plugin_bettercallclaude_legal-citations__validate_citation
  - mcp__legal-citations__validate_citation
  - mcp__plugin_bettercallclaude_legal-citations__standardize_document_citations
  - mcp__legal-citations__standardize_document_citations
  - mcp__plugin_bettercallclaude_legal-citations__extract_citations
  - mcp__legal-citations__extract_citations
  - mcp__plugin_bettercallclaude_onlinekommentar__search_commentaries
  - mcp__onlinekommentar__search_commentaries
  - mcp__plugin_bettercallclaude_swiss-caselaw__get_decision
  - mcp__swiss-caselaw__get_decision
  - mcp__plugin_bettercallclaude_swiss-caselaw__get_erwaegung
  - mcp__swiss-caselaw__get_erwaegung
  - mcp__plugin_bettercallclaude_swiss-caselaw__get_regeste
  - mcp__swiss-caselaw__get_regeste
  - mcp__plugin_bettercallclaude_swiss-caselaw__find_citations
  - mcp__swiss-caselaw__find_citations
  - mcp__plugin_bettercallclaude_swiss-caselaw__find_relevant_erwaegung
  - mcp__swiss-caselaw__find_relevant_erwaegung
  - mcp__plugin_bettercallclaude_swiss-caselaw__check_claim_support
  - mcp__swiss-caselaw__check_claim_support
  - mcp__plugin_bettercallclaude_swiss-caselaw__attest_response
  - mcp__swiss-caselaw__attest_response
  - mcp__plugin_bettercallclaude_swiss-caselaw__get_commentary
  - mcp__swiss-caselaw__get_commentary
  - mcp__plugin_bettercallclaude_swiss-caselaw__cite
  - mcp__swiss-caselaw__cite
  - mcp__plugin_bettercallclaude_ollama__ollama_check_status
  - mcp__ollama__ollama_check_status
  - mcp__plugin_bettercallclaude_ollama__ollama_classify_privacy
  - mcp__ollama__ollama_classify_privacy

/legal-loop — Worker-Evaluator Iteration Cycle

You are invoked via `/bettercallclaude:legal-loop`. You run the worker-evaluator cycle against a confirmed Goal Record until the success condition is met, max iterations are reached, or a stop condition triggers.

**Output convention**: Write iteration verdicts to `bcc-output/loops/<goal-id>/iteration-<n>.md`, summary to `summary.md`, final artifact to `final/`. In chat, give the convergence summary and final MET/NOT MET status. See `skills/shared/SKILL.md`.

Parameters

  • First positional argument: a Goal Record id or path (e.g., `goal-1782651000-citations-clean`).
  • `--max-iterations=N`: override the Goal Record's max iterations.
  • `--dry-run`: execute one work step + one verdict, then stop (no looping). Useful for testing.
  • `--resume`: resume a previously stopped loop from the last iteration.
  • `--verbose`: show full verdict details in chat after each iteration (default: show only score + finding count).

**Natural language equivalents**:

  • "esegui il loop" or "run the loop" → start the loop
  • "prova secca" or "dry run" → `--dry-run`
  • "riprendi" or "resume" → `--resume`
  • "massimo 3 giri" or "max 3 rounds" → `--max-iterations=3`

Pre-Flight Checks

Before starting the loop, verify:

1. **Goal Record exists and is confirmed.** If not found or status is not `confirmed`, refuse:

   ERROR: Goal Record <id> not found or not confirmed.
   Run /legal-goal to define and confirm a goal first.

2. **Worker-evaluator separation.** The evaluator agent/role MUST differ from the worker. If they resolve to the same agent:

   REFUSED: worker and evaluator resolve to the same agent/role (<name>).
   The loop cannot proceed. Use /legal-goal to assign a distinct evaluator.

3. **Target artifact or context exists.** The inputs specified in the Goal Record must be accessible.

Iteration Cycle

Step 1: Privacy Pre-Check

Run the local Ollama privacy classifier on any content that would be sent to cloud MCP tools in this iteration.

  • If `privacy_mode = strict` and privileged content is detected: **HALT immediately**.
  HALTED: Privacy violation detected. Privileged content (Anwaltsgeheimnis)
  would cross a boundary disallowed by strict mode. Loop stopped.
  Manual review required before proceeding.
  • If `privacy_mode = balanced`: route privileged content through local tools only; cloud tools receive sanitised content.
  • If `privacy_mode = cloud`: proceed (user has explicitly accepted cloud processing).

The privacy check runs EVERY iteration, not just the first.

Step 2: Work Step

Invoke the worker agent/command to produce or revise the artifact.

  • **First iteration**: worker produces the initial artifact from the Goal Record inputs.
  • **Subsequent iterations**: worker receives the previous iteration's FAIL findings as instructions. The worker is told precisely what is still wrong and must fix exactly those issues. The worker does NOT see the score or pass/fail status — only the findings list.

The worker operates under all existing BetterCallClaude rules:

  • R1 (no self-constructed citation strings) is enforced
  • R2 (no quotation without verbatim source) is enforced
  • Privacy routing applies
  • Output conventions apply

Step 3: Verdict Step

Invoke the evaluator (the `legal-evaluator` skill) which: 1. Runs the substantive citation gate (`citation-content-ver

Read more
@fedec65
Ships withbettercallclaude

A powerful plugin for Claude Cowork Desktop, designed specifically for Swiss legal professionals. 20 agents, 14 skills, and 9 MCP servers — automate research, draft documents, and navigate complex legal landscapes with AI-powered precision.

4617 skills21 agents10 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
46
Star history of fedec65/bettercallclaude on GitHub, a chart by star-history.com

Other commands on bettercallclaude.

adversarial

adversarial

Command

Run three-agent adversarial analysis -- advocate builds the case, adversary challenges it, judicial analyst synthesizes

briefing

briefing

Command

Structured pre-execution briefing session -- collects case context through specialist panel, builds execution plan, supports…

cantonal

cantonal

Command

Analyze cantonal law for all 26 Swiss cantons -- cantonal court decisions, cantonal legislation, procedural specifics, and…

cite

cite

Command

Validate, format, and look up Swiss legal citations including BGE/ATF/DTF decisions and statutory references

create-workflow

create-workflow

Command

Create a reusable custom workflow by combining BetterCallClaude agents. Interview-based: pick agents, order them, define the…

doc-analyze

doc-analyze

Command

Analyze Swiss legal documents -- identify legal issues, extract key clauses, verify citations, and assess compliance

More commands from other plugins.

plan

plan

Command

Plan n8n Linear ticket implementation

n8n12d209k
@n8n-io@n8n-ioInstall Command
setup

setup

Command

One-time setup after installing ARIS as a Claude Code plugin — registers the Codex reviewer MCP server from the plugin directory…

aris13d18k
@wanshuiyin@wanshuiyinInstall Command
agent
Auto-invoked

agent

Command

name: sc:agent description: SC Agent — session controller that orchestrates investigation, implementation, and review category:…

@galaxy-dawn@galaxy-dawnInstall Command