{"_id":"@booklib/claude-ado-confirm-hook","name":"@booklib/claude-ado-confirm-hook","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@booklib/claude-ado-confirm-hook","version":"1.0.0","description":"Native macOS confirmation dialog for Azure DevOps MCP write operations in Claude Code","keywords":["claude-code","azure-devops","mcp","hooks","confirmation-dialog","macos"],"author":{"name":"ZLStas"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/booklib-ai/claude-code-ado-confirm-hook.git"},"bin":{"claude-ado-confirm-hook":"bin/install.js"},"os":["darwin"],"engines":{"node":">=16"},"_id":"@booklib/claude-ado-confirm-hook@1.0.0","gitHead":"681a7993c2a648169aac64cac5d327d1b6338d2a","bugs":{"url":"https://github.com/booklib-ai/claude-code-ado-confirm-hook/issues"},"homepage":"https://github.com/booklib-ai/claude-code-ado-confirm-hook#readme","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-YNedOPyf5FxQA7mjhHVbBeUzHYWMcgzdOgiHL9NU8H2wjtXwH99Pmrb57JsZ2dGl+0podaLroC/4Ojdfx1fXRg==","shasum":"9b2254aed784efb4ed3e85c7fe7f5cd442b10fee","tarball":"https://registry.npmjs.org/@booklib/claude-ado-confirm-hook/-/claude-ado-confirm-hook-1.0.0.tgz","fileCount":7,"unpackedSize":31414,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGIJOGQ/Eory9N1OI/B8Pl7R2Qxs5+5HKH5x/FgLKBZ1AiA8oetC46f2BHnw0FEWleC/OipzhQpqLn4W1TiFFl7uPA=="}]},"_npmUser":{"name":"stanislavzhuravel","email":"ZhuravelStas@gmail.com"},"directories":{},"maintainers":[{"name":"stanislavzhuravel","email":"ZhuravelStas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/claude-ado-confirm-hook_1.0.0_1776320550378_0.10316629167856939"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-16T06:22:30.279Z","1.0.0":"2026-04-16T06:22:30.517Z","modified":"2026-04-16T06:22:30.749Z"},"maintainers":[{"name":"stanislavzhuravel","email":"ZhuravelStas@gmail.com"}],"description":"Native macOS confirmation dialog for Azure DevOps MCP write operations in Claude Code","homepage":"https://github.com/booklib-ai/claude-code-ado-confirm-hook#readme","keywords":["claude-code","azure-devops","mcp","hooks","confirmation-dialog","macos"],"repository":{"type":"git","url":"git+https://github.com/booklib-ai/claude-code-ado-confirm-hook.git"},"author":{"name":"ZLStas"},"bugs":{"url":"https://github.com/booklib-ai/claude-code-ado-confirm-hook/issues"},"license":"MIT","readme":"# Azure DevOps Confirmation Hook for Claude Code\n\nNative macOS dialog for reviewing Azure DevOps MCP write operations before they execute. See what's changing, approve or cancel.\n\n| Update — word-level diff | Create — field summary | Batch update — table view |\n|:---:|:---:|:---:|\n| <img src=\"docs/demo-update.png\" width=\"280\"> | <img src=\"docs/demo-create.png\" width=\"280\"> | <img src=\"docs/demo-batch-update.png\" width=\"280\"> |\n\n## Why\n\nThe [Azure DevOps MCP server](https://github.com/microsoft/azure-devops-mcp) lets Claude Code create, update, and link work items directly. But write operations execute immediately — no visual preview of what's about to change.\n\nThis hook intercepts MCP write calls and shows a native macOS dialog with:\n- **Updates:** side-by-side diff with word-level highlighting\n- **Batch updates:** table with old → new values per item\n- **Creates:** field summary of the new work item\n- **Links, comments, PRs:** formatted preview\n\n## Install\n\n```bash\nnpx @booklib/claude-ado-confirm-hook\n```\n\nThis copies the hook files to `.claude/hooks/`, compiles the native dialog, and prints the settings config to add.\n\n### Manual install\n\nIf you prefer not to use npm:\n\n```bash\nmkdir -p .claude/hooks\ncurl -sL https://raw.githubusercontent.com/ZLStas/claude-code-ado-confirm-hook/main/hooks/ado-confirm.sh -o .claude/hooks/ado-confirm.sh\ncurl -sL https://raw.githubusercontent.com/ZLStas/claude-code-ado-confirm-hook/main/hooks/ado-confirm-dialog.py -o .claude/hooks/ado-confirm-dialog.py\ncurl -sL https://raw.githubusercontent.com/ZLStas/claude-code-ado-confirm-hook/main/hooks/ado-webview.swift -o .claude/hooks/ado-webview.swift\nchmod +x .claude/hooks/ado-confirm.sh .claude/hooks/ado-confirm-dialog.py\nswiftc -framework Cocoa -framework WebKit -O -o .claude/hooks/ado-webview .claude/hooks/ado-webview.swift\n```\n\n## Configure\n\nAdd to `.claude/settings.local.json`:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"mcp__azure-devops__wit_create_work_item|mcp__azure-devops__wit_update_work_item|mcp__azure-devops__wit_update_work_items_batch|mcp__azure-devops__wit_add_child_work_items|mcp__azure-devops__wit_add_work_item_comment|mcp__azure-devops__repo_create_pull_request|mcp__azure-devops__wit_work_items_link|mcp__azure-devops__wit_add_artifact_link|mcp__azure-devops__repo_create_branch\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \".claude/hooks/ado-confirm.sh\",\n            \"timeout\": 30000,\n            \"statusMessage\": \"Awaiting confirmation for Azure DevOps action...\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nThe hook reads your org name and access token from `.mcp.json` automatically — no hardcoded config needed.\n\n## How It Works\n\n1. Claude Code calls an Azure DevOps MCP tool (create, update, link, etc.)\n2. The hook intercepts the call before execution\n3. For updates: fetches current values from Azure DevOps API to show the diff\n4. Renders an HTML view in a native macOS WebView window\n5. You click **Approve** (or Enter) to proceed, **Cancel** (or Escape) to block\n\nThe dialog appears on your current screen — no desktop switching.\n\n## Requirements\n\n- **macOS** (Cocoa WebView)\n- **Xcode Command Line Tools** (for `swiftc`)\n- **jq**, **curl** (for the shell script)\n- [Azure DevOps MCP server](https://github.com/microsoft/azure-devops-mcp) configured in `.mcp.json`\n\n## Files\n\n| File | What it does |\n|------|-------------|\n| `ado-confirm.sh` | Hook entry point. Enriches payloads with current values for diffs. |\n| `ado-confirm-dialog.py` | Builds HTML for each operation type. Handles diff, batch fetch, name normalization. |\n| `ado-webview.swift` | Native macOS window with WKWebView. Renders HTML, handles Approve/Cancel. |\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-c87dd1595ec492e53a4041b7806f0b6b"}