jupyter-cc
Jupyter magic for Claude Code -- %cc brings agentic AI into your notebook cells.
jupyter-cc integrates Claude Code directly into Jupyter notebooks as IPython magic commands. Instead of switching between a sidebar or terminal and your notebook, you stay in the notebook: type %cc with a prompt, and Claude reads your variables, executes tools, and creates new code cells for you to review and run.
Built on the Claude Agent SDK with an in-process MCP server, jupyter-cc gives Claude the same agentic capabilities it has in Claude Code CLI -- file editing, shell commands, web search -- plus the ability to create notebook cells.
Example Session
# Cell 1: Load the extension
%load_ext jupyter_cc
# Cell 2: Ask Claude to analyze data
%cc Load the sales.csv file and show summary statistics
# Cell 3: Claude creates a code cell for you to review and run
# ... (auto-generated by Claude)
# Cell 4: Follow up in the same conversation
%cc Now plot monthly revenue trends with a 3-month moving average
Installation
Prerequisites
- Python 3.13+ -- check with
python --version - Claude Code CLI -- install from Claude Code docs, verify with
claude --version - Authentication -- one of:
- Claude Pro/Max subscription
- Anthropic API key
- Jupyter (for notebook usage) or IPython (for terminal usage):
pip install jupyter # or pip install ipython
Install
pip install jupyter-cc
With uv:
uv pip install jupyter-cc
Quick Start
After installation:
# In a Jupyter notebook or IPython session:
%load_ext jupyter_cc
%cc Hello! What can you help me with?
Uninstall
pip uninstall jupyter-cc
Development (for contributors)
If you want to contribute to jupyter-cc, clone the repo and install in development mode:
git clone https://github.com/vinceyyy/jupyter-cc.git
cd jupyter-cc
uv sync
Usage
%load_ext jupyter_cc
Magic Commands
| Command | Alias | Description |
|---|---|---|
%cc <prompt> |
Continue conversation with Claude (one-line) | |
%%cc |
Continue conversation with Claude (multi-line) | |
%cc_new <prompt> |
%ccn |
Start a fresh conversation (no history) |
%cc_cur <prompt> |
%ccc |
Like %cc, but replaces the prompt cell in-place |
Use %%cc (cell magic with double %) when your prompt spans multiple lines or ends with ? (to avoid IPython's help system).
Options
| Option | Description |
|---|---|
--model <name> |
Model to use (default: sonnet) |
--max-cells <num> |
Max cells Claude can create per turn (default: 3) |
--import <file> |
Include a file in the initial conversation context |
--add-dir <dir> |
Add a directory to Claude's accessible paths |
--mcp-config <file> |
Path to .mcp.json with additional MCP server configs |
--cells-to-load <num> |
Number of recent cells to load into a new conversation |
--clean |
Replace prompt cells with Claude's code cells |
--no-clean |
Keep prompt cells (default) |
--verbose, -v |
Show detailed tool call arguments |
--help, -h |
Show usage information |
Skills and Context
The Claude Agent SDK automatically reads configuration from your project and user directories. No extra setup is needed -- just place files in the right locations.
Project-level (checked into your repo):
.claude/CLAUDE.md-- project instructions, coding conventions, architecture notes.claude/settings.local.json-- tool permissions (auto-created on first load).claude/skills/-- project-specific skill files (*.md)
User-level (your personal config):
~/.claude/CLAUDE.md-- global instructions applied to all projects~/.claude/skills/-- personal skills available everywhere
To add a skill, create a Markdown file in .claude/skills/ or ~/.claude/skills/. To customize Claude's behavior for a project, edit .claude/CLAUDE.md in your project root.
For a detailed breakdown of what Claude sees when you run %cc -- variables, cell history, images, system prompt, and more -- see What CC Sees.
Project Structure
src/jupyter_cc/
├── __init__.py # Extension entry point, permissions setup
├── magics.py # %cc, %cc_new, %cc_cur magic commands, MCP server
├── client.py # SDK client lifecycle, streaming, interrupt handling
├── config.py # CLI options (--model, --add-dir, --import, etc.)
├── prompt.py # System prompt construction
├── integration.py # Cell creation, queue management, env detection
├── history.py # IPython cell history tracking
├── variables.py # Session variable change detection
├── capture.py # Image extraction from cell outputs
├── watcher.py # "Run All" detection via timing heuristics
├── constants.py # Help text, tool names
└── py.typed # PEP 561 type marker
Development
uv sync # Install dependencies
uv run ruff check src/ --fix # Lint (auto-fix)
uv run ruff format src/ # Format
uv run pyright src/ # Type check
uv run pytest # Run tests
uv build # Build wheel/sdist
Acknowledgements
jupyter-cc is adapted from:
- notellm by Bryan Daniels
- claude-code-jupyter-staging by Anthropic
Released under the MIT License. See LICENSE.
Metadata
Release files for jupyter-cc 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jupyter_cc-0.2.0.tar.gz | 31.6 kB | Without provenance | Details for jupyter_cc-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jupyter_cc-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for jupyter_cc-0.2.0-py3-none-any.whl |
Total release size: 68.9 kB
Release files / jupyter_cc-0.2.0.tar.gz
| Download URL | jupyter_cc-0.2.0.tar.gz |
|---|---|
| Size | 31.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
593e9f33ebb7d8ee12438ef1384fcbbf764c8c6c3a325124797662d054d71da4
|
|
BLAKE2b-256 checksum How to use checksums |
73ff9fcdd1c42757a516d06fbd0d1abf63d29f8e672ded9aab7456cd64f431bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / jupyter_cc-0.2.0-py3-none-any.whl
| Download URL | jupyter_cc-0.2.0-py3-none-any.whl |
|---|---|
| Size | 37.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d3e340daacadc018c7c536eb2b38e9004f4d5cba0cd0048ad50ac50eccfecfc
|
|
BLAKE2b-256 checksum How to use checksums |
684fdae9580befe094540a351083598091b7bace0256847f5bb33a6ede251f88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for jupyter-cc 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.