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.4.1.tar.gz (228.7 kB 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.4.1-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nb_margin-0.4.1.tar.gz
  • Upload date:
  • Size: 228.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nb_margin-0.4.1.tar.gz
Algorithm Hash digest
SHA256 c459468add6e7aafa508dfb7c6b4988d3bb6f7bdb4c3b6ddeeb6d4e94d7ead80
MD5 0fa977ea08bf4f3dbdbb3b26fbf8dfb1
BLAKE2b-256 74af1a989d703d3bcbb2dc33079e0060b9cd176cb903e1cfcc158aaad52eb0ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for nb_margin-0.4.1.tar.gz:

Publisher: deploy.yml on efueyo/nb-margin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: nb_margin-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nb_margin-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6d663c1114757539c309627c56da3dc537d9fca7b1ae97937f19f52479e287e
MD5 2592a3de2c181e8f02b34e77904478bd
BLAKE2b-256 d697b14941431505a39f57b6219eb95c130a97376d00d45da5846573164626a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for nb_margin-0.4.1-py3-none-any.whl:

Publisher: deploy.yml on efueyo/nb-margin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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