# -*- coding: utf-8 -*- # # Starts a detached terminal running the `claude` CLI with its working # directory set to the repository root, so the session comes up on CLAUDE.md # and tools/rvt.py -- which is what wires it to THIS running Revit. # # The terminal is a separate process. Nothing runs on Revit's UI thread, so a # long agent session cannot freeze or crash Revit, and this button touches the # model in no way at all: it opens no Transaction, reads no element, and does # not even import `vibe.helpers`' document handle. # # PLAIN `claude`, DEFAULT PERMISSIONS. Standing ruling: this launch must never # pass --dangerously-skip-permissions, --permission-mode bypassPermissions, or # any other auto-approve flag. The agent is being pointed at a live Revit # session and the owner's real model; every tool call it makes is worth a # human seeing first. If a future edit "just needs" the prompts gone, that is # a conversation with the owner, not a flag. # # Interactive, so this deliberately does NOT use the redirect-both-streams # runner from vibe.liftexport.run -- that pattern exists to capture a headless # run without deadlocking on a pipe, and redirecting stdout here would leave # the CLI with no terminal to draw on. What is reused is the other half of the # idiom: a generated .cmd does the cd and holds the window open, so nothing # has to nest quotes inside a wt.exe command line. # # WHAT THIS REPLACED: the button used to run tools/dsh-here.cmd, which starts # `dsh web` (the DeepSeek Harness browser UI) in the same folder. That was the # whole of its behaviour -- a different agent CLI in the same slot -- so it is # gone rather than preserved. tools/dsh-here.cmd is left on disk, now # unreferenced, for the owner to keep or bin. # # This button was called GOD_MOD, then `Claude` for the 2026-08-30 ribbon # rebuild, and is GOD_MOD again after the 2026-08-30 one -- the owner's own # word, underscore and all. Same button, same folder contents throughout; the # folder is `GodMod.pushbutton` because a component name becomes a C# class # name in the generated assembly. # # `__title__` is dead weight while `bundle.yaml` exists -- pyRevit reads it # only `if not self.meta` -- and it is kept in step anyway, so that trimming a # bundle file cannot resurrect a name nobody uses. __title__ = 'GOD_MOD' import io import os import tempfile from System.Diagnostics import Process, ProcessStartInfo from pyrevit import forms, script TITLE = 'Claude' MARKER = 'CLAUDE.md' # the project instructions the session reads def repo_root(): """The checkout to start the session in, and whether it looks like one. This script lives at /WillTools.extension///