<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-gave-claude-code-a-deny-list-and-stopped-watching-every-command-it-tried-to-run-loabhycit" -->

---
title: I gave Claude Code a deny list, and stopped watching...
description: A practical configuration approach for Claude Code that reduces the need to manually approve every command it runs. By combining auto mode with a deny list...
canonical: https://daily.dev/posts/i-gave-claude-code-a-deny-list-and-stopped-watching-every-command-it-tried-to-run-loabhycit
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I gave Claude Code a deny list, and stopped watching every command it tried to run | daily.dev
og:description: A practical configuration approach for Claude Code that reduces the need to manually approve every command it runs. By combining auto mode with a deny list...
og:url: https://daily.dev/posts/i-gave-claude-code-a-deny-list-and-stopped-watching-every-command-it-tried-to-run-loabhycit
og:image: https://api.daily.dev/og/posts/loABhYcIt.png
og:image:alt: I gave Claude Code a deny list, and stopped watching every command it tried to run
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I gave Claude Code a deny list, and stopped watching every command it tried to run

**[XDA Developers](https://daily.dev/sources/xda-developers)** · 3 min read · 0 upvotes · 0 comments

## Summary

A practical configuration approach for Claude Code that reduces the need to manually approve every command it runs. By combining auto mode with a deny list (blocking destructive commands like git push --force, rm -rf, and npm publish) and an ask list for moderately risky actions, users can let Claude Code work unattended while still preventing catastrophic mistakes. The setup relies on Claude Code's permission check order: deny rules always override ask and allow rules. However, deny lists can't catch every destructive path (e.g., Python-based file deletion instead of rm -rf), so combining auto mode with bypassPermissions is discouraged on a main machine. For true safety, running Claude Code inside a disposable container, VM, or its built-in sandbox is recommended, especially since the built-in sandbox still allows file modification within the working directory.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.xda-developers.com/gave-claude-code-deny-list-stopped-watching-every-command>

## Questions this post answers

### How do I stop Claude Code from asking me to approve every command it runs?

Set defaultMode to auto in the permissions section of settings.json and add a deny list for destructive commands like git push --force, git reset --hard, rm -rf, npm publish, and docker system prune, plus an ask list for riskier-but-needed commands like git push and gh pr create. Claude Code checks deny rules first, then ask, then allow, so deny rules always block matching commands even if a narrower allow rule exists.

_daily.dev surfaces practical configuration tricks like this for developers tuning their AI coding agent workflows._

### Can a deny list in Claude Code fully prevent it from deleting my files?

No, a deny list cannot cover every destructive action. Blocking a command like rm -rf only stops that specific invocation; Claude could still use Python or another tool to delete the same files, since there are too many ways to perform the same destructive action to block them all individually.

_Developers weighing agent safety tradeoffs can track sandboxing and permission tips like this on daily.dev._

### Should I combine bypassPermissions with a deny list in Claude Code?

No, combining bypassPermissions with a deny list on a regular machine is not recommended, since bypassPermissions allows Claude to run anything not explicitly blocked, defeating the purpose of the safety list. Instead, reserve bypassPermissions for a disposable container or VM where a bad command cannot cause real damage, and use auto mode with sandboxing for regular machines.

_daily.dev helps developers compare safe automation setups before trusting an agent with shell access._

## Similar posts on daily.dev

- [Permission Fatigue Is a Security Risk — Improve It in Claude Code](https://daily.dev/posts/permission-fatigue-is-a-security-risk-improve-it-in-claude-code-qhdplwhrs) · Atomic Spin · 0 upvotes · 0 comments

---

Tags: [#devops](https://daily.dev/tags/devops), [#ai-agents](https://daily.dev/tags/ai-agents), [#claude-code](https://daily.dev/tags/claude-code)

[View this post on daily.dev](https://daily.dev/posts/i-gave-claude-code-a-deny-list-and-stopped-watching-every-command-it-tried-to-run-loabhycit)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I gave Claude Code a deny list, and stopped watching every command it tried to run","url":"https://daily.dev/posts/i-gave-claude-code-a-deny-list-and-stopped-watching-every-command-it-tried-to-run-loabhycit","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-gave-claude-code-a-deny-list-and-stopped-watching-every-command-it-tried-to-run-loabhycit"},"datePublished":"2026-09-01T18:00:54.065Z","dateModified":"2026-09-14T08:09:11.669Z","description":"A practical configuration approach for Claude Code that reduces the need to manually approve every command it runs. By combining auto mode with a deny list...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d039c76bdae73b49b1012e17e02aceb5?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d039c76bdae73b49b1012e17e02aceb5?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"XDA Developers","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"XDA Developers","logo":"https://media.daily.dev/image/upload/s--kCg6yyAP--/f_auto,q_auto/v1774964407/logos/xda-developers?_a=BAMAMiWQ0","url":"https://daily.dev/sources/xda-developers"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-gave-claude-code-a-deny-list-and-stopped-watching-every-command-it-tried-to-run-loabhycit","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devops,ai-agents,claude-code","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"XDA Developers","item":"https://daily.dev/sources/xda-developers"},{"@type":"ListItem","position":3,"name":"I gave Claude Code a deny list, and stopped watching every command it tried to run"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/i-gave-claude-code-a-deny-list-and-stopped-watching-every-command-it-tried-to-run-loabhycit#faq","mainEntity":[{"@type":"Question","name":"How do I stop Claude Code from asking me to approve every command it runs?","acceptedAnswer":{"@type":"Answer","text":"Set defaultMode to auto in the permissions section of settings.json and add a deny list for destructive commands like git push --force, git reset --hard, rm -rf, npm publish, and docker system prune, plus an ask list for riskier-but-needed commands like git push and gh pr create. Claude Code checks deny rules first, then ask, then allow, so deny rules always block matching commands even if a narrower allow rule exists. daily.dev surfaces practical configuration tricks like this for developers tuning their AI coding agent workflows."}},{"@type":"Question","name":"Can a deny list in Claude Code fully prevent it from deleting my files?","acceptedAnswer":{"@type":"Answer","text":"No, a deny list cannot cover every destructive action. Blocking a command like rm -rf only stops that specific invocation; Claude could still use Python or another tool to delete the same files, since there are too many ways to perform the same destructive action to block them all individually. Developers weighing agent safety tradeoffs can track sandboxing and permission tips like this on daily.dev."}},{"@type":"Question","name":"Should I combine bypassPermissions with a deny list in Claude Code?","acceptedAnswer":{"@type":"Answer","text":"No, combining bypassPermissions with a deny list on a regular machine is not recommended, since bypassPermissions allows Claude to run anything not explicitly blocked, defeating the purpose of the safety list. Instead, reserve bypassPermissions for a disposable container or VM where a bad command cannot cause real damage, and use auto mode with sandboxing for regular machines. daily.dev helps developers compare safe automation setups before trusting an agent with shell access."}}]}
```

