Programming and Software Development

JetBrains Gives AI Agents a Live Jupyter Kernel Inside PyCharm

JetBrains has launched a new Jupyter skill inside PyCharm that allows AI agents to work directly on a live kernel while preserving the state of data and models between cells. The company says tests showed lower costs with Claude Opus 5 during long-running tasks, while the benefit depends on the model and the nature of the task.

2026-08-12
4 min read
160 views
certi.news Editorial Team
JetBrains Gives AI Agents a Live Jupyter Kernel Inside PyCharm

JetBrains announced a new Jupyter skill integrated into PyCharm that allows AI agents to work inside a live Jupyter kernel instead of running commands through a subprocess on the command line. According to the company, this approach preserves variables, data, trained models, and import states between cells, while also preventing .ipynb files from becoming corrupted and reducing unnecessary waiting during long-running tasks.

The skill targets a recurring problem when using coding agents with Jupyter notebooks. Treating the notebook file as ordinary text can lead to its JSON structure being modified in a way that corrupts it, while running code in a subprocess causes the kernel state to disappear as soon as the process ends. As a result, the agent loses the trained model, loaded data frame, or imported libraries and cannot inspect or reuse the state. Outputs may also remain buffered until execution finishes, making it impractical to monitor long-running training jobs.

How the Skill Works Inside PyCharm

The skill exposes PyCharm’s notebook and live-kernel capabilities to the agent through a single MCP wrapper called execute_tool. This wrapper covers creating, modifying, and reading notebooks; running cells; waiting for long-running operations to complete; inspecting the kernel while it is running; and controlling its lifecycle.

The agent writes real Python code inside a cell and then runs it directly in the kernel, so variables, models, and data persist across cells just as they do when using the notebook manually. When a long-running task is executed, the wait_cell_execution tool waits until the cell finishes or reaches a safe limit instead of polling repeatedly according to a fixed timer. The agent also reads only the new portion of streamed output rather than resending the entire growing cell output each time.

Cost Testing and Results

JetBrains tested the skill using 12 tasks from the MLGym machine-learning benchmark, covering classification, regression, and reinforcement learning. Each task requires loading data, training a model, evaluating it, and saving the result. The company compared three modes: Bash only, a Jupyter kernel only, and a combination of the kernel and Bash.

With Claude Opus 5, executing the tasks through the kernel cost $59.09, compared with $67.06 through the shell, or about 12% less. The company says the kernel used more tokens but cost less because it kept the prompt cache active: cache reads accounted for 98% of inputs, compared with 82% in shell mode, with cache reads priced at one-twelfth the cost of creating new memory.

The results indicated that the gain depends on the model and the task. It was clearest with Claude Opus on long-running jobs that preserve state, while the shell was less expensive for short tasks and with Codex models, which already use the cache efficiently. In these cases, the skill’s value is primarily workflow improvement rather than cost reduction.

Usage Limitations and Availability

JetBrains said that one task, Titanic, was affected by contamination in the benchmark, as agents were able to inspect the test set and use it to select the final model. The company says the issue appeared in all three modes, and that excluding the task left the kernel 10% less expensive with Opus, at $56.34 compared with $62.65 through the shell.

The skill does not automatically guarantee that outputs will be saved: an agent ended one experiment after training a good model without saving the submission file. The company recommends adding clear instructions in a context file, such as CLAUDE.md, or within another skill to save the model as soon as the required benchmark is achieved. It also emphasizes that the tool reduces operational waste but does not turn a weak machine-learning approach into a strong solution, as some tasks may still require human intervention.

The skill can be tried through AI Chat in PyCharm 2026.2.1 by asking the agent to work on a notebook, create a notebook, load a dataset, or start training. The development environment also allows users to browse and manage skills, add external libraries from sources such as public GitHub repositories, or import skills prepared for Claude Code or Codex.

News source
JetBrains Blog
Open original source ↗
c
Author

certi.news Editorial Team

What you need to know

JetBrains added a Jupyter skill to PyCharm that lets AI agents work with a live kernel while preserving the state of data and models between cells. According to the company’s tests, the skill reduced costs for some long-running tasks with Claude Opus 5, but the benefit varies by model and task type.

  • The skill operates through a single MCP wrapper called execute_tool, which enables agents to create Jupyter notebooks, edit them, read their contents, run cells, and monitor the kernel.
  • The live kernel preserves variables, data, trained models, and imported libraries between cells.
  • The wait_cell_execution tool reads only newly streamed output during long-running tasks, reducing waiting and the need to resend results.
  • In JetBrains’ test, tasks with Claude Opus 5 cost about $59.09 through a Jupyter kernel, compared with $67.06 through the shell—a reduction of approximately 12%.
  • The benefit was more apparent in long-running, stateful tasks, while the shell was less expensive for some short tasks and with Codex models.
  • The skill can be tried through AI Chat in PyCharm 2026.2.1, but output is not saved automatically, and some tasks may still require human intervention.

FAQ

What problem does the new Jupyter skill address?

It addresses the loss of kernel state when code runs in subprocesses, the risk of corrupting .ipynb files when treating them as plain text, and the difficulty of monitoring long-running tasks.

Does the skill always reduce costs?

No. JetBrains says the reduction depends on the model and task type; it was more apparent with Claude Opus 5 in long-running tasks, while the shell may be less expensive for short tasks and with Codex models.

How can the skill be tried?

It can be tried through AI Chat in PyCharm 2026.2.1 by asking the agent to work on or create a notebook, load data, or start training.

Does the skill automatically save training results?

The skill does not guarantee that outputs will be saved automatically; JetBrains recommends adding clear instructions to save the model or submission file.

In the same category

You may also like

View all news