DEV Community

Cover image for Claude config: my rules were too heavy for small projects, so I added profiles
Angelo Pirola
Angelo Pirola

Posted on

Claude config: my rules were too heavy for small projects, so I added profiles

claude-config is my template repository of rule files for Claude Code on .NET + Angular projects, plus a personal plugin, kit, with hooks and slash commands. This follows my 14/11/2026 update, but you don't need to have read it.

If you already use the kit: the versions after 1.14.0 include breaking changes, including renamed and removed /kit: commands. Check them before updating. I will cover them, with the upgrade steps, in the next article.

The problem

The rules were written for a large, structured project: OWASP ASVS, threat models, dynamic scanning, runbooks, observability, backup objectives. A small internal script got the same treatment.

It also had a measurable cost. In 1.14.0, the rule files without a paths: filter, which Claude Code loads in every session, added up to about 88 KB. All of it was there before the first line of code, whatever the project needed.

Three profiles

Each project now declares a profile in its CLAUDE.md. The field names are in Italian, like the rules:

- **Profilo:** mini
Enter fullscreen mode Exit fullscreen mode
  • mini: a script, an internal tool, a prototype.
  • standard: a normal application.
  • strutturato ("structured"): the full set, and the default.

For a new project, the profile is now the first setup question, because it decides which other questions are worth asking.

What gets loaded

These are the rule files loaded in every session, measured on version 3.1.0 (1 KB = 1,000 bytes):

Version / profile Always-loaded rules
1.14.0 (no profiles) 88.2 KB
3.1.0 strutturato 86.8 KB
3.1.0 standard 36.3 KB
3.1.0 mini 14.3 KB

Read the table with care:

  • strutturato is practically as heavy as before. The saving is for the other two profiles.
  • These are bytes, not tokens. I did not measure token usage, and I did not measure whether Claude follows a shorter rule set better.
  • CLAUDE.md is not included. The empty template alone is about 17 KB, more than the whole mini rule set.
  • Path-scoped modules are not included. When Claude works on matching files, they load in addition. The big ones are the frontend module (about 35 KB) and the main backend module (about 32 KB), and there are others.

mini: four files

  • core.md: the non-negotiables, such as asking when in doubt, verifying with build and tests, free and permissively licensed dependencies, and a minimal changelog.
  • lavoro.md ("work"): context handling, bug investigation, untrusted content, rollback.
  • git.md: git flow with develop, Conventional Commits, forbidden commands.
  • security.md: no secrets in the repository, no personal data in logs, no real data in tests.

Many other modules move to .claude/rules-optional/, which Claude Code does not load: extended workflow, quality checklist, detailed git flow, documentation, operations and advanced security.

standard: short versions, full text on the side

Moving files was not enough here. standard needs the workflow, quality, git and documentation rules, but not every paragraph of them.

So five modules have a short version. It goes into .claude/rules/, while the full text is copied to .claude/rules-optional/dettaglio/: not loaded, but there to be read on request.

The price is two texts for the same rules, which can drift apart. I have to keep them aligned.

strutturato: everything

This profile also loads security-strutturato.md: the ASVS map, supply chain, dynamic scanning, security logging and alerting, and automated security tests. A project that declares no profile is treated as strutturato, so existing projects don't lose obligations just by not choosing.

It took more than one attempt

Profiles arrived in 2.0.0. At that point mini still loaded about 67 KB, far from my 15 KB target, and I dropped the target.

Having a flag called mini was not the same as having a small rule set. In 3.0.0 I picked the target up again and split the files themselves: a minimal core.md and git.md, with the rest in separate modules. Section numbers stayed the same, so references such as "§6.5" can still be resolved.

standard needed several steps too: about 88.5 KB, then 73 KB after moving the structured security rules out, then under 40 KB with the short versions.

Fewer questions in mini

One rule in this kit says: when in doubt, Claude asks one question at a time. Many architectural choices are also marked "ask, don't assume". For a prototype, that can mean a long interview.

In mini, many of those choices now take a default written in CLAUDE.md, for example:

  • EF Core and FluentValidation
  • the standard .NET logging provider
  • no cache, no messaging, no background jobs
  • no email sending

Some are still asked: ASVS level, backend architecture, database, frontend technology and mobile.

This is a deliberate, limited exception: the defaults are listed in a file you can read and change. Outside that list, the one-question rule still applies.

The design rule behind it

The decision is recorded in an ADR (docs/adr/0001-profili.md). Its main idea is:

The profile sets the minimum. A feature can raise it.

The intent is that authentication, file uploads or personal data bring their obligations with them, even in mini. "It's only a prototype" doesn't make personal data less personal.

That is the intent. The next section shows where the files don't fully deliver it yet.

Honest limits

  • The security review trigger has a gap in mini. The detailed rule lives in a module that mini does not load, and an always-loaded file still points to its old location, mentioning the review only as a preference (#103). In mini, don't assume the review will happen: ask for it.
  • The ADR and the modules don't fully match. The ADR assigns the threat model to strutturato, but standard loads that rule too (#104).
  • The profile does not configure the hooks. The plugin's hook scripts don't read it.
  • Tests have a narrow scope. The 149 plugin tests pass on 3.1.0. They check the plugin, not the quality of what Claude produces. The sizes above are a separate measurement.
  • Profile setup needs more real-world testing. When the profile-based copy and setup procedures were changed, the changelog recorded that they had not yet been run on a trial project. Check what was copied, and use /context to see what is loaded.

Trying it

Install the plugin:

claude plugin marketplace add AngeloDotNet/claude-config
claude plugin install kit@claude-config
Enter fullscreen mode Exit fullscreen mode

The commands that copy rules read the template from a local clone, whose path goes in the KIT_CONFIG_TEMPLATE_DIR environment variable. Then use /kit:avvia-progetto for a new project, or /kit:regole to add the rules to an existing one.

If you are upgrading from 1.14.0, read the breaking changes in the CHANGELOG.md first.

Links

How do you handle this? One rule set for every project, or different levels? And what would you never remove, even from a prototype?

Top comments (10)

Collapse
 
crisstiank profile image
Cristian K •

Good that you called out that strutturato is still ~87 KB and that these are bytes, not tokens. One thing worth trying on the heavy profile: the rule files you only need for specific areas (security, runbooks) can use a paths: filter so they load only when matching files are touched, which would shrink the always-loaded number without dropping a profile. Do you know which of the 86.8 KB are rules that every task actually needs?

Collapse
 
angelodotnet profile image
Angelo Pirola •

Thanks, I measured it instead of estimating.

The always-loaded set for strutturato is 85,565 bytes (about 85.6 KB). The standard profile uses short versions of four modules, so it comes to about 40 KB, and mini is about 15 KB.

Of the heavy profile, the core that every task needs is about 15 KB (core, workflow of the team, basic security).

The biggest candidates for moving out of the always-loaded set are the Git flow (26 KB, needed only when committing or releasing) and the strict-security module (10.6 KB, needed only for sensitive features).

You are right that paths: helps for area-specific rules.

It does not fit Git well, because it triggers on files being read, and no file path means "I am committing".

For Git I would turn the PR and release sections into an on-demand skill, which loads only when invoked. I am measuring the real load in a session with /context before I change anything.

Collapse
 
dosaygo profile image
dosaygo •

How are you checking that the short and full rule files stay aligned when one changes, especially when a security obligation moves between modules?

Collapse
 
angelodotnet profile image
Angelo Pirola •

Honest answer: today it is mostly manual, and I'd rather say that than claim a guarantee.

  • The standard profile uses short versions of five modules (git-flusso, git-avanzato, workflow, qualita, documentazione). The full text lives in a separate folder. A test checks that the copy script puts the right file in the right place and that each copy is byte-identical to its source. It does not check that the short text says the same thing as the full one.

  • Each rule file has a version header. The update check compares those numbers. A version bump tells you a file changed, not which obligation moved.

  • Which module owns which obligation, and from which profile it applies, is a table in an ADR. The ADR says the table must be reviewed when a rule changes. Nothing enforces that.

  • The case you are asking about is real. "Dati e Segreti" appears in both the mini security.md and the full security-strutturato.md, and "Test di sicurezza automatici" appears in both security-avanzata.md and security-strutturato.md. Editing one copy does not update the other.

So if a security obligation moves between modules, the only guard today is a human reading the diff against the ADR table. I'm looking at adding a check that fails when an obligation listed in the table disappears from its source module. It would catch removals, not changes in wording.

Collapse
 
dosaygo profile image
dosaygo •

Thanks for explaining the ADR ownership table and the manual diff review when security obligations move. I’m building AI Lint, which gives coding agents a pre-flight checklist, doctrine and reject catalog alongside project rules; it doesn’t automatically prove that two rule files have the same meaning. The free edition is for personal use, while company teams use paid packs or a Company license: ai-lint.dosaygo.com/go/forum-20261...

Collapse
 
paragonaimag profile image
Paragon •

Mini 14.3 KB, our median 18 views.

Collapse
 
angelodotnet profile image
Angelo Pirola •

The always-loaded files in the mini profile are core, lavoro, git and security. In the current repository they total 14,844 bytes, about 14.5 KiB or 14.8 kB depending on the unit. Your 14.3 KB is close; the exact figure depends on the unit and on what you count. Files that match a path (backend, frontend) load on top of these when you work on them.

I can't see view counts from the repository, so I won't comment on the traffic figures.

Collapse
 
paragonaimag profile image
Paragon •

Fair enough on both counts — thanks for the exact 14,844 bytes, that's a cleaner number than my 14.3 KB. And you're right not to comment on the traffic side; the 18 was from our own dashboard, not something you'd see in the repo.

Collapse
 
paul_irolla_6b5ae261d0224 profile image
Paul Irolla •

Profiles that load only the rules a project needs cut the fixed cost, so how they get picked matters. Do they follow the folder, or does each project name its profile by hand?

Collapse
 
angelodotnet profile image
Angelo Pirola •

Good question. It is by hand, not by folder.

Each project declares its profile once, in a Profile: line in its CLAUDE.md.

The setup asks for it as its first question, and the tooling reads that line to decide which rule modules to copy and which reminders to show.

If the line is missing, the default is the strictest profile.

Nothing switches profiles automatically: if a small script later gets authentication or uploads, someone has to change the line. I chose that on purpose.

Security-relevant features (auth, uploads, personal data) bring their rules in under every profile, so the profile sets a baseline and is not a way around the rules.