Skip to main content

Codebind

Codebind turns an ordinary IPython session into a durable model harness with one tool: an IPython cell executed in the active session. IPython owns execution, namespace, history, magics, tracebacks, and rich display; Codebind owns conversation state and model orchestration.

Installation

uvx codebind

Or install it with any Python package installer:

pip install codebind

Configuration

Codebind reads its private model choice from $XDG_CONFIG_HOME/codebind/configuration.json, or ~/.config/codebind/configuration.json when XDG_CONFIG_HOME is unset:

{
  "model": "openai/gpt-5.6-luna",
  "parameters": {
    "reasoning_effort": "medium"
  }
}

Provider credentials use the same XDG directory in models.json. Keep both files readable only by their owner. Loading Codebind does not add chat, model, models, Models, or any other variable to the IPython namespace.

Terminal IPython

Start a new conversation:

uvx codebind

Press Shift+Tab to switch the prompt into Question mode; the prompt turns purple. Type a question and press Enter to send it. Press Shift+Tab again to return to Python mode. Ordinary Tab completion is unchanged.

The %question and %%question magics remain available:

%%question
Inspect this project and tell me what to implement first.

Terminal conversations remain live for the current IPython process. Previous terminal inputs and outputs, including Python cells you ran yourself, enter the model's context when you ask a question. Durable automatic resumption belongs to notebooks, where the notebook file provides an unambiguous conversation identity. Model-executed cells appear with IPython's native input counter, syntax highlighting, output prompts, streams, and tracebacks. Assistant Markdown appears before the following tool cell, and tool output appears as it is written. To keep terminal scrollback usable, Codebind previews at most three gray output lines, shortening each line after 60 characters with .... Further lines appear as … N more output lines. The complete output remains available to the model and in IPython history; %output 8 opens the full text of cell 8 in IPython's pager. User-entered Python cells keep IPython's normal display behavior. Assistant Markdown is rendered through IPython's terminal MIME renderer. A terminal is a stream rather than a notebook document, so these displays are not editable notebook cells.

JupyterLab

uvx --from jupyterlab --with codebind --with 'nbconvert[webpdf]' jupyter lab

When running an unpublished local checkout, expose both its editable Python source and its current prebuilt frontend:

JUPYTER_PATH=/path/to/codebind/data/share/jupyter \
uvx --refresh --from jupyterlab --with-editable /path/to/codebind \
  --with 'nbconvert[webpdf]' jupyter-lab

Load Codebind in a notebook:

%load_ext codebind

That is the complete setup. Question is a native toolbar toggle, also available with Shift+Tab:

  • Turning it on converts the selected cell into a Question and makes each newly created user cell a Question until the toggle is turned off.
  • Turning it off returns the selected unsent Question to a Python code cell.
  • Codebind-generated tool and answer cells are never converted.
  • Write ordinary Markdown and press Shift+Enter.

Instructions and notebook context

  • Loading the extension stores Codebind's packaged instructions as the conversation's immutable system message in notebook metadata, without showing an instructions cell. Reopening the notebook or restarting its kernel preserves that message.
  • The whole notebook is model context. Before each Question, Codebind snapshots ordinary Markdown, raw, and code cells—including visible text and image outputs, but never the live Python namespace.
  • Images displayed by the model's IPython tool are included in that tool's result. PNG, JPEG, WebP, GIF, and SVG renditions are prepared as model-visible images; unsupported or oversized images are reported as omissions.
  • The first turn records the snapshot. Later turns append only new, changed, removed, or reordered cells. Existing Questions, tool calls, tool results, and answers in the conversation ledger are not duplicated.
  • Image bytes travel in the relevant message; notebook snapshots contain only stable image descriptors. This append-only representation keeps the prior model prefix unchanged for provider caching.

Persistence and notebook behavior

  • Codebind stores the complete LangChain message, notebook-context, and turn ledger in notebook metadata. Reopening the notebook, restarting its kernel, and loading the extension restores the accumulated context automatically.
  • Each assistant Markdown segment is buffered and inserted as one complete native cell as soon as it finishes, before a following tool call completes.
  • Tool executions and assistant answers are appended to the notebook end without changing the user's selection or scroll position. Tool outputs are collapsed by default and expandable through JupyterLab's native output control.

Reliability and editing

  • The conversation ledger validates its structure and each assistant tool call against its single matching result, without a version gate.
  • Interrupted saves finish before a turn is cancelled, preventing a restart from turning a partial write into an orphan tool result. An interrupted tool call is closed with an explicit interrupted result.
  • Temporary model transport failures retry the same Question with a fresh connection; repeated WebSocket failures use HTTP. Invalid requests and authentication failures remain visible errors.
  • If a provider stream is cancelled or fails, Codebind discards that provider session before the next Question while retaining the notebook conversation and stable prompt-cache identity.
  • Sent Question cells, model-authored tool cells, and assistant Markdown cells are non-editable and non-deletable. Draft Questions remain editable until sent. During an active question, Ctrl+C or Jupyter's interrupt button cancels the agent loop; a kernel interrupt is used only if cooperative cancellation does not finish.

Markdown and other frontends

  • Question and assistant Markdown supports $...$, $$...$$, \(...\), and \[...\] through JupyterLab's native MathJax renderer.
  • Other IPython frontends retain standard MIME display, syntax-highlighted code, Markdown, stdout, tracebacks, rich results, and native IPython history.

ChatGPT account access

  • Models Provider owns OpenAI account authorization and token refresh.
  • Save the resulting provider-values object in Codebind's XDG models.json; Codebind loads it privately when the extension starts.
  • ChatGPT subscription access is separate from the public, pay-as-you-go OpenAI API and may require compatibility updates when the account protocol changes.

Release files for codebind 0.6.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codebind 0.6.11
File Size Uploaded
codebind-0.6.11.tar.gz 88.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for codebind 0.6.11
File Interpreter ABI Platform
codebind-0.6.11-py3-none-any.whl Python 3 none any Details

Total release size: 135.6 kB

Release files / codebind-0.6.11.tar.gz

Download URL codebind-0.6.11.tar.gz
Size 88.2 kB
Tags Source
SHA-256 checksum
How to use checksums
69118a3f108744fc917290593b4e1735f34686fb2b1bc577e8078437a1b5ff18
BLAKE2b-256 checksum
How to use checksums
aa05afc05c5b8922b9cd1a1522c36deb6dc50457e72d1346831d49be95a7c39a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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 Sep 25, 2026.

Transparency log

Release files / codebind-0.6.11-py3-none-any.whl

Download URL codebind-0.6.11-py3-none-any.whl
Size 47.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b09a470d64ebae94cf47bbf5b4d22d3522dce6af21aabfd37b195cbb1beef28b
BLAKE2b-256 checksum
How to use checksums
cbe05010ba6739dbf6e8e3402685d583b205c554fe5e0f667ef5f4c296e94416
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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 Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.11 This release

2 release files

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page