Skip to main content

Annotate notebook cells and have Claude Code edit them

Project description

nb-margin

A JupyterLab 4 extension that lets you annotate notebook cells with comments and submit them to Claude Code for automatic editing — without leaving the browser.

How it works

  1. Open a notebook in JupyterLab
  2. Select a cell and press Ctrl+Shift+A (or right-click → "Annotate Cell for Claude")
  3. Describe the change you want in the dialog
  4. Annotate as many cells as you like — annotations accumulate in the sidebar
  5. Press Ctrl+Shift+Enter (or click "Submit to Claude Code")
  6. Claude Code edits the .ipynb file directly; the notebook reloads when done

Requirements

  • JupyterLab >= 4.0
  • Claude Code CLI installed and available on $PATH

Install

pip install nb-margin

Development

# Clone and install in development mode
git clone https://github.com/anthropics/nb-margin.git
cd nb-margin
pip install -e "."
jupyter labextension develop . --overwrite
jlpm build

# Watch for changes (two terminals)
jlpm watch          # terminal 1
jupyter lab         # terminal 2

Permission modes

The sidebar includes a permission mode selector:

  • Safe (default) — Claude Code can only read and write files
  • Bash — also allows shell commands (for linters, tests, etc.)
  • Skip — no permission restrictions (--dangerouslySkipPermissions)

Set the default via the NB_MARGIN_PERMISSION_MODE environment variable (safe, bash, or skip).

Keyboard shortcuts

Shortcut Action
Ctrl+Shift+A Annotate the active cell
Ctrl+Shift+Enter Submit annotations to Claude Code

Uninstall

pip uninstall nb-margin

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nb_margin-0.1.0.tar.gz (9.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nb_margin-0.1.0-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file nb_margin-0.1.0.tar.gz.

File metadata

  • Download URL: nb_margin-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for nb_margin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 df40d6e75a6179f446991ed85f1d8a9399bf7725e4827bfddf9f44e5b5c3f805
MD5 e5da87d7d8373dedc0fd469a2e3225f2
BLAKE2b-256 c9fec1404facbb4b149666333934c5969b5f619568f53d35945e809606c5d8b2

See more details on using hashes here.

File details

Details for the file nb_margin-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nb_margin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for nb_margin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67a2e09fc522b598b73441177ed8c156d4f1acb8ceeebda24183e0bff5a31724
MD5 17d99e0f8c800020b4b42b0dad4525e8
BLAKE2b-256 1fc0ac799444ebfa3b43b2cdc6dc650884a6f9e92933e222fce976b28fbfd36d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page