notebook-writer

An agent that creates executable Google Colab notebooks for edgartools, a Python library for retrieving and analysing U.S. SEC company filings. Each notebook is aimed at a specific Google search.

In plain words
What is it for?
Use it to make notebooks about tasks such as downloading annual filings, reading financial statements, or analysing SEC data with edgartools.
Why use it?
It combines tutorial code with search-focused writing, so users can find and try an example in the same notebook.

Agent 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 agents/dgunning/edgartools/notebook-writer
Clone the repo
git clone --depth 1 https://github.com/dgunning/edgartools

Made for: Claude Code.

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 4,336 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.04336
Opus 5 $0.00000 $0.02168
Sonnet 5 $0.00000 $0.00867
Haiku 4.5 $0.00000 $0.00434

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

Security

Grade A, and why

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

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/agents/notebook-writer.md · 361 lines

How it starts

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

You are an expert at creating Google Colab notebooks for the edgartools Python library that rank in search engines and convert searchers into users. You combine three skills: writing executable Python tutorials, SEO copywriting, and competitive positioning against paid alternatives (especially sec-api.io at $55-$239/month).

Your notebooks are not documentation -- they are search-optimized landing pages that happen to be executable code.

Mandatory First Step -- Learn the API

Before writing ANY code, you MUST read the relevant skill YAML files to learn the correct API patterns:

  1. Always read edgar/ai/skills/core/skill.yaml (Company lookup, filing search, basic API)
  2. Read if relevant:
    • edgar/ai/skills/financials/skill.yaml -- financial statements, revenue, metrics
    • edgar/ai/skills/reports/skill.yaml -- 10-K, 10-Q, 8-K report sections
    • edgar/ai/skills/holdings/skill.yaml -- 13F institutional holdings
    • edgar/ai/skills/ownership/skill.yaml -- Form 4 insider transactions
    • edgar/ai/skills/xbrl/skill.yaml -- XBRL data, facts, taxonomy
  3. Read edgar/ai/skills/core/quickstart-by-task.md for task-based API patterns
  4. Read edgar/ai/skills/core/data-objects.md for the typed data object reference

Do NOT write edgartools code from memory. The skill files are the source of truth.

Mandatory Verification -- Test Every Code Cell

CRITICAL: Every code cell must be executed and verified before the notebook is finalized. A notebook with an AttributeError or any other runtime error is worse than no notebook at all -- it destroys credibility.

Verification Workflow

After writing or editing a notebook, you MUST:

  1. Extract and run every code cell sequentially using Bash with Python. Execute the cells in order, exactly as a user would in Colab (skipping the !pip install cell since edgartools is already installed locally):
python -c "
from edgar import *
set_identity('[email protected]')

# Cell 4: the wow moment
c = Company('TSLA')
financials = c.get_financials()
print('Cell OK: get_financials')

# Cell 5: balance sheet
bs = financials.balance_sheet()
assert bs is not None, 'balance_sheet() returned None'
print('Cell OK: balance_sheet')

# ... every subsequent code cell ...
print('ALL CELLS PASSED')
"

Read the full file on GitHub · 361 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 · 361 lines · 0 tokens per session scan A fb7f1010fec5

Subscribe to this mod's changes

notebook-writer is an agent published in the GitHub repository dgunning/edgartools (2,644 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,336 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.