wh:close

A command for ending a Wheeler research session by checking the knowledge graph and writing a session summary. It uses Neo4j, a database designed for linked data, and stores the summary in a Markdown file.

In plain words
What is it for?
Use it to find unlinked research entities, propose ways to add their provenance, create a dated session synthesis, and connect that synthesis to the sources it cites.
Why use it?
It finds graph records that lack source links before summarizing the session, helping preserve what happened and where each conclusion came from.

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/maxwellsdm1867/wheeler/close
Clone the repo
git clone --depth 1 https://github.com/maxwellsdm1867/wheeler

Made for: Claude Code.

Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,311 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.00024 $0.04311
Opus 5 $0.00012 $0.02155
Sonnet 5 $0.00005 $0.00862
Haiku 4.5 $0.00002 $0.00431

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

Security

Grade A, and why

wh: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/wh/close.md · 383 lines

How it starts

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

Connectivity Check

Before proceeding: call graph_health. If it returns "status": "offline", STOP. Tell the user Neo4j is not running and provide the remediation steps from the error response. Offer to retry after they start it. Do not continue with other work.

You are Wheeler, ending a research session. You do two things, in order:

  1. Sweep: find graph entities created this session that lack provenance, group them, propose Execution nodes that close the gaps.
  2. Synthesize: write a session synthesis to .plans/SESSION-{date}.md, register it as a Document node, and link it to every source node it cites. The graph is the authoritative record of what happened in this session.

Do the sweep first so the synthesis can cite a fully-linked graph.


Phase 1: Orphan Sweep

1.1 Determine the session window

The session window is "since the last close." Find it via Cypher. Closes with an empty or missing started_at must be excluded: they sort wrong under ORDER BY ... DESC and would silently pull the boundary back to an older close.

MATCH (x:Execution {kind: "close"})
WHERE x.started_at IS NOT NULL AND x.started_at <> ""
RETURN x.started_at AS last_close
ORDER BY x.started_at DESC LIMIT 1
  • If a row returns, use last_close as the window start.
  • If no row, default to the last 24 hours.
  • Remember this timestamp as $since; both phases use it.

Then check for malformed close boundaries. Never fall back silently:

MATCH (x:Execution {kind: "close"})
WHERE x.started_at IS NULL OR x.started_at = ""
RETURN x.id AS id, x.description AS description, x.date AS date

If this returns any rows, warn the scientist before proceeding:

Warning: {N} close Execution(s) have no started_at ([X-xxxx] "{description}"). The window boundary uses the most recent close with a valid timestamp, so this sweep may re-surface nodes already synthesized in a more recent session. Repair with update_node(X-xxxx, started_at=<ISO 8601 timestamp>, allow_provenance=true) if you know when that close ran.

Read the full file on GitHub · 383 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. 2d ago First seen · 383 lines · 24 tokens per session scan A 4d535cf1d285

Subscribe to this mod's changes

wh:close is a command published in the GitHub repository maxwellsdm1867/wheeler (10 stars, last pushed 5d ago), licensed MIT. It adds 24 tokens to every session and 4,311 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-31.