Open Claude Code from Houdini shelf

• 5 min read

When I use Claude Code for Houdini work I always want the terminal to open in the same folder as my HIP file. Doing it manually every time is annoying — so I made a shelf tool that does it in one click.

What it does

Click the shelf button → Windows Terminal opens in your HIP file’s folder → Claude Code launches automatically. If the HIP is unsaved, it warns you first.

Setup

1. Right-click any shelf → New Tool

2. Options tab:

  • Label: Open Claude Code
  • Icon: MISC_python

3. Script tab — paste this (no leading spaces):

import hou
import os
import subprocess

hip_path = hou.expandString(hou.hipFile.path())

if not os.path.isfile(hip_path):
    hou.ui.displayMessage(
        "Save your HIP file first before opening Claude Code.",
        title="Open Claude Code",
        severity=hou.severityType.Warning
    )
else:
    hip_dir = os.path.dirname(hip_path)
    try:
        subprocess.Popen(
            f'wt -d "{hip_dir}" cmd /k claude',
            shell=True
        )
    except Exception:
        subprocess.Popen(
            ['cmd', '/k', f'cd /d "{hip_dir}" && claude'],
            creationflags=subprocess.CREATE_NEW_CONSOLE
        )

4. Click Accept — done.

Requirements

  • Claude Code installed — npm install -g @anthropic-ai/claude-code
  • Windows Terminal (optional, falls back to PowerShell automatically)
  • Houdini 19.5+

Mac/Linux users: swap the subprocess.Popen calls for open -a Terminal or gnome-terminal --working-directory.