[BUG] Agentic mode triggered by open-ended questions on .ipynb files — unbounded bash tool use instead of direct response

Resolved 💬 3 comments Opened Mar 13, 2026 by FedericoCarotenuto Closed Mar 17, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

OS: Windows 11 + WSL

Platform: VSCODE Insiders (V 1,11,112) + Claude extension (V 2,1,74)

When asked to perform a specific simple task (e.g.: "add import scikit-learn to cell 1") Claude work as expected with NotebookEdit. When a more open-ended question is asked (e.g.: "in this notebook we're using boresight to spatially match two sensors, but it doesn't work well. What about SIFT?") Claude starts file reading bash loop. This happens also if the notebook is renamed to something like "test.ipynb". The behavior is also weird since the simple commands correctly uses NotebookEdit while the second tries to enter WSL and get a working Python from the microsoft store ignoring the actually functioning conda kernel.

What Should Happen?

Expected a direct conversational answer with code suggestions to a code-related open ended question.

Error Messages/Logs

Claude enters  python3 << 'PYTHON_SCRIPT' reading the whole notebook, spiraling into environment setup. This does NOT happen if simpler framed questions are asked like "add import scikit-learn to cell 1"

Steps to Reproduce

I cannot share my ipynb since it contains sensitive materials but the concept is that's a notebook that loads hyperspectral sensors data and then tries to spatially match them and cross-calibrate them. The whole notebook is below 70 KB size.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2,1,74

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗