Repository navigation
Description
Summary
We need true automatic permission-hook installation for every client we claim to support in the Setup flow, not just Claude Code.
Today, the backend permission evaluator can format decisions for multiple platforms, but only the Claude Code install path is verified and auto-wired. The remaining clients need real host-level integration research, implementation, and regression coverage before we can honestly say permissions are automatically enforced there.
Current state
Verified and implemented
claude-code- automatic hook install and settings merge implemented
- hook marker written
- install path tested
- enforcement path verified
Backend response support exists, but auto-install is not yet implemented/verified
cursorwindsurfgemini-clicodex
Why this matters
Users expect that if they install DollhouseMCP from the Setup tab and activate a policy-bearing element, permission enforcement will actually be wired. Right now that expectation is only safe for Claude Code.
For the remaining clients, we need to avoid both failure modes:
- pretending support exists when no hook is really installed
- writing guessed or incorrect config into a user's host settings
Required work
1. Per-client hook integration research
For each platform below, verify from real installs and/or official docs:
- settings/config file location
- hook/pre-tool interception support
- exact config schema
- whether command hooks are global or workspace-local
- merge/idempotency behavior
- platform-specific constraints on shell commands and env vars
Platforms:
cursorwindsurfgemini-clicodex
2. Hook script strategy
Decide per client whether we can:
- reuse one canonical script under
~/.dollhouse/hooks/ - or need thin per-platform wrapper scripts that only change payload shape / platform name
At minimum verify:
- correct
platformvalue sent to/api/evaluate_permission session_idforwarding- fail-open behavior when the permission server is unavailable
- correct output contract for that host
3. Installer implementation
Extend the installer so each supported client gets:
- hook script deployment into
~/.dollhouse/hooks/ - executable permissions where needed
- host settings merge without clobbering existing config
- backup of modified settings file when appropriate
- idempotent re-run behavior
- marker/telemetry so activation and UI can report whether enforcement is actually wired
4. Setup/UI honesty
Until a client is fully verified, Setup and activation flows should say so explicitly.
When support is complete, the Setup flow should surface:
- supported + configured
- supported but manual steps required
- unsupported / not yet implemented
5. Regression coverage
Add tests for:
- config merge/idempotency per client
- existing hooks preserved
- repeated install does not duplicate entries
- correct hook command/script path written
- unsupported client paths fail honestly
- permission hook marker/status reporting
6. Real validation matrix
We should validate against actual client installs where possible:
- local validation for CLI clients (
claude-code,codex,gemini-cli) - local validation for desktop/editor clients (
cursor,windsurf) if hooks are user-level features there - optional containerized file-merge tests for repeatability, but do not rely on Docker alone to prove GUI/editor hook behavior
Acceptance criteria
- Every client listed in the Setup flow is classified as one of:
- fully auto-wired and verified
- supported with explicit manual instructions
- unsupported / not yet implemented
- No client is presented as automatically enforced unless the hook path is actually installed and verified
- Re-running install is safe and idempotent for every supported client
- Each verified client has regression tests for config merge + install behavior
- Permissions activation/reporting stays honest about whether enforcement is really active
Related
- Installer does not wire permission enforcement hook for any platform #1977
- No hook scripts for cursor, windsurf, gemini-cli, codex platforms #1978
- activate_element reports 'CLI Restrictions Active' even when no hook is installed #1979
- evaluate_permission enforces against leader's empty in-memory state, ignores cross-session activations #1980
- Fix permission hook wiring and session enforcement #1981
Activity
mickdarling commentedon Apr 14, 2026
Investigation notes from upstream docs/source review:
Verified native hook surfaces
Claude Code
Official Anthropic docs clearly support
PreToolUsehooks in~/.claude/settings.json, project settings, and enterprise-managed settings, with command hooks and explicit allow/deny/ask decisions.Source: https://docs.anthropic.com/en/docs/claude-code/hooks
Gemini CLI
Official Gemini CLI docs clearly support hooks in
settings.json, includingBeforeTool,AfterTool, and other lifecycle events. User config path is~/.gemini/settings.json; project config path is.gemini/settings.json.Sources:
Implication: Gemini should move out of the "unverified" bucket. We now have a real documented native hook path.
Windsurf
Official Windsurf docs clearly support native shell-command hooks via
hooks.jsonat system, user, and workspace scopes.Documented user path for the Windsurf IDE is
~/.codeium/windsurf/hooks.json.Documented pre-hook events include:
pre_read_codepre_write_codepre_run_commandpre_mcp_tool_useSource: https://docs.windsurf.com/windsurf/cascade/hooks
Important nuance: Windsurf's hook contract is not the same as Claude/Gemini. It uses event-specific JSON input under
tool_infoand blocking via exit code2/stderr, not the same decision JSON shape we currently use. So Windsurf likely needs a dedicated adapter script + config writer, not just the current generic bridge.Cline
Official Cline docs clearly support hooks, including
PreToolUse, with global hooks under~/Documents/Cline/Hooks/and project hooks under.clinerules/hooks/.Sources:
Cline was not in the original #1982 scope, but it now looks like a real candidate for native integration.
No verified native hook path found in this pass
Cursor
I found official Cursor docs for MCP install/deeplinks and for Cursor CLI permission configuration (
~/.cursor/cli-config.json/ project.cursor/cli.json), but I did not find official documentation for a custom pre-tool/pre-command hook system equivalent to Claude/Gemini/Windsurf/Cline.Sources:
Implication: do not treat Cursor as having a verified native hook path yet.
Claude Desktop
I did not find an official native hook system for Claude Desktop in this pass. Anthropic's documented hook surface is for Claude Code, not Claude Desktop.
VS Code
No verified native hook surface found in this pass.
LM Studio
I found LM Studio docs for the app and MCP, but no documented native hook/pre-tool extension point in this pass.
Codex status: internal signals exist, public user path still unclear
The openai/codex repo clearly contains internal hook/runtime code and config flags such as
codex_hooksandrequest_permissions_tool, and the config schema includes arequest_permissions_toolfeature flag.Sources:
codex-rs/hooksand hook runtime codeHowever, I did not find a clear user-facing documented hook configuration path equivalent to Claude Code / Gemini / Windsurf / Cline. So Codex should still be treated as unverified for automatic native hook installation until we inspect/test it directly.
Recommended next move for #1982
Split the native-hook work into buckets:
Ready for documented-native integration work
gemini-cliwindsurfcline(if we want to expand supported clients)Keep in investigation / not yet verified
cursorcodexLikely fallback-only candidates unless docs emerge
claude-desktopvscodelmstudioAnd separately evaluate #1989 for the clients in the latter two buckets.
mickdarling commentedon Apr 15, 2026
Present platform matrix after the recent permission-hook work on develop:
What is done now:
Main remaining gaps:
So this issue should stay open as the umbrella for the remaining full support matrix / verification work, while #1988 can be closed as completed behavior.