30 October 2026

دليل · Guide6 min read

احصر كتابة Claude Code داخل مجلد مشروعك بإعداد واحدKeep Claude Code writes inside your project folder

Lock Claude Code's file writes and reads to your project folder in every permission mode, with one line in your settings file.

Who this guide is for

Developers and founders running Claude Code locally or in auto mode who want clear boundaries.

Key terms

Working directory
The folder you launched Claude Code from, plus any folder you added with --add-dir, /add-dir or additionalDirectories.
Permission mode
How Claude Code decides when to ask you before an action, such as default, acceptEdits, plan and auto.
settings.json
The JSON file that holds Claude Code settings. It exists at user level, project level, and as a local file that is not shared.
Deny rule
A permission rule that blocks a tool or command. It only restricts and never grants new access.

The steps

  1. Step 1

    Understand what changes

    Claude Code 2.1.314 (October 30, 2026) added permissions.blockWritesOutsideWorkingDirectories. Once on, the Write, Edit and NotebookEdit tools refuse any path outside the working directories, in every permission mode.

    A matching setting exists for reading: permissions.blockReadsOutsideWorkingDirectories makes the file tools refuse reads outside the working directories.

    The idea is simple. Your project is the boundary. Claude works freely inside it. Anything outside needs your decision.

    code.claude.com
    The official Claude Code changelog entry for 2.1.314 adding blockWritesOutsideWorkingDirectories
    This line in the official changelog is where the new setting comes fromSource: code.claude.com

    Tip: Both settings govern the file tools. Shell commands have their own permission system and sandbox.

6 more steps wait for you after access

With the ready prompts and the takeaway

Bought this before?

Bought this before? Restore your access

Your access is tied to your email. Enter it here and the content opens right away, any time, on any device

Most value

Start building with me now

We sit together, break down your problem, and I build the AI solution with you step by step

60minutes
  • A private session with you
  • Real building during the session
  • Results you take with you when we finish
Book a build session

100% free

A free consultation about your problem

Start