Claude Code rules: add guidance, then check the result
Use the Karpathy file as project guidance. Read it, keep your existing instructions and check whether the next change follows it.
What the Karpathy rules file is
It is a community set of coding instructions based on Andrej Karpathy's observations about common AI coding mistakes. The repository describes four principles: check assumptions, keep the solution simple, limit the changes and define how to verify the result.
The file asks Claude to work that way. It does not enforce a boundary, replace permission settings or guarantee that the code is correct. You still review the plan, the changes and the checks.
About accuracy claims: the quoted improvement from 65% to 94% is not established by this guide. Do not use it as a reason to trust a result.
1. Read the rules before adding them
Start with a local practice project and Claude Code already set up. Open the repository's CLAUDE.md and read the actual instructions. Check the source, files and any dependencies before you enable a third-party package.
The repository also offers a plugin. That is a separate installation route with its own scope and components. This walkthrough uses a project instruction file; it does not require you to install the plugin or run a remote script.
2. Merge the useful rules into your project instructions
Open the CLAUDE.md in your practice project, or create one if it has none. Keep any instructions already there. Add only the guidance you want and resolve contradictions rather than replacing the file wholesale.
- State important assumptions before changing the project.
- Choose a simple solution that meets the request.
- Keep edits within the agreed task.
- Describe the check that will show whether the change worked.
These are instructions to follow, not guarantees. Anthropic's memory documentation distinguishes instruction files from permission and sandbox settings that control access.
3. Try one small task and inspect the result
Start a new session in that project. First ask for a plan without file edits:
In this empty practice folder, propose a simple local page. List the missing facts and what you would check. Do not edit files, install packages or publish anything yet.Read the proposed assumptions. Correct anything it has guessed before authorising implementation. For your next real bug or build, try one of these:
Fix this bug. Change as little as possible and explain what you touched.Before you build this, tell me what done looks like and how you will check it.After it works, inspect the changed files and run checks appropriate to the task. If the result contradicts the rules, correct it. A rules file does not make a passing result automatic.
Does this make every action ask for permission?
No. Instruction text and permission settings do different jobs. Review the active mode and existing allow rules. Some actions can already be permitted; a sentence saying “ask first” is not an enforced approval boundary.
Sources reviewed 1 November 2026: community rules and provenance, instruction files and memory, permissions. Check current access and instructions if your account looks different.