Configure Claude Code for Unattended Overnight Work: A Safe Automation Settings.json Guide
A developer shares a practical settings.json configuration to let Claude Code handle routine tasks automatically, eliminating constant permission prompts while maintaining safety.
Practical Summary
This guide details a specific settings.json configuration for Claude Code that automates permission decisions for safe commands, allowing the AI to work unattended on routine tasks. This setup reduces manual overhead, increases developer throughput, and can accelerate project delivery cycles by enabling overnight AI-assisted work.
Why It Matters
For developers and teams using AI coding assistants, constant permission requests create a significant productivity bottleneck. A well-configured automation setup transforms the tool from a frequently interrupted assistant into a reliable, autonomous teammate. This directly impacts revenue potential by allowing more work to be completed in the same time frame, whether for client projects, internal tools, or product features.
Understanding the Core Problem
Most Claude Code users face a dilemma: they either manually approve every single command ("click yes 100 times a day"), which is slow and interrupts flow, or they disable all permissions and risk the AI executing dangerous commands. Neither option supports efficient, scalable AI-assisted development.
The Solution: A Granular Settings.json Fence
The proposed solution is a settings.json file that acts as a "fence," categorizing commands into three buckets: routine actions that are always allowed, dangerous actions that are always denied, and uncertain actions that require explicit user approval. This enables Claude Code to run autonomously on safe, repetitive tasks—like building, testing, or formatting code—without supervision.
Practical Implementation Steps
1. Watch the referenced demo by Boris Cherny to understand the intended workflow. 2. In your Claude Code configuration, locate or create the settings.json file. 3. Define rules based on command patterns. For example, allow commands like `npm install`, `git status`, or `pytest` automatically. Deny commands like `rm -rf /`, `sudo rm`, or any system-altering commands. Set a default to "ask" for everything else. 4. Test the configuration on a non-critical project to verify that safe commands run automatically and dangerous ones are blocked.
