Add, change, remove or list a personal rule that applies only to the current GitHub repo or to all repos of its owner, and syncs between the user's own PCs (never to group members). Use when the user states a rule for one project or one owner that is about them personally (how to behave in that repo), not a group-wide rule.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Personal Rule?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mehdimamas-personal-rule)
---
name: personal-rule
description: Add, change, remove or list a personal rule that applies only to the current GitHub repo or to all repos of its owner, and syncs between the user's own PCs (never to group members). Use when the user states a rule for one project or one owner that is about them personally (how to behave in that repo), not a group-wide rule.
argument-hint: "add|change|remove|list [--owner] ..."
---
# personal-rule
Personal, project-scoped rules. The personal-rules mod loads them at session start. The personal dir `~/.claude/personal-state` is a git clone of the user's own private repo `<login>/claude-personal-rules` (owned by this mod, not by claude-sync). It is pulled at session start and each add/change/remove commits and pushes itself; a failed push is only a warning. Never use `<login>/claude-sync-personal` or write under `~/.claude-sync/`: that belongs to the claude-sync app.
First time on a machine: `node "${CLAUDE_SKILL_DIR}/../../bin/sync.mjs" setup` (creates the repo when missing, clones it, merges an existing folder without overwriting, copies old mod content from `~/.claude-sync/personal` read-only). Also: `sync.mjs pull`, `sync.mjs push "<msg>"`, `sync.mjs status`.
Scope: this repo (default) or every repo of its owner (`--owner`). Group-wide rules go to the `group-memory` skill, not here. No secrets, tokens or emails in a rule.
Run from the project folder (or pass `--cwd DIR`):
- `node "${CLAUDE_SKILL_DIR}/../../bin/rule.mjs" add "<one rule>"` or `add --owner "<one rule>"`
- `node "${CLAUDE_SKILL_DIR}/../../bin/rule.mjs" list [--owner]`
- `node "${CLAUDE_SKILL_DIR}/../../bin/rule.mjs" change <number|text> "<new rule>" [--owner]`
- `node "${CLAUDE_SKILL_DIR}/../../bin/rule.mjs" remove <number|text> [--owner]`
- `node "${CLAUDE_SKILL_DIR}/../../bin/rule.mjs" show` prints what the next session would load.
One bullet per rule, one short sentence. The script creates `projects/<repoId>-<owner>__<name>/rules.md` or `owners/<ownerId>-<login>.md` under the personal dir (`CLAUDE_SYNC_PERSONAL_DIR`, default `~/.claude/personal-state`) and looks up the GitHub ids with `gh`. It warns and starts a `.partN.md` file near 200 KiB (keep files under 256 KiB) and refuses past 16 MiB in total. Tell the user in one line what was saved.