How to Detect and Restrict Claude Code with Intune
First find every Windows PC where Claude Code is installed, then use Intune to stop it from running where it is not approved. Kuntur does the finding; the restriction is done in Intune with Windows app control. This page covers Windows; for Macs see the Jamf version.
Step 1: find where Claude Code is installed
Restrict only what you can see. Before writing a rule, find out which machines have Claude Code, for which users, and how it was installed: the install method decides what a rule has to match. Two free ways:
- Across the fleet: the Intune Remediations detection script already includes Claude Code. It is read-only and reports per device.
- On one machine: the free Kuntur scanner lists Claude Code with every other AI tool, extension and MCP server it finds (to list a laptop's MCP servers by hand, see how to detect MCP servers on Windows, macOS and Linux). To check a single laptop by hand, see how to check if Claude Code is installed on Windows, Mac and WSL.
- Download scan.ps1.
- Read it. It's plain text; here's what it does.
- Check its SHA-256 against the published hash:
Get-FileHash .\scan.ps1 -Algorithm SHA256 - Run it:
powershell -ExecutionPolicy Bypass -File .\scan.ps1
Windows shortcut, if you trust the source (PowerShell)
irm https://app.kuntur.io/scan.ps1 | iexIt needs no account and no admin rights, writes an HTML report to the Desktop and uploads nothing.
Step 2: see what a rule has to match
Claude Code is usually installed per user, without admin rights: the native installer puts claude.exe in %USERPROFILE%\.local\bin, and the npm package @anthropic-ai/claude-code runs under node.exe. The script shows the path, whether the file is signed and by whom (a publisher rule survives updates; a path or hash rule may not), and whether an npm install exists.
Windows (PowerShell), read-only
# Read-only. Run as the user on a test PC: shows what an app control rule would match.
$exe = "$env:USERPROFILE\.local\bin\claude.exe"
if (Test-Path $exe) {
$exe
Get-AuthenticodeSignature $exe | Select-Object Status, @{ n = 'Signer'; e = { $_.SignerCertificate.Subject } }
(Get-Item $exe).VersionInfo | Select-Object ProductName, CompanyName, FileVersion
}
# An npm install runs under node.exe, which a rule on claude.exe does not cover
Test-Path "$env:APPDATA\npm\node_modules\@anthropic-ai\claude-code"
Step 3: restrict Claude Code with Intune
Intune offers two ways to stop an app from running on Windows. Both are Windows features delivered by Intune, and both should start in audit mode.
- App Control for Business (Endpoint security > App Control for Business > Create Policy). In enforce mode, apps that a policy does not allow are blocked. The built-in controls trust Windows components and Store apps, and optionally apps with a good reputation and apps from a managed installer. Built-in controls are allow-based, so a popular signed app may still be trusted; to target one app, upload a custom policy XML (for example built with Microsoft's App Control policy wizard) that contains a deny rule for it.
- AppLocker, delivered through the AppLocker CSP in a custom configuration profile. AppLocker rules can deny an executable by publisher, path or file hash, or a Store app by packaged-app rule. Check Microsoft's documentation for the Windows editions that enforce AppLocker in your environment.
For the native install, a deny rule on the signer the script prints is the most durable target. A path or hash rule also works, but it must cover every user's .local\bin folder and, for a hash rule, every new version. Test it on a pilot group in audit mode, then enforce.
For Claude Code there is a second, gentler control: managed settings. Instead of blocking the tool, you deploy a managed-settings.json that users cannot override, for example to switch off bypass-permissions mode with permissions.disableBypassPermissionsMode. Anthropic documents the file locations per OS; see Cursor and Claude Code in your company.
Roll out in audit mode first. App Control writes its events to Microsoft-Windows-CodeIntegrity/Operational and AppLocker to the Microsoft-Windows-AppLocker logs in Event Viewer, so you can see who would have been blocked before you enforce.
What the rule will not catch
- npm installs. They run under
node.exe; a rule onclaude.exedoes not apply, and denying Node breaks every Node developer. - WSL. A Linux install inside WSL runs Linux binaries, which Windows app control rules do not cover. See Claude Code and Codex in WSL.
- Other coding CLIs. Gemini CLI, Codex CLI and Copilot CLI install the same way (npm, per user, run as
node.exe), so the same gaps apply. To find which laptops have them first, see How to detect AI coding CLIs. - IDE extensions and the desktop app. The VS Code extension and the Claude desktop app are separate executables or extensions with their own rules.
- API keys already on disk. Blocking the CLI does not remove an
ANTHROPIC_API_KEYexported in a shell profile or.envfile, and that key works from any other machine. Find exposed AI API keys on every laptop with an Intune Remediation that reports file and key type, never the value, then rotate what it finds.
Where Kuntur fits
Kuntur finds where Claude Code is installed, for every user profile, and lets you mark it approved or unauthorized with an audit trail. It does not block, restrict or uninstall anything: the restriction on this page is done by your MDM. Use the inventory before the rule (who will it affect?) and after it (are there installs the rule does not match, such as WSL or another install method?). If an auditor later asks how you controlled AI tools, the audit evidence pack exports those decisions with who made them and when. Still choosing a discovery tool? Shadow AI detection tools compared lists what proxy, browser, EDR and endpoint tools find, with a test you can run on one laptop.

Kuntur detects and reports; it does not block, restrict or uninstall anything. Free for up to 5 endpoints; Pro is US$3 per endpoint per month.
FAQ
- Can Intune block Claude Code?
- Intune can deliver Windows app control (App Control for Business or AppLocker) that stops Claude Code from running, ideally after an audit-mode trial. Intune itself does not detect Claude Code unless you add a detection script.
- Does Kuntur block Claude Code?
- No. Kuntur finds where Claude Code is installed and records whether you approved it. Blocking is done with Intune's app control features or your EDR.
- Should I block Claude Code or restrict its settings?
- If the concern is what it can do (skip approval prompts, run any shell command), managed settings are less disruptive than a block. If it is not approved at all, block it and keep the inventory to catch other install methods.
Sources
- Microsoft Learn: App Control for Business policy in Intune (built-in controls, audit mode, managed installer)
- Microsoft Learn: Deploy App Control policies using Intune
- Microsoft (archived blog): Blocking apps with Intune and the AppLocker CSP
More guides and tools: