Make Claude Code more deterministic with this one simple slash command

Make Claude Code more deterministic with this one simple slash command

TL;DR — claude-code-autoconfig now includes /extract-rules, a new command that makes Claude Code noticeably more deterministic npx claude-code-autoconfig@latest


After a few weeks with Claude Code, your CLAUDE.md has grown organically — corrections, conventions, gotchas. Memory has accumulated learnings across sessions.

Somewhere in all of that, you have explicit instructions — "always do X when touching these files," "never do Y in this directory." But those types of rules belong in .claude/rules/ — scoped, isolated, and loaded deterministically.


The problem: right instruction, wrong location

Claude Code has a hierarchy of configuration files, and each one loads differently:

  • CLAUDE.md loads every message, every session
  • MEMORY.md loads at session start (first 200 lines)
  • Rules (`.claude/rules/`) load only when Claude touches matching files

Most developers never move their instructions into rules. They leave "never use any in TypeScript" on line 147 of CLAUDE.md, where it competes with everything else for Claude's attention. Which works most of the time — but not every time.


The extraction pattern

Here's an example of what moving an instruction to a rule looks like:

Before — line 23 of CLAUDE.md:

Page scraper fixes must be scoped narrowly. Always verify which URL patterns a handler covers before modifying it.           

After — .claude/rules/scraper-scope.md:

---
paths: ["src/scrapers/**"]
---

Page scraper fixes must be scoped narrowly. Always verify which URL patterns a handler covers before modifying it.           

Same instruction. But now it loads only when Claude touches your scraper files — not when it's building UI or writing tests. Scoped rules make that correction permanent and precise.

The automation

When you run /extract-rules, it:

  1. Scans your CLAUDE.md, MEMORY.md, and other .claude/ configuration files for instructions that can be scoped to specific file paths
  2. Converts those instructions into scoped .claude/rules/ files that only load when relevant files are touched
  3. Deduplicates across sources
  4. Cleans up the originals

The result: your CLAUDE.md gets leaner (less noise), your rules get more focused (more signal), and Claude follows your instructions more reliably. Not because the instructions changed — but because now they load at the right time.


Most developers don't realize their project already has extractable rules. /extract-rules ships with claude-code-autoconfig and makes Claude Code noticeably more deterministic — npx claude-code-autoconfig@latest

Andrew, this is a clean separation of layers. CLAUDE.md = context, rules = enforcement → more predictable behavior

Like
Reply

Andrew did you go straight to Claude or did you try others first?

To view or add a comment, sign in

More articles by Andrew Ciccarelli

Others also viewed

Explore content categories