<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Pawel Piecuch</title>
    <description>The latest articles on Forem by Pawel Piecuch (@pablo72).</description>
    <link>https://forem.com/pablo72</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2869474%2F2638597d-4e4f-4a42-8321-abe7ab00fd3e.jpg</url>
      <title>Forem: Pawel Piecuch</title>
      <link>https://forem.com/pablo72</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/pablo72"/>
    <language>en</language>
    <item>
      <title>padb: A TUI for Android Debugging That Lives in Your Terminal</title>
      <dc:creator>Pawel Piecuch</dc:creator>
      <pubDate>Mon, 04 May 2026 08:19:08 +0000</pubDate>
      <link>https://forem.com/pablo72/padb-a-tui-for-android-debugging-that-lives-in-your-terminal-3h9c</link>
      <guid>https://forem.com/pablo72/padb-a-tui-for-android-debugging-that-lives-in-your-terminal-3h9c</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9p6tk6fzthewxdemqntz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9p6tk6fzthewxdemqntz.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you've spent any time doing Android development from the command line, you know the rhythm: &lt;code&gt;adb devices&lt;/code&gt;, &lt;code&gt;adb logcat&lt;/code&gt;, &lt;code&gt;adb shell&lt;/code&gt;, repeat. It works, but it's friction — switching between windows, retyping device serials, manually grep-ing through logcat noise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;padb&lt;/strong&gt; is a Python-based terminal UI that wraps all of that into one interactive session. No GUI required, no Android Studio open in the background.&lt;/p&gt;




&lt;h2&gt;
  
  
  What it is
&lt;/h2&gt;

&lt;p&gt;padb runs in your terminal and gives you three things at once:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;interactive shell&lt;/strong&gt; for ADB commands with history and autocompletion&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live logcat&lt;/strong&gt; with regex filtering and color-coded log levels, running in the bottom half of your screen&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;two-panel file commander&lt;/strong&gt; (Norton Commander-style) for pushing and pulling files between your machine and the device&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It handles both USB and wireless devices, including Android 11+ wireless pairing.&lt;/p&gt;




&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/yourusername/padb
&lt;span class="nb"&gt;cd &lt;/span&gt;padb
pip3 &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
python3 main.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Requirements: Python 3.11+, &lt;code&gt;adb&lt;/code&gt; in PATH (or Android SDK installed).&lt;/p&gt;

&lt;p&gt;On launch, padb auto-detects connected devices. One device → connects immediately. Multiple devices → shows a selection menu. No devices → waiting screen with background auto-reconnect.&lt;/p&gt;




&lt;h2&gt;
  
  
  The shell
&lt;/h2&gt;

&lt;p&gt;The top half of the screen is an interactive ADB shell. Type any shell command and it runs on the device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;ls&lt;/span&gt; /sdcard/Download
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; pm list packages | &lt;span class="nb"&gt;grep &lt;/span&gt;com.example
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; dumpsys battery
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's command history (persisted to &lt;code&gt;.padbrc&lt;/code&gt; between sessions) and context-aware suggestions.&lt;/p&gt;

&lt;p&gt;The real time-saver is &lt;strong&gt;meta commands&lt;/strong&gt; — prefixed with &lt;code&gt;@&lt;/code&gt;, they run common operations without leaving the shell:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@install app.apk&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Install APK from local path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@pull /sdcard/file.txt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Pull file to current directory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@push ./local.txt /sdcard/&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Push local file to device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@screenshot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Take screenshot, save locally&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@reboot&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reboot the device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@connect 192.168.1.100&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Connect to a wireless device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@pair 192.168.1.100:12345&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Pair with Android 11+ pairing code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@discover&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Auto-discover devices via mDNS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@saved&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List remembered wireless IPs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@forget 192.168.1.100&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Remove a saved wireless IP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Live logcat
&lt;/h2&gt;

&lt;p&gt;The bottom panel streams logcat in real time. You can filter by regex without stopping the stream — the filter applies to all incoming lines immediately.&lt;/p&gt;

&lt;p&gt;Log levels get distinct colors: verbose is dim, debug is cyan, info is green, warning is yellow, error is red. On a busy app this makes a real difference when you're scanning for a specific error.&lt;/p&gt;




&lt;h2&gt;
  
  
  File commander
&lt;/h2&gt;

&lt;p&gt;Press &lt;code&gt;F&lt;/code&gt; to open the file commander. Left panel shows your local filesystem, right panel shows the device filesystem. Navigate with arrow keys, &lt;code&gt;Enter&lt;/code&gt; to descend, &lt;code&gt;Backspace&lt;/code&gt; to go up. Tab switches between panels.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;C&lt;/code&gt; copies the selected file across panels (local→device or device→local). That's the main workflow: browse to what you need, copy it over.&lt;/p&gt;




&lt;h2&gt;
  
  
  Wireless workflow
&lt;/h2&gt;

&lt;p&gt;For wireless debugging, padb stores connected device IPs in &lt;code&gt;~/.padb_wireless.json&lt;/code&gt; and tries to reconnect them automatically every time it starts. If the device is on the same network, you typically don't need to do anything — it just connects.&lt;/p&gt;

&lt;p&gt;For first-time wireless setup:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Android 11+ (recommended):&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Enable wireless debugging in developer options&lt;/li&gt;
&lt;li&gt;Tap "Pair device with pairing code" — note the IP:port and 6-digit code&lt;/li&gt;
&lt;li&gt;In padb shell: &lt;code&gt;@pair 192.168.1.100:12345&lt;/code&gt; then enter the code&lt;/li&gt;
&lt;li&gt;After pairing: &lt;code&gt;@connect 192.168.1.100&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Legacy tcpip mode:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connect USB, then: &lt;code&gt;@tcpip&lt;/code&gt; (enables TCP on port 5555 and prints the device IP)&lt;/li&gt;
&lt;li&gt;Disconnect USB, then: &lt;code&gt;@connect 192.168.1.100&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After either method, the IP is saved and auto-reconnected on future launches.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;mDNS discovery&lt;/strong&gt; (&lt;code&gt;@discover&lt;/code&gt; or press &lt;code&gt;D&lt;/code&gt; from the waiting screen) works when your device advertises itself on the local network — useful for Android 11+ wireless debugging without knowing the IP.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why terminal
&lt;/h2&gt;

&lt;p&gt;The short answer: it stays out of the way. No IDE startup time, no separate window to manage. If you're already working in the terminal — running builds, checking git — padb fits into that flow without switching context.&lt;/p&gt;

&lt;p&gt;The longer answer: logcat + shell in a split view changes how you debug. You trigger something in the shell and watch the log response in the same window, without alt-tabbing. It sounds small, but the tight feedback loop adds up over a day of debugging.&lt;/p&gt;




&lt;h2&gt;
  
  
  Current state
&lt;/h2&gt;

&lt;p&gt;padb is actively developed. The core features — shell, logcat, file commander, wireless — are solid for daily use. The project is MIT licensed and contributions are welcome.&lt;/p&gt;

&lt;p&gt;Source: &lt;a href="https://github.com/yourusername/padb" rel="noopener noreferrer"&gt;github.com/yourusername/padb&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built with Python, curses, and adbutils. Tested on macOS and Linux.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>cli</category>
      <category>python</category>
      <category>tooling</category>
    </item>
    <item>
      <title>I put Claude inside Blender's Text Editor</title>
      <dc:creator>Pawel Piecuch</dc:creator>
      <pubDate>Sat, 02 May 2026 15:17:46 +0000</pubDate>
      <link>https://forem.com/pablo72/i-put-claude-inside-blenders-text-editor-2meo</link>
      <guid>https://forem.com/pablo72/i-put-claude-inside-blenders-text-editor-2meo</guid>
      <description>&lt;p&gt;I got tired of the alt-tab loop. Write a Blender script. Hit an error. Switch to a browser. Paste the traceback to Claude. Copy the fix back. Re-run. Repeat.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://piecuchp.gumroad.com/l/blenderclaude" rel="noopener noreferrer"&gt;Claude Code for Blender&lt;/a&gt;, an extension that puts Claude in the Text Editor's sidebar with the active script as automatic context, scene-aware tools, and the ability to actually run the Python it generates. Here's what I learned building it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F098ga2z6aqfnwt8vwgvx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F098ga2z6aqfnwt8vwgvx.png" alt=" " width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The shape of the thing
&lt;/h2&gt;

&lt;p&gt;The extension is pure Python — no native dependencies, no build step. About 5,200 lines across 12 files, packaged as a Blender 4.2+ extension manifest. You drop the folder into your extensions directory, enable it in preferences, hit &lt;code&gt;N&lt;/code&gt; in the Text Editor, and Claude shows up next to your code.&lt;/p&gt;

&lt;p&gt;Two things made it more than a chat wrapper:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Claude can run code in your Blender session&lt;/strong&gt; — with undo support, and if the code raises an exception, the traceback gets sent back automatically and Claude tries again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude can edit your text blocks as if they were files on disk&lt;/strong&gt; — not by generating diffs you copy-paste, but by actually opening and writing them.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The second part is where the interesting engineering lives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two backends, one UI
&lt;/h2&gt;

&lt;p&gt;I shipped with two backends and a toggle to switch between them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CLI backend&lt;/strong&gt; — shells out to &lt;code&gt;claude -p&lt;/code&gt; (the Claude Code CLI in headless mode). Uses your existing Pro/Max/Team subscription. No API key required.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API backend&lt;/strong&gt; — direct calls to the Messages API with prepaid credits. Implements its own agentic tool-use loop with Blender-specific tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why both? Because the constraints are different. With the CLI, you're piggybacking on a subscription you might already pay for, and you get all of Claude Code's built-in tools (Read, Edit, Write, Glob, Grep, Bash) for free. With the API, you can give Claude tools that talk directly to &lt;code&gt;bpy&lt;/code&gt; — &lt;code&gt;create_object&lt;/code&gt;, &lt;code&gt;add_modifier&lt;/code&gt;, &lt;code&gt;setup_camera&lt;/code&gt;, &lt;code&gt;set_render_settings&lt;/code&gt; — instead of going through generated Python every time.&lt;/p&gt;

&lt;p&gt;The CLI route turned out trickier than the API route, which surprised me. More on that below.&lt;/p&gt;

&lt;h2&gt;
  
  
  The main-thread problem
&lt;/h2&gt;

&lt;p&gt;Blender has one rule that shapes everything: &lt;code&gt;bpy.*&lt;/code&gt; calls only work on the main thread. If you call them from anywhere else you either get garbage state or a segfault.&lt;/p&gt;

&lt;p&gt;That's a problem when your AI assistant streams responses for thirty seconds and you don't want the UI to freeze. So the extension runs the request on a background thread and uses Blender's &lt;code&gt;bpy.app.timers&lt;/code&gt; to dispatch back to the main thread.&lt;/p&gt;

&lt;p&gt;The bridge is small but it earns its place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MainThreadBridge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_queue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Queue&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_lock&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;threading&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Lock&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_streaming_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;execute_on_main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Run fn on main thread, block bg thread until done, return result.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="n"&gt;holder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_ResultHolder&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

        &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_wrapper&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
            &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;holder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;holder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;_queue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_wrapper&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;holder&lt;/span&gt;  &lt;span class="c1"&gt;# caller does holder.wait()
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A timer drains the queue every tick. Streaming text deltas use a separate lock-protected string so the UI redraw can read the latest chunk without serializing through the queue. Tool calls use the blocking variant — the background thread parks on &lt;code&gt;_event.wait()&lt;/code&gt; while Blender executes the tool and returns the result.&lt;/p&gt;

&lt;p&gt;One subtle gotcha: &lt;code&gt;bpy.context&lt;/code&gt; inside a timer callback has no &lt;code&gt;window&lt;/code&gt;, &lt;code&gt;screen&lt;/code&gt;, or &lt;code&gt;area&lt;/code&gt;. If the tool needs UI context (switching the active text block, redrawing a region), you have to wrap it in &lt;code&gt;temp_override()&lt;/code&gt;. I lost an afternoon to that one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The text-block VFS
&lt;/h2&gt;

&lt;p&gt;Here's the part I'm proud of.&lt;/p&gt;

&lt;p&gt;Blender's Text Editor stores scripts as in-memory &lt;code&gt;bpy.types.Text&lt;/code&gt; datablocks. They're not files. They have no path. Claude Code CLI, on the other hand, expects to operate on files — that's what its Read/Edit/Write tools do.&lt;/p&gt;

&lt;p&gt;So I wrote a small virtual filesystem that mirrors text blocks to disk:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On request, every text block in the .blend gets written to &lt;code&gt;/tmp/blender_claude/&amp;lt;blend_name&amp;gt;/&amp;lt;block_name&amp;gt;.py&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The CLI runs with &lt;code&gt;cwd&lt;/code&gt; set to that directory, so when Claude says "read &lt;code&gt;my_script.py&lt;/code&gt;", the file is right there.&lt;/li&gt;
&lt;li&gt;After the response completes, the workspace is scanned and changes are synced back to Blender's text blocks.&lt;/li&gt;
&lt;li&gt;A background poll fires every two seconds to catch external edits and keep the two sides in sync.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The trick is that Claude doesn't need to know it's not editing real files. From its perspective the workspace looks like any other project directory. It uses Glob to find scripts, Edit to do find-and-replace, Write to create new ones. All of that just works, and the extension translates it back to Blender state on the way out.&lt;/p&gt;

&lt;p&gt;A few text-block names are reserved and excluded from the sync:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@Prompt@&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Multi-line prompt buffer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;@CLAUDE.md@&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Per-project instructions, prepended to the system prompt&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;^...&lt;/code&gt; (caret prefix)&lt;/td&gt;
&lt;td&gt;Local scratch blocks, never synced&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;@CLAUDE.md@&lt;/code&gt; is the one users seem to like most. You write project-specific rules ("always validate with &lt;code&gt;compile()&lt;/code&gt; before &lt;code&gt;exec()&lt;/code&gt;", "prefer modifiers to bmesh", "this scene is for a music video, keep things stylized"), and they ride along with every prompt for that .blend file.&lt;/p&gt;

&lt;h2&gt;
  
  
  The agentic loop on the API side
&lt;/h2&gt;

&lt;p&gt;For the API backend, I wrote a simple tool-use loop:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Send messages to /v1/messages with stream=True and the tool catalog.
2. Read SSE deltas: text → push to UI, tool_use → buffer the input JSON.
3. On message_complete, if stop_reason == "tool_use":
     - Run each tool on the main thread via the bridge.
     - Append the assistant message + tool_result content to messages.
     - Loop back to step 1.
   Otherwise: done.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Streaming responses are the easy part — &lt;code&gt;requests&lt;/code&gt; with &lt;code&gt;stream=True&lt;/code&gt;, parse SSE lines, push text deltas to the UI immediately. The harder part is buffering partial tool input. Anthropic streams tool inputs as &lt;code&gt;partial_json&lt;/code&gt; deltas, so you accumulate the string, parse it once on &lt;code&gt;content_block_stop&lt;/code&gt;, and only then dispatch.&lt;/p&gt;

&lt;p&gt;The tools themselves are scoped narrowly. I started with a single &lt;code&gt;execute_python&lt;/code&gt; tool and let Claude write code for everything. That worked, but it was slower (extra round-trips for code generation), more error-prone (subtle &lt;code&gt;bpy&lt;/code&gt; 4.0+ API changes broke things), and harder to undo. So I added dedicated tools for the boring 80%: create an object, add a modifier, assign a material, set up a camera. Claude reaches for those first and only falls back to &lt;code&gt;execute_python&lt;/code&gt; for genuinely custom logic.&lt;/p&gt;

&lt;p&gt;That single decision — preferring narrow tools over a code-execution sledgehammer — was the biggest quality win.&lt;/p&gt;

&lt;h2&gt;
  
  
  Error self-correction
&lt;/h2&gt;

&lt;p&gt;When &lt;code&gt;execute_python&lt;/code&gt; raises, the tool result includes the traceback. Claude reads it, sees what broke, and writes a fix. No human in the loop.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;exec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;claude&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;exec&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;namespace&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ok&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;error&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;traceback&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;traceback&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format_exc&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details matter here. First, &lt;code&gt;compile()&lt;/code&gt; before &lt;code&gt;exec()&lt;/code&gt; — this catches syntax errors with line numbers so Claude can see exactly where the problem is. Second, every execution wraps &lt;code&gt;bpy.ops.ed.undo_push()&lt;/code&gt; so a single chat turn is one undo step. If Claude breaks your scene, one Ctrl+Z makes it whole again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Blender 4.0+ API gotchas
&lt;/h2&gt;

&lt;p&gt;Claude knows Python. Claude doesn't necessarily know that Blender 4.0 renamed half the Principled BSDF sockets, or that &lt;code&gt;mat.blend_method&lt;/code&gt; became &lt;code&gt;mat.surface_render_method&lt;/code&gt;, or that &lt;code&gt;mesh.use_auto_smooth&lt;/code&gt; doesn't exist anymore. Without guidance, it confidently writes code that worked in 3.6 and fails on 4.2.&lt;/p&gt;

&lt;p&gt;The fix is mundane: a chunk of API migration notes baked into the system prompt, plus runtime detection of the actual Blender/Python version so Claude knows what it's targeting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Blender version: 4.2.3
Python version: 3.11.7
Critical 4.0+ migrations:
- Principled BSDF: "Subsurface" → "Subsurface Weight", "Specular" → "Specular IOR Level", ...
- Material: mat.blend_method → mat.surface_render_method
- Mesh: removed use_auto_smooth, use bpy.ops.object.shade_auto_smooth instead
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boring, but it cut the failure rate on first-attempt scripts dramatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;The CLI backend is the most popular path with users (subscription + zero setup), but it's also where I've spent the most debugging time. Sessions go stale. The CLI's NDJSON event format isn't documented as a public interface, so I had to read it empirically and add fallbacks for unknown event types. Bidirectional file sync is racy at the edges — if the user edits a text block while Claude is also editing the mirrored file, last write wins, and "last" depends on the poll interval.&lt;/p&gt;

&lt;p&gt;If I were starting again I'd probably build the API backend first, ship it, and add the CLI later as the second backend rather than the default. The API path is more constrained but more honest about what's happening, and the agentic loop with narrow tools is genuinely good.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Available on &lt;a href="https://piecuchp.gumroad.com/l/blenderclaude" rel="noopener noreferrer"&gt;Gumroad&lt;/a&gt; for $10. Works with Blender 4.2+ and Bforartists 4.2+. You'll need a Claude subscription (CLI backend) or API credits (API backend). Licensed GPL-3.0; the repo is private for now, but the package ships with full source — once installed you can read everything in &lt;code&gt;blender_claude/&lt;/code&gt; and modify it under the GPL terms.&lt;/p&gt;

&lt;p&gt;If you build something with it — a procedural environment, a rigging tool, a render queue helper — I'd love to see it. The whole point of putting an AI in your DCC is that the boring scripting layer disappears. What you do with the time you get back is where the actual work happens.&lt;/p&gt;

</description>
      <category>blender</category>
      <category>python</category>
      <category>ai</category>
      <category>claude</category>
    </item>
  </channel>
</rss>
