mailwal

Too many Claude Code prompts in .NET?

David from Round The Code

Build a .NET 10 Minimal API from scratch with EF Core, SQL Server and unit tests in my beginners course. Find out more

How to stop Claude Code permission prompts in .NET

Claude Code used to ask for approval on every single action. If you left it running, you could come back to find it stuck waiting on a prompt.

To stop the prompts, you can start Claude Code with the --dangerously-skip-permissions parameter. All the prompts disappear.

But this gives Claude full permission to use your machine. It can delete any file it wants to, run any command and even change files in other folders. It still asks before deleting the system root or your home directory, but most commands go straight through. That's far too much access just to save some clicks.

Auto mode is a middle ground

In August 2026, auto mode became the default in Claude Code for Pro, Max and Team plans. It sits between approving every single action and approving nothing.

A second model, called a classifier, reviews actions such as shell commands and web requests before they run. File edits in your project and read only commands run without a check. Riskier actions get blocked, such as:

Throwing away uncommitted changes
Deleting files that existed before the session
Deploying to production

It's a better middle ground than skipping permissions altogether. But it means you're giving AI the decision on what is safe and what is dangerous.

Where auto mode falls short

Auto mode looks for actions that are dangerous. The two problems I had weren't dangerous, but they were annoying and disruptive.

I asked Claude Code to add an EF Core migration. Rather than using the command line, it wrote the migration file by hand. The code looked fine, but when I went to update the database, I got an error. I deleted the migration and created it myself by running the command.

The other problem came when I was using Claude Code to make some CSS changes to a .NET MVC website. Whilst it was making those changes, it was running the website in the background. When I tried to start the website in Visual Studio, I got an error saying that it was already running. Nothing went wrong, but it was unnerving to think that an AI agent was running my website.

Adding permissions to a .NET project

To add permissions to your project, create a settings.json file in the .claude folder at the root of your project.

The ask list contains the commands Claude Code must ask permission for before it runs them. I added:

Adding an EF Core migration through the command line
Running the application
Running the application with dotnet watch
Running any command in the background

The deny list contains what Claude Code is not allowed to do. I added:

Editing any file in the Migrations folder
Updating the database through the EF Core command

Here's the full settings.json file:

{
"permissions": {
"ask": [
"Bash(dotnet ef migrations add *)",
"Bash(dotnet run *)",
"Bash(dotnet watch *)",
"Bash(run_in_background:true)"
],
"deny": [
"Edit(**/Migrations/**)",
"Bash(dotnet ef database update *)"
]
}
}

Blocking edits to the Migrations folder stops Claude Code writing a migration by hand.

When I asked it to add an EF Core migration, it asked for permission to run the dotnet ef migrations add command. The message said that the ask rule overrides auto mode for this command. So the rules in your settings file come first, and an ask rule will still prompt you, even in auto mode.

In the full article, I test the deny rules, show which settings file takes priority, and explain why a deny rule in one file beats an allow rule in another.

I also go through it in the video, where I show you how to add ask and deny rules to a .NET project, how they work with auto mode, and why a deny rule always wins.

You can watch it below:

Thanks for reading,

David Grace

Want to reach .NET and C# developers? Sponsor this newsletter

Follow me

Website YouTube LinkedIn

If you wish to unsubscribe from our newsletter, click here