notebook-cli

notebook-cli is a skill for Claude Code, Codex from jupyter-ai-contrib/nb-cli. It costs 73 tokens per session (1,316 once invoked), scanned A, original, BSD-3-Clause.

A command-line tool for reading, editing, creating, searching, and running Jupyter notebooks, which are documents that combine code, text, and results. It also supports connected JupyterLab sessions and remote notebook kernels.

In plain words
What is it for?
Use it to inspect notebook structure, change or remove cells, clear outputs, search content, create notebooks, execute code, and work with local or remote Jupyter sessions.
Why use it?
It gives agents a consistent way to work with notebooks without editing their underlying JSON files directly. Inspecting notebooks before changes also helps avoid altering the wrong cells or losing outputs.

Skill for Claude CodeCodex

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 skills/jupyter-ai-contrib/nb-cli/notebook-cli
Any agent
npx skills add jupyter-ai-contrib/nb-cli --skill notebook-cli
Clone the repo
git clone --depth 1 https://github.com/jupyter-ai-contrib/nb-cli

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/jupyter-ai-contrib/nb-cli/notebook-cli.svg)](https://agentmods.dev/skills/jupyter-ai-contrib/nb-cli/notebook-cli)
Your own site
<a href="https://agentmods.dev/skills/jupyter-ai-contrib/nb-cli/notebook-cli"><img src="https://agentmods.dev/badge/skills/jupyter-ai-contrib/nb-cli/notebook-cli.svg" alt="Measured on agentmods" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,316 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.00073 $0.01316
Opus 5 $0.00036 $0.00658
Sonnet 5 $0.00015 $0.00263
Haiku 4.5 $0.00007 $0.00132

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

Security

Grade A, and why

notebook-cli 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 5d 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.

skills/notebook-cli/SKILL.md · 112 lines

How it starts

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

Notebook CLI

Use nb for every .ipynb operation. Do not read, write, patch, or edit notebook JSON directly when nb can perform the task.

Core Rules

  • Inspect before editing: run nb read <notebook> --no-output unless outputs are relevant.
  • Prefer the default AI-Optimized Markdown output from nb read; use --json only when nbformat JSON is specifically needed.
  • Prefer cell IDs (--cell / -c) for durable edits after inspecting a notebook. Use indexes (--cell-index / -i) for quick positional work; negative indexes are supported.
  • Use --no-output when summarizing structure or source. Include outputs only when diagnosing results, failures, plots, or displayed values.
  • Use stdin (--source -) for multi-line or quoted content to avoid shell escaping mistakes.
  • If the user specifies uv or the workspace is clearly a uv project, treat uv as the notebook execution environment for the whole task. Use --uv on nb commands that support it, such as nb create and nb execute.
  • When creating a notebook with several sections, add cells in batches of roughly 3–5 cells grouped by logical section using multi-cell sentinels (@@markdown, @@code). Execute and verify each batch before adding the next. Do not add the entire notebook in one call — it increases latency and makes errors harder to catch.
  • Every markdown cell must contain a heading and at least one sentence of prose explaining what the following code does or why it matters. A bare heading is not sufficient — see best-practices.md.
  • When notebook code depends on third-party packages, add a dependency-install cell at the top of the notebook before imports if package availability is uncertain.
  • If a uv environment is present, the dependency cell should use !uv pip install ....
  • If a uv environment is not present, the dependency cell should use %pip install ....
  • Run nb <command> --help or nb cell <subcommand> --help when command syntax is uncertain.
  • In connected mode, let nb use the saved connection from nb connect. Do not write secret tokens into commands, prompts, logs, or examples; if auto-detection is unavailable, ask the user to establish the connection manually.
  • Before running non-notebook Python commands that should match the active notebook environment, use nb status --python and run commands through the returned prefix.

Read the full file on GitHub · 112 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 112 lines · 73 tokens per session scan A 201898f05659

Subscribe to this mod's changes

notebook-cli is a skill published in the GitHub repository jupyter-ai-contrib/nb-cli (88 stars, last pushed 29d ago), licensed BSD-3-Clause. It adds 73 tokens to every session and 1,316 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

clinical-case-report

Structured medical case presentation for clinical rounds, conferences, and documentation. Generates SOAP-format or narrative case reports with physiologically accurate vitals, labs, and evidence-based plans. Use when the brief mentions "case report", "case presentation", "SOAP note", "clinical case", "ward rounds"…

nexu-io/open-design · 73 tokens

instrument-data-to-allotrope

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…

anthropics/knowledge-work-plugins · 123 tokens

pydicom

Use pydicom to read, inspect, write, transform, and safely preflight local DICOM datasets and pixel data. Applies to DICOM metadata, transfer syntaxes, compression plugins, frames, private elements, JSON, and bounded de-identification review.

K-Dense-AI/scientific-agent-skills · 56 tokens

nature-experiment-log

标准化实验日志记录——直接上传或读取本地图片、语音和文字,产出带 YAML frontmatter 的 Markdown;可选集成飞书 CLI 与 Obsidian。.

Yuan1z0825/nature-skills · 45 tokens

parsing-ccda-documents

Parses C-CDA / CCD XML clinical documents to extract human-readable section narrative plus coded entries, keyed by section LOINC codes and templateIds. Use before OpenMed processing when ingesting C-CDA R2.1 documents (CCD, Discharge Summary, H&P, Consultation Note) exported from an EHR and you need the narrative…

maziyarpanahi/openmed · 152 tokens

paper-spine

Build, rewrite, audit, submit, revise, or transfer scholarly papers end to end, producing verified LaTeX/PDF/Word and target-specific publication packages.

WUBING2023/PaperSpine · 37 tokens