close

A command for finishing an SDD work session after checking that the project's required rules and checks pass.

In plain words
What is it for?
It validates the project, updates specification history and indexes, records daily and project logs, and creates a handoff note when work remains.
Why use it?
It reduces the risk of ending with invalid specifications, missing records, or incomplete handoff information.

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/juanklagos/spec-driven-development-template/close
Clone the repo
git clone --depth 1 https://github.com/juanklagos/spec-driven-development-template

Made for: Claude Code.

Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 557 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.00026 $0.00557
Opus 5 $0.00013 $0.00279
Sonnet 5 $0.00005 $0.00111
Haiku 4.5 $0.00003 $0.00056

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

Security

Grade A, and why

close 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/sdd/close.md · 32 lines

What it actually says

Close the working session with validation and full traceability. Respond in the user's language (EN/ES).

  1. Run (root layout; in sidecar projects use ./spec/scripts/...):
    • ./scripts/validate-sdd.sh . --strict
    • ./scripts/check-sdd-policy.sh .
    • ./scripts/check-sdd-gate.sh .
  2. Update traceability:
    • history.md of the active spec (what changed and why).
    • specs/INDEX.md if status/priority changed; regenerate STATUS with ./scripts/generate-status.sh when present.
    • bitacora/diaria/YYYY-MM-DD.md (create from bitacora/templates/DAILY_TEMPLATE.md if missing).
    • bitacora/global/PROJECT_LOG.md (session entry).
    • bitacora/handoffs/ if work stays pending for the next session.
  3. Check for a decision worth recording. Ask only when at least one of these is true — otherwise skip the question silently:
    • the session chose between real alternatives (something else was genuinely on the table),
    • the choice will be expensive to reverse (touches several specs, a migration, a contract, a license, a dependency you now depend on),
    • a future reader would ask "why is it like this?" and the code alone would not answer. If one holds, name the candidate decision in one line and ask the user to confirm; on a yes, record it with /sdd:decision before closing, and reference the new file in history.md and PROJECT_LOG.md. Renaming a variable, fixing a typo or finishing a planned task is not a decision.
  4. End with the session close contract, exactly these seven items:
    • Objective — what this session was about
    • Active spec — which spec was worked
    • Changes — what was modified/created
    • Validation — real output of the scripts (errors/warnings)
    • Risks — anything that could bite later
    • Decision recorded — the file written in bitacora/decisiones/, or "none this session" with one line saying why
    • Next step — the single clearest action for the next session

Report failures honestly: if a validation fails, show it and propose the fix; never mark the session clean when it is not.

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 · 32 lines · 26 tokens per session scan A fa227eb5fc6b

Subscribe to this mod's changes

close is a command published in the GitHub repository juanklagos/spec-driven-development-template (14 stars, last pushed 2d ago), licensed MIT. It adds 26 tokens to every session and 557 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.