test-notebook

test-notebook is a command for Claude Code from gpt-cmdr/ras-commander. It costs 0 tokens per session (1,189 once invoked), scanned A, original, MIT.

A command that runs the notebook you are working on through a notebook-testing helper and reports the results.

In plain words
What is it for?
Use it to validate a notebook during development and receive a complete error report, including warnings about cells that may wait for GUI input.
Why use it?
It helps find execution errors and other problems in a notebook without hiding less serious issues.

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/gpt-cmdr/ras-commander/test-notebook
Clone the repo
git clone --depth 1 https://github.com/gpt-cmdr/ras-commander

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 test-notebook

README.md
[![agentmods](https://agentmods.dev/badge/commands/gpt-cmdr/ras-commander/test-notebook.svg)](https://agentmods.dev/commands/gpt-cmdr/ras-commander/test-notebook)
Your own site
<a href="https://agentmods.dev/commands/gpt-cmdr/ras-commander/test-notebook"><img src="https://agentmods.dev/badge/commands/gpt-cmdr/ras-commander/test-notebook.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,189 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.01189
Opus 5 $0.00000 $0.00594
Sonnet 5 $0.00000 $0.00238
Haiku 4.5 $0.00000 $0.00119

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

Security

Grade A, and why

test-notebook 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 4d 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/test-notebook.md · 144 lines

How it starts

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

Test the notebook currently being worked on using the notebook-runner subagent and report all results back.

Purpose

Force delegation to the notebook-runner subagent for development testing. Use inline when working on a notebook to get comprehensive error reporting back to the main conversation.

When to Use

You are already working on or discussing a notebook in the current conversation. Use this command to:

  • Execute the notebook and validate it works
  • Get ALL errors reported back (not just critical ones)
  • Force proper subagent delegation for thorough testing

Execution

1. Identify the Notebook from Context

Look at the current conversation to determine which notebook is being worked on:

  • Recently edited notebook
  • Notebook being discussed
  • Notebook mentioned in recent file operations

If unclear, ask the user which notebook to test.

2. Preflight: Scan for GUI-Blocking Cells

Before delegating, grep the notebook for GUI automation markers:

  • wait_for_user, open_rasmapper, open_and_compute, run_multiple_plans

If found, warn the user: "This notebook contains GUI automation cells that will block waiting for you to close HEC-RAS. The run will pause at those cells."

3. Resolve the Kernel

Run jupyter kernelspec list to discover available kernels. Select based on context:

Default: Use RasCommander kernel (pip-installed package) to validate end-user experience.

Switch to rascmdr_local only when the current work involves unpublished library changes.

If neither canonical kernel exists: Check for close matches (rascommander, rascmdr, python3). Ask the user which to use if ambiguous, and offer to set one up per .claude/rules/testing/environment-management.md.

4. Delegate to notebook-runner Subagent

You MUST use the Agent tool to delegate this work. The subagent chooses the appropriate execution mode (papermill, nbconvert, or nbmake) based on the goal.

Since /test-notebook is for comprehensive development QA (hide nothing, report all errors), the subagent should use Mode B (nbconvert with allow-errors) to ensure ALL cells execute even after failures. Mode A (papermill) stops at the first error, which misses downstream issues.

Read the full file on GitHub · 144 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. 4d ago First seen · 144 lines · 0 tokens per session scan A e4ea51420b53

Subscribe to this mod's changes

test-notebook is a command published in the GitHub repository gpt-cmdr/ras-commander (79 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,189 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.