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
- Open a notebook in JupyterLab
- Select a cell and press Ctrl+Shift+A (or right-click → "Annotate Cell for Claude")
- Describe the change you want in the dialog
- Annotate as many cells as you like — annotations accumulate in the sidebar
- Press Ctrl+Shift+Enter (or click "Submit to Claude Code")
- Claude Code edits the
.ipynbfile 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c459468add6e7aafa508dfb7c6b4988d3bb6f7bdb4c3b6ddeeb6d4e94d7ead80
|
|
| MD5 |
0fa977ea08bf4f3dbdbb3b26fbf8dfb1
|
|
| BLAKE2b-256 |
74af1a989d703d3bcbb2dc33079e0060b9cd176cb903e1cfcc158aaad52eb0ab
|
Provenance
The following attestation bundles were made for nb_margin-0.4.1.tar.gz:
Publisher:
deploy.yml on efueyo/nb-margin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nb_margin-0.4.1.tar.gz -
Subject digest:
c459468add6e7aafa508dfb7c6b4988d3bb6f7bdb4c3b6ddeeb6d4e94d7ead80 - Sigstore transparency entry: 952143483
- Sigstore integration time:
-
Permalink:
efueyo/nb-margin@770fb11c558513178b460509c6fea4674c455ab2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/efueyo
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@770fb11c558513178b460509c6fea4674c455ab2 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6d663c1114757539c309627c56da3dc537d9fca7b1ae97937f19f52479e287e
|
|
| MD5 |
2592a3de2c181e8f02b34e77904478bd
|
|
| BLAKE2b-256 |
d697b14941431505a39f57b6219eb95c130a97376d00d45da5846573164626a8
|
Provenance
The following attestation bundles were made for nb_margin-0.4.1-py3-none-any.whl:
Publisher:
deploy.yml on efueyo/nb-margin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nb_margin-0.4.1-py3-none-any.whl -
Subject digest:
b6d663c1114757539c309627c56da3dc537d9fca7b1ae97937f19f52479e287e - Sigstore transparency entry: 952143498
- Sigstore integration time:
-
Permalink:
efueyo/nb-margin@770fb11c558513178b460509c6fea4674c455ab2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/efueyo
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@770fb11c558513178b460509c6fea4674c455ab2 -
Trigger Event:
push
-
Statement type: