sub_folder_rules

sub_folder_rules is a cursor rule for Cursor from shalomeir/common-memory-bank. It costs 1,066 tokens per session, scanned A, original, Unlicense.

A system for storing Cursor rules by folder path, so different parts of a project can have their own instructions. A rule list records where those subfolder rules are stored.

In plain words
What is it for?
Use it to create or maintain path-specific Cursor rules and to check which rules apply before changing a particular file.
Why use it?
It helps apply the right guidance when editing a file without loading unrelated rules from other folders.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/shalomeir/common-memory-bank/sub_folder_rules
Clone the repo
git clone --depth 1 https://github.com/shalomeir/common-memory-bank

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sub_folder_rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/shalomeir/common-memory-bank/sub_folder_rules.svg)](https://agentmods.dev/rules/shalomeir/common-memory-bank/sub_folder_rules)
Your own site
<a href="https://agentmods.dev/rules/shalomeir/common-memory-bank/sub_folder_rules"><img src="https://agentmods.dev/badge/rules/shalomeir/common-memory-bank/sub_folder_rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,066 This file is loaded in full into every session.
When invoked 1,066 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01066 $0.01066
Opus 5 $0.00533 $0.00533
Sonnet 5 $0.00213 $0.00213
Haiku 4.5 $0.00107 $0.00107

Measured 3d ago against content hash 7574f5bb5df8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sub_folder_rules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/sub_folder_rules.mdc · 123 lines

How it starts

The opening of the file, as written. The whole thing — 123 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Folder Path-Based Sub Rule Management System

Basic Structure

  1. All subfolder rules are stored in the .cursor/rules/subrules/ directory.
  2. The rules of each subfolder are stored according to the directory structure reflecting the folder path.
  3. The paths of all rule files are recorded in .cursor/rules/subrules/rule_list.txt.

Rule File Path Rules

  1. Rule files for a specific folder reflect the folder path as it is:

    • Example: Rules related to ./src/components/auth.ts are stored in .cursor/rules/subrules/src/components/subrule.txt
  2. The rule_list.txt file records the full paths of all subrule files, one per line:

./cursor/rules/subrules/src/components/subrule.txt
./cursor/rules/subrules/src/utils/api/subrule.txt
./cursor/rules/subrules/src/auth/subrule.txt

Rule Application Mechanism

  1. When modifying or creating a specific file:

    • Read the .cursor/rules/subrules/rule_list.txt file first.
    • Check the path of the file you are currently working on. - Check if there is a subfolder rule file related to the path.
    • If there is a related rule file, add its contents to the context.
  2. Path matching method:

    • If the file path is a subpath of the rule file path, the rule is applied.
    • Example: When modifying the file ./src/components/auth/login.ts, the rule ./cursor/rules/subrules/src/components/subrule.txt is applied.

How to create and register a rule file

When special subrules are needed

  1. When there is a requirement to record separately in the process of creating, modifying, or deleting the subcode of the corresponding subfolder
  2. Special arcitecture pattern applied only under the corresponding subfolder
  3. Special technical context applied only under the corresponding subfolder
  4. Bug fixes found in the subcode of the corresponding subfolder and handled as an exception
  5. Other exception measures applied only under the corresponding subfolder

Create a new rule file

  1. When a special rule for a specific subfolder is needed:
If a special rule related to ./src/components/auth.ts is needed:

Read the full file on GitHub · 123 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 123 lines · 1,066 tokens per session scan A 7574f5bb5df8

Subscribe to this mod's changes

sub_folder_rules is a cursor rule published in the GitHub repository shalomeir/common-memory-bank (30 stars, last pushed 4mo ago), licensed Unlicense. It adds 1,066 tokens to every session, about $0.0053 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.