openhuman
openhuman copied to clipboard
[Feature] Audit and trim .claude/rules/ — most content is stale/duplicated/out-of-scope
Summary
Audit `.claude/rules/` (18 files, ~55k tokens) and delete/migrate files that are stale, duplicated elsewhere, or genuinely human-onboarding docs rather than AI behavior rules. Goal: bring total size from ~55k → <10k tokens so sessions don't pay the tax every turn.
PR #804 added `paths:` frontmatter as a conservative first pass (~25-30k session savings). This issue is the content follow-up.
Problem
The `.claude/rules/` directory was seeded in Jan-Feb 2026 when the project was positioned as a crypto-focused community platform. The project has since pivoted to an AI-powered assistant (see current `CLAUDE.md`) but the rules files have not been revisited. Concrete issues:
- Stale architecture: Multiple files reference `src-tauri/` at repo root (now `app/src-tauri/`), Telegram MTProto provider (current `CLAUDE.md` says explicitly "MTProto is not an active provider here"), and V8/deno_core (project uses QuickJS via `rquickjs`).
- Off-topic framing: `00-project-vision.md` and `01-project-overview.md` describe a crypto trader/yield-farmer platform. `12-design-system.md` describes "crypto community platform" visual tokens.
- Duplication: `11-tech-stack-detailed.md` overlaps heavily with `01-project-overview.md`. `12-design-system.md` duplicates `docs/DESIGN_GUIDELINES.md` (referenced from `CLAUDE.md`).
- Human docs, not AI rules: `03`-`06` (platform setup for Windows/macOS/Android/iOS — SDK installs, signing certificates, Xcode steps) are onboarding docs that belong under `docs/`, not loaded into every AI session.
- Contrast with project's own AI: `src/openhuman/agent/prompts/` (SOUL.md + IDENTITY.md + USER.md) is the system prompt the shipped OpenHuman agent uses. Total: ~900 tokens. The project itself has decided a lean behavior-focused prompt is correct. `.claude/rules/` is 60× heavier than that for contributor-facing AI context.
Solution
Categorize each file, then act:
Delete (stale or duplicated)
- `00-project-vision.md` — superseded by current `CLAUDE.md` framing
- `01-project-overview.md` — duplicated by `CLAUDE.md` "Repository layout"
- `11-tech-stack-detailed.md` — duplicates `01` and `CLAUDE.md`
- `12-design-system.md` — duplicates `docs/DESIGN_GUIDELINES.md`
- `13-backend-auth-implementation.md` — describes older ngrok/token-exchange flow; verify against current auth, likely superseded
Migrate to `docs/` (human-onboarding, not AI rules)
- `03-platform-setup-windows.md`
- `04-platform-setup-macos.md`
- `05-platform-setup-android.md`
- `06-platform-setup-ios.md`
- `09-permissions-capabilities.md`
- `14-deep-link-platform-guide.md`
- `15-settings-modal-system.md`
- `16-macos-background-execution.md`
Refresh and keep
- `02-development-commands.md` — update commands to match current `CLAUDE.md` (`yarn` workspaces, `app/` paths)
- `07-rust-backend-guide.md` — rewrite against current controller schema / event bus patterns
- `08-frontend-guide.md` — align with current `app/src` layout, kill MTProto refs
- `10-troubleshooting.md` — still useful, light refresh
- `17-skills-memory-inference-flow.md` — current and accurate, keep
Acceptance criteria
- [ ] Each of the 18 files reviewed, categorized (delete / migrate / refresh)
- [ ] Stale files deleted
- [ ] Human-docs moved under `docs/` with a single index
- [ ] Remaining rules refreshed against current architecture
- [ ] Total `.claude/rules/` size under 10k tokens
- [ ] `CLAUDE.md` updated to point to new `docs/` locations where relevant
Related
- PR #804 — `paths:` frontmatter for conditional loading (conservative first pass)
- `src/openhuman/agent/prompts/` — the project's own ~900-token AI system prompt (reference point)
- Original authors of `.claude/rules/`: @senamakel @graycyrus @M3gA-Mind