Yeda AI Tips · #179

Español

Make Your Rules File a Map, Not a Library

Your always-on rules file is making your agent dumber.

The instinct is to teach the agent everything up front: coding conventions, deploy steps, the schema, the style guide, every gotcha you've ever hit. So the rules file (a CLAUDE.md, a system prompt, a .cursorrules) grows and grows. But everything in that file is loaded on every turn, whether the task needs it or not. Past a certain size it stops helping and starts hurting.

Every line is a per-turn tax

An always-on rules file is prepended to the context on every request. That has two costs:

A 2,000-line rules file doesn't make the agent smarter. It makes the important 20 lines harder to see.

A map points; a library hoards

Reframe the file as a map of the codebase, not a library of everything about it. A map is short. It says where things are and how to find more, and it trusts the agent to go get the detail when a task actually calls for it.

# CLAUDE.md (the map)

## Durable rules (always true, keep these tight)
- Run `make test` before every commit; coverage gate is 98%.
- Never commit to `main`; branch first.
- API errors return the `Problem` shape in `src/errors.ts`.

## Load on demand (pointers, not contents)
- Deploy steps: see `docs/DEPLOY.md`
- Data model + migrations: see `docs/schema.md`
- Frontend style guide: see `docs/style.md`

The durable rules — the handful of things that are true on every task — stay in the always-on layer. Everything else becomes a pointer the agent follows only when the work touches it. Progressive-disclosure features (skills, referenced docs, tool-loaded files) exist precisely so detail can live off the hot path.

Split by "always vs. sometimes"

Sort every candidate rule into one of two buckets:

BucketBelongs inExample
True on every taskAlways-on rules filetest command, branch policy, error shape
True only for some tasksOn-demand doc, linked from the mapdeploy runbook, migration steps, one subsystem's quirks

If a rule only matters when you're touching the payment code, it shouldn't tax every unrelated turn. Move it next to the payment code or into a doc the map references.

Power moves

Resources

Shipping AI or cloud systems? Yeda AI audits and hardens production LLM and cloud pipelines. Talk to us · Read the blog