Claude Code on Windows: The Complete Guide

⚡

Every Claude Code post on this site, in the order you would need them
Claude Code on Windows from a Windows admin’s point of view: installing it natively or in WSL, learning the keys, keeping it on a leash with plan mode and permissions, teaching it your project, and extending it with hooks, MCP servers, skills and subagents. Every post is checked against the current docs and the scripts in them are PowerShell.

Claude Code is Anthropic’s coding agent for the terminal. You give it a task in plain English, it reads your project, runs commands and edits files, and asks before the actions its permission mode does not already cover. On Windows that raises a run of practical questions that the docs answer one page at a time: native or WSL, which shell it uses, where its files live, how to stop it touching the wrong thing, and how to wire it into the PowerShell you already have. This page puts those answers in one place.

The posts are grouped as a journey. If you are new, go top to bottom: install it, learn the keys that matter, get comfortable in plan mode, then give it a CLAUDE.md and a permissions file before you let it loose. If you already use it every day, the later groups are the ones that pay off: hooks, MCP servers, skills and running it from a script.

2 companion guides cover the ground the posts assume: PowerShell for Windows Admins for the scripts the hooks, status line and headless posts are written in, and WSL if you run Claude Code in a Linux distro rather than natively.


The Guides

1📦 Start Here

Get it installed and find your way around the prompt. 3 posts, then you are running.

2🎯 Drive a Session

Plan before editing, pick up where you left off, and undo what you did not want.

3📖 Teach It Your Project

What it should know about your code, and what it is and is not allowed to do.

4🔧 Extend It

Run your own checks, connect it to tools and data, package a workflow, delegate the noisy work.

5⚙️ Automate and Customise

Call it from a script and make the prompt tell you what you want to know.


The Keys and Commands Worth Knowing by Heart

Key or command What it does
Shift+Tab Cycle the permission mode: Manual, accept edits, plan, and auto when it is available. Alt+M on Windows if the terminal eats it.
Esc / Esc Esc Stop the current response and keep the work so far. Twice on an empty prompt opens the rewind menu.
/plan Switches to plan mode; add a task to start planning it. Claude reads and proposes; nothing is edited until you approve.
! / @ / / Run a shell command directly; mention a file with autocomplete; run a command or skill.
claude --continue Reopen the most recent session in this folder. --resume opens the picker, or takes a name.
/init Write a starter CLAUDE.md for the project from what Claude finds in it.
/permissions See the allow, ask and deny rules in force and which file each came from.
/mcp and /hooks The connected MCP servers and their tools; the hooks loaded for this session, by event.
claude -p "..." Print mode: one prompt in, the answer out, no session. The one to call from PowerShell.
claude doctor Check the install and the settings files before blaming anything else.

Habits That Save You

Commit before you let it loose. Checkpoints rewind the files Claude edited through its own tools, and the docs are clear that they are not a replacement for version control: a file that only a shell command, a subagent or you in the editor changed is outside them. A clean working tree before a big task means git diff shows you exactly what the session did, and git checkout puts it back if the rewind menu cannot.

git status            # clean? then go
git add -A; git commit -m "before claude: refactor the export job"
claude --permission-mode plan

Deny the secrets, do not just ask Claude to avoid them. A line in CLAUDE.md is guidance and nothing stops the model reading past it. A Read deny rule for .env, web.config or your credentials folder is enforced by Claude Code itself, and it applies in the VS Code extension and in a -p run as well as the terminal. The permissions post has the syntax; it is a few lines of JSON.


Frequently Asked Questions

Native Windows or WSL?

Wherever your projects and tools are. Native runs claude.exe from PowerShell or CMD against your Windows drives, with Git for Windows giving it a Bash tool. WSL 2 runs the Linux build inside your distro and is the only Windows option with sandboxed command execution. The install post covers both; you can have both installed.

Which post should I read first?

The install post, then the keyboard shortcuts post, then plan mode. Those 3 are enough to be productive without surprises. CLAUDE.md and permissions come next, before you use it on anything that matters.

Is CLAUDE.md a way to stop Claude doing things?

No. It is context Claude reads at the start of a session, and it shapes behaviour without enforcing it. To stop something, use a permission deny rule; to react to something, use a hook. The CLAUDE.md, permissions and hooks posts cover each.

Can it run unattended?

Yes. claude -p takes a prompt and returns the answer, as text or JSON, with no session, and it reads the same settings files, so your deny rules still apply. The headless post has the PowerShell pattern, including a Task Scheduler example.

Is there a SQL Server angle?

The MCP post adds the sqldba MCP server as its worked example: a verified reference for SQL Server errors, wait types and build numbers that Claude can query instead of guessing. That is the one piece of this guide that crosses over to the SQL side.


If SQL Server is part of your day job, my current work lives over at sqldba.blog: production DBA scripts, an error library and the SSMS guide. The scripts page is the first thing worth pointing Claude at.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Looking for SQL Server?

This site started as a SQL Server blog in 2017 and the archive is still here. The new SQL Server writing, and all the scripts, moved to a site of their own.

sqldba.blogScripts, error library, wait types, SSMS
Browse by topic