Open Claude Code from Houdini shelf
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 shutil
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)
if shutil.which("wt"):
# Windows Terminal, opened in the HIP folder
subprocess.Popen(["wt", "-d", hip_dir, "cmd", "/k", "claude"])
else:
# No Windows Terminal: plain Command Prompt window in the HIP folder
subprocess.Popen(
["cmd", "/k", "claude"],
cwd=hip_dir,
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 a plain Command Prompt window)
- Houdini 19.5+
Mac/Linux users: swap the subprocess.Popen calls for open -a Terminal or gnome-terminal --working-directory.