Notebook Cell Numbers
Persistent cell numbers, editable titles, and a Notebook Outline sidebar for every VS Code notebook.
No more manually counting cells or hunting for the right one — each cell displays its position directly in the status bar, and a sidebar outline lets you jump anywhere instantly.
Works on VS Code, VSCodium, and Code OSS.
Features
- Persistent cell numbers — shown on every cell, both code and markdown
- Editable cell titles — set a custom label per cell, stored in notebook metadata
- Notebook Outline — sidebar panel listing all cells with language icons, execution status, content preview on hover, and click-to-navigate
- Go to Cell command — jump to any cell by number or title from the command palette
- Universal — works with Jupyter notebooks, interactive windows, and any other VS Code notebook type
- Auto-updating — numbers stay correct when cells are added, removed, or reordered
- Fully configurable — control the format string, starting index, and alignment
Notebook Outline
The Notebook Outline panel appears in the Explorer sidebar whenever a .ipynb file is active. It lists every cell with:
- Language icons — code cells show the icon for their language (Python, R, TypeScript, etc.), sourced from your active file icon theme
- Execution status — once a cell has been run, the icon switches to a coloured status indicator matching the notebook's own style: green check for success, red error for failure
- Execution order — the
[n] run count is shown in the description alongside the first line of the cell
- Markdown headings — markdown cell labels strip syntax characters so
## Introduction appears as Introduction
- Hover preview — hover any entry to see a syntax-highlighted preview of the full cell content
- Click to navigate — clicking an entry scrolls the notebook to that cell
Commands
| Command |
Description |
Notebook Cell Numbers: Go to Cell... |
Jump to any cell by number or title |
Notebook Cell Numbers: Edit Cell Title |
Set a custom title for the focused cell |
Settings
| Setting |
Default |
Description |
notebookCellNumbers.enabled |
true |
Show or hide cell numbers |
notebookCellNumbers.startFrom |
1 |
Starting number (0 for zero-indexed) |
notebookCellNumbers.format |
Cell {n} |
Label format — {n} is replaced with the cell number |
notebookCellNumbers.alignment |
left |
Position in the status bar: left or right |
| Format string |
Output |
Cell {n} |
Cell 1, Cell 2, Cell 3 |
In [{n}] |
In [1], In [2], In [3] |
#{n} |
#1, #2, #3 |
[{n}] |
[1], [2], [3] |
Installation from source
# Clone the repository
git clone https://github.com/ostew5/notebook-cell-numbers
cd notebook-cell-numbers
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Package as .vsix (requires vsce)
npx @vscode/vsce package
# Install in VS Code
# Extensions panel → ⋯ menu → "Install from VSIX…"
How it works
The extension uses VS Code's NotebookCellStatusBarItemProvider API to inject a label into every cell's built-in status bar — no custom renderers, no webviews, no DOM manipulation. Cell titles are stored in notebook metadata so they persist with the file. The Notebook Outline is a native VS Code tree view that re-renders automatically as the notebook changes. Language icons are resolved at runtime by reading the active file icon theme's JSON definition, so any SVG-based theme works without configuration.
License
MIT
| |