Metadata-Version: 2.4
Name: nb-margin
Version: 0.4.1
Summary: Annotate notebook cells and have Claude Code edit them
Project-URL: Homepage, https://github.com/anthropics/nb-margin
License: MIT License
        
        Copyright (c) 2024 Anthropic
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Framework :: Jupyter
Classifier: Framework :: Jupyter :: JupyterLab
Classifier: Framework :: Jupyter :: JupyterLab :: 4
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Requires-Dist: jupyter-server>=2.0.0
Description-Content-Type: text/markdown

# nb-margin

A JupyterLab 4 extension that lets you annotate notebook cells with comments and submit them to [Claude Code](https://docs.anthropic.com/en/docs/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](https://docs.anthropic.com/en/docs/claude-code) CLI installed and available on `$PATH`

## Install

```bash
pip install nb-margin
```

## Development

```bash
# 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

```bash
pip uninstall nb-margin
```

## License

MIT
