Personal coding rules for Claude Code, auto-loaded via ~/.claude/rules/. Every rule exists because something went wrong without it.
227 rules across 22 categories. Battle-tested from production bugs, code reviews, and hard-won debugging sessions across React Native, TypeScript, Rust, and CI/CD pipelines.
git clone git@github.com:OctavianTocan/claude-rules.git ~/.claude/rulesRules load automatically on every Claude Code conversation. To update: cd ~/.claude/rules && git pull
| Category | Count | When it fires |
|---|---|---|
| ci/ | 49 | Editing .github/workflows/, Dockerfile, shell scripts |
| typescript/ | 17 | Editing .ts/.tsx files |
| react/ | 19 | Editing .ts/.tsx files |
| debugging/ | 18 | Always (general methodology) |
| brownfield/ | 15 | Editing native/RN brownfield files |
| git/ | 12 | Editing .github/ configs, shell scripts |
| twinmind/ | 10 | Editing app-specific .ts/.tsx/native files |
| react-native/ | 11 | Editing .ts/.tsx/.kt/.java/.swift files |
| testing/ | 8 | Editing test files |
| state-management/ | 6 | Editing .ts/.tsx/native files |
| error-handling/ | 8 | Editing .ts/.tsx files |
| api/ | 4 | Editing .ts/.tsx/.js files |
| auth/ | 4 | Editing .ts/.tsx files |
| sweep/ | 4 | Editing source files (AI review patterns) |
| general/ | 14 | Always |
| monorepo/ | 4 | Editing package.json, pnpm-workspace.yaml |
| expo/ | 3 | Editing Expo config and entry files |
| e2e/ | 3 | Editing Maestro/Android test files |
| figma/ | 5 | Editing .ts/.tsx/.css files |
| playwright/ | 5 | Editing Playwright test/config files |
| rust/ | 3 | Editing .rs files |
Every rule has YAML frontmatter with name and paths:
---
name: no-unwrap-in-production
paths: ["**/*.rs"]
---
# No unwrap() in Production Rust
Explanation of what goes wrong and why.
## Verify
"Am I using unwrap() anywhere? Can this fail at runtime?"
## Bad
...code example...
## Good
...code example...Claude Code loads rules matching the current file's path against the paths globs. General rules with ["**/*"] fire on every file.
- Pick the right category directory (or create one)
- File name = kebab-case summary of the rule
- Add
name:(kebab-case slug) andpaths:(glob array) - Include: what goes wrong, why, bad/good examples, and a Verify question
- Commit with
feat:prefix
Rules extracted from real projects:
- TwinMind — React Native brownfield meeting app (audio, streaming, native integrations)
- tap — Rust Telegram bot / multi-agent gateway (provider traits, subprocess testing)
- ai-nexus — TypeScript full-stack app (Biome, multi-agent git safety)
- openclaw-notion/todoist — Agent plugins (per-agent auth, test isolation)
- CI pipelines across self-hosted Mac Mini runners, GitHub Actions, and Gradle builds
Personal use.