notebook-graph

notebook-graph is a command for coding agents from MarcosNahuel/antigravity-plugin-cc. It costs 95 tokens per session (636 once invoked), scanned A, original, MIT.

A command that turns a notebook knowledge base into a node-and-link graph: a JSON data file and a self-contained interactive HTML page. It finds links from entities appearing together in documents and from explicitly recorded relationships.

In plain words
What is it for?
Use it to inspect connected people, organisations, references, and documents, identify central entities, and open an interactive graph of an existing `notebook.db`.
Why use it?
It provides a local visual way to see connections even when the knowledge base contains few explicitly defined relationships, without calling an AI service or installing extra dependencies.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the antigravity plugin — 2 skills, 22 commands, 1 agent shipped together

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/marcosnahuel/antigravity-plugin-cc/notebook-graph
Clone the repo
git clone --depth 1 https://github.com/MarcosNahuel/antigravity-plugin-cc

Or install antigravity, the plugin that ships this one along with the rest of its 2 skills, 22 commands, 1 agent.

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-graph

README.md
[![agentmods](https://agentmods.dev/badge/commands/marcosnahuel/antigravity-plugin-cc/notebook-graph.svg)](https://agentmods.dev/commands/marcosnahuel/antigravity-plugin-cc/notebook-graph)
Your own site
<a href="https://agentmods.dev/commands/marcosnahuel/antigravity-plugin-cc/notebook-graph"><img src="https://agentmods.dev/badge/commands/marcosnahuel/antigravity-plugin-cc/notebook-graph.svg" alt="Measured on agentmods" height="20"></a>
Per session 95 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 636 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.00095 $0.00636
Opus 5 $0.00048 $0.00318
Sonnet 5 $0.00019 $0.00127
Haiku 4.5 $0.00010 $0.00064

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

Security

Grade A, and why

notebook-graph 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.

plugins/antigravity/commands/notebook-graph.md · 44 lines

How it starts

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

Build a graph view of the notebook.db that /agy:notebook compiled — instantly, locally, free. agy rarely fills the explicit relaciones array, so this derives edges from entity co-occurrence within each document (the relational signal that needs no LLM) plus any explicit relations present.

Raw user request: $ARGUMENTS

Phase 0 — Build the graph (ONE Bash call)

Resolve OUTDIR = docs/agy/notebook/<slug> from the folder (same slug() the notebook uses). If notebook.db is missing, tell the user to run /agy:notebook <folder> | <objetivo> first. Then:

python "${CLAUDE_PLUGIN_ROOT:-$PWD}/plugins/antigravity/scripts/notebook_graph.py" "$OUTDIR"

It prints GRAPH nodes=N edges=M (cooccur=…, explicit=…) hubs=[…] and writes <OUTDIR>/graph.json (node-link) + <OUTDIR>/graph.html (self-contained interactive viz, vis-network from CDN).

Phase 1 — Present + reason

  • Report the node/edge counts and the hub entities (most connected — your central people / orgs / references). Point the user to graph.html for the interactive view.
  • Nodes are deduped entities (persona | organizacion | referencia) + document nodes; edges are appears_in (entity→document), co_mentioned (entities sharing a document, weighted by # docs), and any explicit relations.
  • To answer a question, read graph.json directly (small) — e.g. neighbours of an entity, shortest path between two, or the densest cluster — instead of re-reading the source documents.

Notes

  • Zero agy calls, zero new deps — pure stdlib over the existing notebook.db. Re-run after a fresh /agy:notebook to refresh.
  • vs /agy:graph: this graphs the document/entity network from your notebook RAG (free, local); /agy:graph uses Graphify (Gemini via agy) for richer graphs incl. code (tree-sitter ASTs) and Leiden communities. Use this for a quick document graph, /agy:graph for code or deep graphs.
  • For exact aggregates (amounts, timelines) use /agy:notebook-query.

Read the full file on GitHub · 44 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 · 44 lines · 95 tokens per session scan A bd3f39261571

Subscribe to this mod's changes

notebook-graph is a command published in the GitHub repository MarcosNahuel/antigravity-plugin-cc (26 stars, last pushed 19d ago), licensed MIT. It adds 95 tokens to every session and 636 once invoked, about $0.0005 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.