toolhive-studio
CLAUDE.md170 starsChanged 5 months agoApache-2.0View on GitHub
This file provides guidance to Claude Code when working with this repository. ToolHive Studio is an Electron desktop application for managing MCP (Model Context Protocol) servers. Built with React, TypeScript, and Vite. The Electron app bundles the ToolHive CLI (thv) binary. Husky/lint-staged automatically run lint + format on staged .ts/.tsx files. Run pnpm run type-check manually before committing — it is not covered by the hook. These files are generated and will be overwritten: To update generated API client: edit…
- Installs packages
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- bug-fix-tddSkill
- deep-linksSkill
- devcontainer-devSkill
- security-vuln-remediationSkill
- skill-creatorSkill
- skill-editorSkill
- testing-api-assertionsSkill
- testing-api-overridesSkill
- testing-with-api-mocksSkill
- bug-fix-tddSkill
- deep-linksSkill
- devcontainer-devSkill
- security-vuln-remediationSkill
- skill-creatorSkill
- skill-editorSkill
- testing-api-assertionsSkill
- testing-api-overridesSkill
- testing-with-api-mocksSkill
The file
We split this CLAUDE.md into the rules it gives an agent
10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Docker must be running: before pnpm run start — ToolHive manages containers, so the daemon is required even in dev
- Very specific: line 35
Stale generated types: if type errors reference API types, run pnpm run generate-client to refresh
- Very specific: line 37
All commands from root: always run pnpm commands from the repository root, not from subdirectories
- Very specific: line 70
File naming: always kebab-case (e.g., card-mcp-server.tsx, use-auto-update.ts)
- Distinctive: line 73
Imports: use path aliases, not relative paths for cross-directory imports
- Distinctive: line 74
Exports: prefer named exports over default exports
- Very specific: line 82
Use .override() / .overrideHandler() for test-specific responses
- Very specific: line 83
Use recordRequests() to assert on API calls
- Very specific: line 94
Follow Conventional Commits: feat:, fix:, docs:, test:, chore:, etc.
- Distinctive: line 96
Keep PRs small and focused (size/XS or size/S preferred)
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
This file provides guidance to Claude Code when working with this repository.
Project Overview
ToolHive Studio is an Electron desktop application for managing MCP (Model Context Protocol) servers. Built with React, TypeScript, and Vite. The Electron app bundles the ToolHive CLI (thv) binary.
Build and Development Commands
pnpm install # Install dependencies
pnpm run start # Start dev server with hot reload
pnpm run lint # Run ESLint
pnpm run type-check # TypeScript checking (both app and node configs)
pnpm run format # Format with Prettier
pnpm run test:nonInteractive # Run unit tests once
pnpm run test # Run unit tests in watch mode
pnpm run test:coverage # Unit tests with coverage
pnpm run e2e # Package + run Playwright e2e tests
pnpm run knip # Detect unused code
pnpm run generate-client # Fetch OpenAPI spec + regenerate API clientHusky/lint-staged automatically run lint + format on staged .ts/.tsx files. Run pnpm run type-check manually before committing — it is not covered by the hook.
Environment Requirements
- Node.js >=24 <25 (use
nvm use—.nvmrcis present) - pnpm package manager
- Docker daemon must be running (required by ToolHive)
Common Gotchas
- Docker must be running before
pnpm run start— ToolHive manages containers, so the daemon is required even in dev - Node version mismatch: wrong Node version can break other native modules. Always
nvm usefirst - Stale generated types: if type errors reference API types, run
pnpm run generate-clientto refresh - Electron test runner: unit tests run through Electron (
vitest:electron), not plain Node — required for native module compatibility - All commands from root: always run
pnpmcommands from the repository root, not from subdirectories
Auto-Generated Code — Never Edit Manually
These files are generated and will be overwritten:
renderer/src/route-tree.gen.ts— Generated by TanStack Router plugin from route filescommon/api/generated/*— Generated bypnpm run generate-clientfrom OpenAPI spec
To update generated API client: edit the OpenAPI spec source, then run pnpm run generate-client.
To update routes: add/modify files in renderer/src/routes/, the route tree regenerates automatically.
Architecture
Electron Process Model
main/— Main process: app lifecycle, IPC handlers, database (SQLite), auto-update, deep links, CLI integrationrenderer/— Renderer process: React UI, routing, API calls, state managementpreload/— Preload scripts: bridge between main and renderer viawindow.electronAPIcommon/— Shared code: generated API client, types, constants
Renderer Architecture
- Routing: TanStack Router with file-based convention in
renderer/src/routes/__root.tsx— root layout- Route files use dot-notation for nesting (e.g.,
logs.$groupName.$serverName.tsx)
- State: TanStack React Query for server state, React Context for app state (theme, permissions)
- API: Generated client from OpenAPI spec in
common/api/generated/ - UI: Radix UI primitives + Tailwind CSS + CVA for component variants
- Forms: React Hook Form + Zod validation
Code Conventions
- File naming: always kebab-case (e.g.,
card-mcp-server.tsx,use-auto-update.ts) - Components: PascalCase exports, functional components with hooks
- Path aliases:
@/*(renderer/src),@common/*(common),@utils/*(utils),@mocks/*(mocks) - Imports: use path aliases, not relative paths for cross-directory imports
- Exports: prefer named exports over default exports
Testing
- Unit tests: Vitest + Testing Library + MSW for API mocking
- Test location:
__tests__/directories colocated with source - API mocking: Auto-generated MSW fixtures from OpenAPI spec. See
docs/mocks.md- Fixtures in
renderer/src/common/mocks/fixtures/ - Use
.override()/.overrideHandler()for test-specific responses - Use
recordRequests()to assert on API calls
- Fixtures in
- E2E tests: Playwright in
e2e-tests/
Running a Single Test
pnpm run test run path/to/file.test.tsxCommit and PR Guidelines
- Follow Conventional Commits:
feat:,fix:,docs:,test:,chore:, etc. - PR titles must follow conventional commit format (validated by CI)
- Keep PRs small and focused (size/XS or size/S preferred)
- See
CONTRIBUTING.mdfor full guidelines
Deep Links
- Protocol:
toolhive-gui://v1/<intent>?<params> - Handled by main process, routed to TanStack Router
- See
.claude/skills/deep-links/for implementation guidance
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

