Anthropic has released a detailed, production-focused setup guide for Claude Code on Windows, moving the AI coding assistant far beyond a simple install-and-run experience. Published on July 20, 2026 by KDnuggets, the walkthrough shows Windows developers how to configure Claude Code for sustained, high-stakes agentic programming—with safeguards, project memory, and performance optimizations that prevent the tool from losing context or requiring endless manual approval.

If you’ve used Claude Code on Windows before, you’ve likely seen it struggle with long sessions: context warnings, repeated permission pop-ups, and a gradual loss of project knowledge. The latest guidance solves these problems not with a new feature, but with three configuration files most users never touch. It’s a blueprint that turns Claude Code from a helpful autocomplete into a reliable teammate, whether you’re running projects natively on Windows 10 (1809+), Windows 11, or inside WSL 2.

Why This Guide Matters for Windows Developers

The difference between a beginner’s Claude Code setup and a high-performance one, according to the KDnuggets article, is about 20 minutes of configuration. Without it, the tool defaults to a lowest-common-denominator experience: it asks permission before every file edit, runs commands one at a time, and gradually forgets earlier decisions as context fills up. For Windows users specifically, the native installer and PowerShell integration have been available, but getting it to behave predictably in a real project required guesswork. Now, there’s a structured path.

Claude Code is officially supported for Windows via a native installer (irm https://claude.ai/install.ps1 | iex) or via winget install Anthropic.ClaudeCode. Both methods work on Windows 10 version 1809 and later, as well as Windows 11. WSL 2 is the recommended route for Linux-first projects, Docker toolchains, or sandboxed command execution. The guide stresses one critical rule: pick one environment and stay there. Mixing Windows-native and WSL sessions against the same repository can lead to Git state conflicts and build mismatches.

What sets this guide apart is its razor focus on the three files that actually run the show: CLAUDE.md, .claude/settings.json, and custom hooks. These are the levers that turn Claude Code from a session that degrades into one that holds up under sustained agentic work—the kind where the AI proposes and executes multi-step refactors, runs test suites, and even reviews its own output for correctness.

The Three Files That Transform Claude Code from Toy to Tool

Most introductions to Claude Code stop at the install command. The KDnuggets article starts where the installer ends, underscoring that without CLAUDE.md, Claude has no memory of your project’s build commands, style rules, or architectural boundaries. Without settings.json, it can’t know which commands are safe to run repeatedly and which are dangerous. And without hooks, it has no automated safety net beyond asking you every single time.

CLAUDE.md: Your Project’s Persistent Brain

CLAUDE.md lives at the project root and is read at the start of every session. You can generate a starter version by running /init inside Claude Code. The guide recommends adding explicit commands (install, test, lint, build) and rules that must survive context compaction. For example:

# Project instructions

Commands

Install: npm ci Test: npm test Lint: npm run lint Build: npm run build

Working rules

Do not modify lock files unless dependencies changed. Keep changes limited to the requested feature or bug. Before finishing, run relevant tests and report failures plainly.

For larger codebases, you can split rules into .claude/rules/.md files with path-specific triggers, so Claude only loads them when touching matching files. You can also add a private CLAUDE.local.md for preferences you don’t want to commit.

settings.json: Permissions That Respect Your Time

Without .claude/settings.json, Claude Code asks for permission before every shell command and file edit. That’s safe, but exhausting. The guide shows how to define granular rules that allow routine actions silently, block dangerous ones absolutely, and still prompt for high-stakes operations like pushing code.

A realistic starting point:

{
  "permissions": {
    "allow": [
      "Read()",
      "Bash(npm test:)",
      "Bash(npm run lint:)",
      "Bash(npm run build:)"
    ],
    "ask": [
      "Bash(git push:)",
      "Bash(git commit:)"
    ],
    "deny": [
      "Read(.env)",
      "Read(.env.)",
      "Read(/.pem)",
      "Read(*/idrsa)",
      "Bash(sudo:)",
      "Bash(rm -rf:)"
    ]
  }
}

Notice the deny rules always win, even if a broader allow rule would otherwise match. This means you can safely grant read access to your entire project while still blocking access to secrets. The guide also advises against using bypassPermissions on your primary Windows machine—that’s reserved for isolated containers and VMs.

Hooks: Your Project’s Safety Harness

Hooks run scripts before or after Claude Code executes a tool. The KDnuggets article provides two practical examples: a PostToolUse hook that auto-formats every file Claude edits with Prettier, and a PreToolUse hook that blocks dangerous shell patterns before they run. For Windows, a PowerShell version of the dangerous-command blocker is included:

$inputJson = [Console]::In.ReadToEnd() | ConvertFrom-Json
$command = $inputJson.toolinput.command

$blocked = @( 'rm\\s+.-[a-z]r[a-z]f', 'Remove-Item\\s+.-Recurse.-Force', 'git\\s+push\\s+.--force.main', 'git\\s+reset\\s+--hard' )

foreach ($pattern in $blocked) { if ($command -match $pattern) { @{ hookSpecificOutput = @{ hookEventName = "PreToolUse" permissionDecision = "deny" permissionDecisionReason = "Blocked by the project safety hook." } } | ConvertTo-Json -Depth 5

exit 0 } }

Hooks are registered in settings.json and can be shared across the team. They run with your Windows user permissions, so treat them like any other script you’d add to a repository: read them, test them, and keep them under source control.

Permission Modes: The Safety Net You Shouldn’t Skip

Claude Code has three interactive permission modes, toggled with Shift+Tab during a session:

  • Manual/default: Reads are allowed; edits and commands prompt.
  • Accept edits: File edits in the working directory are auto-approved; other commands still prompt.
  • Plan: Investigate and propose without modifying source files. No edits or shell commands execute until you approve a plan.

The guide strongly recommends starting new projects in Plan mode (claude --permission-mode plan). It forces Claude to propose a change plan first—essential for unfamiliar codebases. Once you trust the project context, switching to Accept Edits lets you iterate faster, relying on Git for review rather than approving individual file changes.

Commands That Prevent Session Drift

The article distills Claude Code’s 60+ built-in commands down to a handful that matter most for Windows developers during long sessions:

  • /context: Shows current context window usage—vital before a session starts misbehaving.
  • /compact: Summarizes the conversation to free context space; you can add a focus, e.g., /compact preserve the test failures and implementation plan.
  • /clear: Starts a fresh conversation while retaining project instructions from CLAUDE.md.
  • /plan: Requests a read-only plan before making edits.
  • /diff: Reviews all changes from the current session—run this before you commit.
  • /code-review and /security-review: Check the current diff for correctness and security issues.
  • /doctor: Diagnoses installation and configuration problems; a must on Windows where environment variables can go wrong.

These commands directly address the top complaints from Windows users: sessions that degrade from context bloat, and not knowing exactly what changed. The guide recommends building muscle memory with /compact, /plan, and /diff first.

Custom Commands: Building a /truth Checker

The KDnuggets article goes beyond stock commands to show how to build a custom verification tool. Dubbed /truth, it forces Claude to re-read the files it claims to have edited and compare against the actual git diff. This is not a shipped feature but a custom skill defined in .claude/skills/truth/SKILL.md. It’s restricted to read-only tools, so it can never modify files while verifying. The intent: make Claude prove its claims before you trust them.

This concept is especially valuable on Windows, where case-insensitive paths, PowerShell vs. Bash, and line-ending differences can introduce subtle discrepancies that a git diff will catch but a summary won’t.

Subagents: Parallel Work Without the Chaos

For larger Windows projects, the guide explains how to delegate verbose work like codebase exploration or dependency audits to subagents. A subagent has its own context window, so its intermediate file reads and tool calls don’t pollute your main session. You can create them interactively via /agents or as predefined .claude/agents/<name>.md files. A common starter is a read-only code reviewer subagent that inspects diffs without being able to edit them.

For genuinely parallel edits, Claude Code supports isolated Git worktrees with /batch and --worktree sessions—an advanced pattern that lets multiple instances work simultaneously on different parts of a codebase. This is overkill for beginners but critical for teams that have outgrown sequential sessions.

What to Do Right Now

If you’re a Windows developer using Claude Code, the guide’s recommendations translate into these immediate steps:

  1. Choose your environment and stick to it. Native PowerShell for .NET, Visual Studio, or Windows SDK projects; WSL 2 for Linux-first toolchains. Install with the native script or Winget.
  2. Run claude doctor from your project root to verify your installation.
  3. Generate a CLAUDE.md by running /init inside Claude Code, then tailor it with your real build, test, and lint commands.
  4. Create a .claude/settings.json with sensible permission rules. Start by allowing routine reads and test commands, but deny access to secret files and dangerous shell patterns.
  5. Adopt Plan mode for new or unfamiliar repositories. Add { "permissions": { "defaultMode": "plan" } } to your project’s settings or launch with --permission-mode plan.
  6. Add at least one safety hook. The dangerous-command blocker in PowerShell is a quick win. Register it in settings.json and confirm with /hooks.
  7. Commit the CLAUDE.md and .claude/settings.json (excluding any personal overrides) so your whole team starts from the same baseline.
  8. Learn /compact, /plan, and /diff before you need them. These three commands prevent the majority of session failures.

For personal preferences that shouldn’t be shared, use CLAUDE.local.md (add it to .gitignore) and .claude/settings.local.json. Never put API keys, tokens, or machine-specific paths in shared config files.

Outlook: The Road to Reliable Agentic Coding on Windows

Anthropic’s guide signals a maturing ecosystem where AI coding assistants are no longer just interactive tools but programmable agents. The emphasis on configuration files, permission policies, and hooks mirrors best practices from infrastructure-as-code and DevSecOps. For Windows developers, this means Claude Code can now be integrated into team workflows with predictable, auditable behavior—not just a solo experiment.

The KDnuggets article stops short of covering enterprise deployment at scale, but the building blocks are there: shared CLAUDE.md rules, composable hook scripts, and subagent patterns that can be templated across repositories. As Claude Code continues to evolve on Windows, expect deeper integration with Visual Studio, PowerShell Desired State Configuration, and Windows-native sandboxing. For now, the message is clear: a half-hour of upfront configuration unlocks hundreds of hours of reliable agentic programming. Don’t skip it.