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
Release files for nb-margin 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nb_margin-0.4.1.tar.gz | 228.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nb_margin-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 252.3 kB
Release files / nb_margin-0.4.1.tar.gz
| Download URL | nb_margin-0.4.1.tar.gz |
|---|---|
| Size | 228.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c459468add6e7aafa508dfb7c6b4988d3bb6f7bdb4c3b6ddeeb6d4e94d7ead80
|
|
BLAKE2b-256 checksum How to use checksums |
74af1a989d703d3bcbb2dc33079e0060b9cd176cb903e1cfcc158aaad52eb0ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 13, 2026.
Transparency logRelease files / nb_margin-0.4.1-py3-none-any.whl
| Download URL | nb_margin-0.4.1-py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6d663c1114757539c309627c56da3dc537d9fca7b1ae97937f19f52479e287e
|
|
BLAKE2b-256 checksum How to use checksums |
d697b14941431505a39f57b6219eb95c130a97376d00d45da5846573164626a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 13, 2026.
Transparency log