Patches: your own buttons and panels
A patch adds buttons (chips above the composer) and panels (beside the thread) for the threads in a folder. A button can run a command, like your tests, or send the agent a message you use a lot. A panel can show a web page, such as your app running on localhost, or a list.
Each panel has a button on the right-hand rail, with a small badge in its bottom corner (and on the panel's tab) saying where it came from: the project's own icon when it came from one of the thread's projects' folders, a folder for the thread's own folder, a house for ~/.threadbear, a wrench for a tool patch (one that's there because of a file, like a video's .tandem) and a box for one built into Threadbear. Hover over the button to see it in words.
You don't need to write one yourself. In a thread in that folder, ask "add a button that runs the tests" or "add a panel showing localhost:3000", and the agent writes the patch into the folder's .threadbear/patches/ (the format is under "Patches" in docs/protocol.md, in your Threadbear folder). It shows up within a few seconds. A patch is code that runs on your Mac, so keep only the ones you'd be happy to run.
Patches only run once you've trusted them. One the agent writes for you is trusted as it wrote it. One that arrives some other way, in a repo you've cloned or with a git pull, waits: a "patch to trust" chip shows above the composer, and Patches lists it as "Not run yet" (or "Changed since you trusted it") with a Trust button. Open its file to read it first. A thread's worktree counts as its repo, and patches that were already in your folders when this arrived are trusted for you.
A project's page has its own panels and Patches on the right-hand rail: the ones its folders give its threads.