Concepts

Rulesets

Persistent project instructions that are automatically available to the coding agent.

What is a Ruleset?

A Ruleset is a persistent engineering instruction — a coding convention, architecture rule, or project requirement — that's automatically available to your coding agent on every prompt. You write it once in XOROX; you don't paste it into chat again.

When to use one

Use a Ruleset for anything the agent should always know, regardless of what it's currently working on:

  • Coding conventions — naming, formatting, file organization.
  • Architecture rules — "API endpoints use service classes," "no direct DB access from controllers."
  • Framework constraints — which libraries are allowed, which patterns to avoid.
  • Project-specific requirements — security rules, testing requirements.

If an instruction only matters for one specific piece of work, it's better as a Specification attached to a Task instead of a Ruleset every prompt has to carry.

How the agent receives it

Rulesets reach the agent automatically — you never ask for them, and the agent never has to decide whether they're relevant. The exact mechanism differs by agent: in Cursor, full Ruleset content is pushed into every prompt through a beforeSubmitPrompt hook — see Cursor. In Claude Code, a short startup instruction tells the agent to retrieve full Ruleset content itself at the start of every session, before it does any implementation work, and a per-prompt hook delivers the current Rulesets again whenever they change — see Claude Code.

This is the key difference from Specifications: Rulesets reach the agent in full, automatically, without the agent judging relevance.

Enabling and disabling a Ruleset

A Ruleset has a status of active, inactive, or archived. Only active Rulesets are sent to the agent. Set one to inactive to stop it reaching the agent temporarily without deleting it.

When you change a Ruleset

XOROX always reads Rulesets live from the server, so an edit is available to your agent as soon as you save it — there is no cache to wait out. Each set of Rulesets has a revision that changes whenever the active Rulesets change (an edit, a rename, a Ruleset added, or one set to inactive or archived). Re-saving identical content does not change it.

  • Cursor receives the current Rulesets with every prompt, so the next prompt after a save already carries the new version.
  • Claude Code checks the revision on every prompt. When it has changed — or in a new session — the new Rulesets are delivered with that prompt. If they exceed Claude Code's 10,000-character hook limit, the agent is instead told on every prompt to retrieve them with xorox_get_rulesets until it does.

Each delivery is a complete snapshot labeled with its revision and marked as superseding any earlier XOROX Ruleset snapshots; if every Ruleset has been removed, the snapshot says so. This is an instruction to the model, not a deletion: earlier Ruleset text stays in the conversation's history, and the model is told to follow the newest snapshot over it. Start a new chat if you need the old text gone from that conversation.

If XOROX can't be reached when you submit a prompt, the prompt still goes through and Claude Code is told the Rulesets could not be refreshed, so it should not assume what it received earlier is current.