uxplanet.org 6 min read Original Source

Anthropic Just Released New Rules of Claude Code

Things move fast in the AI space, and what we considered best practices for Claude Code just a few months ago may already be outdated with the release of the latest AI models like Opus 5.5 and Fable 5.2.

Lydia Hallie from the Claude Code team at Anthropic recently gave a talk on how her team uses Claude Code today. And some of the best practices Lydia’s team follows are quite different from how regular people use Claude Code.

In this article, I want to share 4 most important rules from her talk and explain how product designers can apply them to their workflows.

1. Get rid of legacy instructions in CLAUDE.md

CLAUDE.md is one of the files Claude Code reads when it starts working on a project. This file provides context for Claude, helping AI better understand the project it’s working on.

Many Claude Code users have traditionally used CLAUDE.md to guide (or, better say, steer) the AI model on how it should work.

If you open pretty much any CLAUDE.md file created before Opus 5.5, you’ll likely find instructions like:

=== CLAUDE.md ===

Think hard

Keep working until the task is finished

NEVER DO: Push changes to GitHub without human approval

IMPORTANT: Always write automated tests for new features

TECH STACK: We use Node 18
=== CLAUDE.md ===

Think hard

Keep working until the task is finished

NEVER DO: Push changes to GitHub without human approval

IMPORTANT: Always write automated tests for new features

TECH STACK: We use Node 18

Such instructions worked fine for previous generations of Claude models. But with the latest models, Opus 5.5 and Fable 5.2, some of these instructions can do more harm than good.

The truth is that Claude Opus 5.5 can extract a lot of information directly from the source code. It doesn’t necessarily need instructions like “TECH STACK: We use Node 18” because it can usually discover this information by examining the project.

Lydia also mentioned that overly emphatic instructions, such as “IMPORTANT” or “NEVER,” can make newer AI models perform worse because they force the models to behave in a particular way.

What Lydia suggests keeping in CLAUDE.md is information that Claude cannot discover by reading the source code.

What you need to do is review the instructions in your CLAUDE.md file and, for each instruction, ask a simple question:

Could Claude figure this out by reading my source code?

If the answer is “Yes,” you should remove such instruction.

The purpose of CLAUDE.md is shifting from a long list of instructions toward a compact source of essential project context.

For product design, it makes sense to use CLAUDE.md to point Claude toward information AI cannot extract from source code (such as business goals that your team recently discussed and decided to focus on).

Pro tip: You don’t have to review all your instructions in CLAUDE.md manually. Instead, you can ask Claude to audit your CLAUDE.md file using the following command:

/doctor prompt-audit
/doctor prompt-audit

and Claude will check your CLAUDE.md agains the Claude AI model you’re using and tell you want changes you need to introduce to CLAUDE.md to improve AI model performance.

2. Auto mode is ideal for everyday tasks

Claude Code offers several permission modes that determine how much autonomy Claude has when completing tasks.

These range from Manual, where you approve operations that require permission, to Bypass permissions, where Claude can execute commands without the usual approval prompts.

As you’ve probably guessed, neither extreme is ideal for most everyday tasks.

  • Manual requires constant involvement, limiting Claude’s ability to work autonomously.
  • Bypass permissions can be dangerous because Claude may perform operations you didn’t intend to allow.

Auto is now the default mode for new sessions in many Claude Code setups, and it’s arguably the most practical choice for most everyday tasks.

Before you ask a question about safety, Auto mode has a built-in classifier that evaluates the operations Claude is about to perform. If an operation is potentially risky or falls outside the trusted environment, the classifier can block it. Claude may then find a safer alternative or ask for your approval.

And if you’re worried about the security of commands Claude executes, Auto mode is pretty good at identifying security risks. In fact, Anthropic conducted a study and found that Auto mode blocked 89% of dangerous commands, compared with only 14% caught by people reviewing commands manually.

And another good thing about Auto mode is that by default it operates within the limits of your project. It means that if you ask Claude to add a new feature in your project in Auto mode, it will change source code in your project but won’t push this change to the production.

Push to repo & Deploy commands are blocked by default in Auto mode.

One interesting thing Lydia mentioned in her talk is that you can configure Auto mode using plain language, specifying which operations Claude should be allowed to perform and which it should block.

=== ~/.claude/settings.json ===

{
  "autoMode": {
    "environment": [
      "$defaults",
      "Source control: github.com/acme and all repos under it",
      "Trusted cloud buckets: s3://acme-staging",
      "Trusted internal domains: *.internal.acme.com"
    ],
    "allow": ["$defaults", "Deploying to staging is allowed"],
    "hard_deny": ["$defaults", "Never send code to third-party APIs"]
  }
}
=== ~/.claude/settings.json ===

{
  "autoMode": {
    "environment": [
      "$defaults",
      "Source control: github.com/acme and all repos under it",
      "Trusted cloud buckets: s3://acme-staging",
      "Trusted internal domains: *.internal.acme.com"
    ],
    "allow": ["$defaults", "Deploying to staging is allowed"],
    "hard_deny": ["$defaults", "Never send code to third-party APIs"]
  }
}

Pay attention to the hard_deny field. It contains instructions for actions that the Auto mode classifier should block even if the user requests them.

Previously, you typically described these restrictions in CLAUDE.md or in individual prompts. Moving them into dedicated Auto mode settings gives the classifier a clearer policy.

Pro tip: You don’t have to configure ~/.claude/settings.json manually. You can run:

/auto-mode-setup
/auto-mode-setup

3. Use a sandbox environment for dangerous operations

Speaking of dangerous commands, there’s always a chance that Claude may execute an operation with consequences that are difficult to reverse.

Luckily, there’s a mechanism that allows you to limit the impact of such operations: sandboxing. A sandbox is an isolated environment where operations can run with restrictions on which files, folders, and network destinations they can access.

Why is this important? Imagine that Claude runs npm test to verify the code it generated. This looks like a perfectly safe command, and both you and Auto mode would probably approve it.

But what if one of the dependencies executed by that command contains malicious code? It could attempt to read sensitive files or send data to an external server.

Permission rules primarily control which operations Claude can start. They don’t necessarily control everything those operations can access while running.

A sandbox addresses this problem by restricting what the running process and its child processes can access.

Claude Code supports local sandboxing, which you can configure using a prompt:

/sandbox
/sandbox

You can define restrictions on file access and network connections, reducing the risk of unexpected side effects.

4. Use hooks to improve the quality of Claude’s output

Hooks are a great built-in Claude Code mechanism for validating the quality of the output an AI model produces.

The nice thing about hooks is that they can be triggered automatically, without your involvement, solely based on operations that Claude performs.

For example, you can configure a hook that runs:

  • After every file edit to check code quality.
  • When Claude marks a task as complete to run relevant tests.
  • Before Claude finishes a session to run the entire test suite.

But Lydia made another important point: The key to reliable AI-generated output is having clear verification criteria.

Instead of simply asking Claude to build a feature, you should define what successful completion looks like and introduce checkpoints that Claude can use to verify its work.

For product designers, those checkpoints might include:

  • Checking whether UI components follow the design system.
  • Running accessibility tests after UI changes.
  • Comparing screenshots of the generated interface with the intended design.
  • Verifying that important user flows still work after changes.

These checks should ideally produce clear PASS/FAIL results rather than vague feedback.

And one particularly important detail Lydia mentioned concerns the exit codes used by Claude Code hooks. A hook script can finish with different exit codes:

  • Exit code 0: Success. The hook completed normally.
  • Exit code 1: A non-blocking error in most cases. Claude Code may continue despite the failure.
  • Exit code 2: A blocking error. For hooks that control task completion, this tells Claude Code that the task cannot be considered finished.

This matters because many testing tools return exit code 1 when a test fails. If a hook simply passes that exit code through, Claude Code may still consider the task complete.

To make the failure block completion and send Claude back to fix the problem, the hook should return exit code 2.

Want to master Claude Code?

Check out my complete guide to Claude Code, packed with highly practical insights on how you can integrate it into your design process. This guide is updated on a weekly basis, so you’ll always get the latest information about Claude Code.

Claude Code: Practical Guide for Product Designers
Practical guide for product designers who want to master Claude Code It covers the following topics: Claude Code Best…