{"id":48085199,"url":"https://github.com/Lexxes-Projects/obey","last_synced_at":"2026-04-20T01:00:44.600Z","repository":{"id":346139793,"uuid":"1188630445","full_name":"Lexxes-Projects/obey","owner":"Lexxes-Projects","description":"Makes Claude actually follow your rules. Save rules with natural language, enforce them with hooks, remember them across sessions.","archived":false,"fork":false,"pushed_at":"2026-03-22T13:38:46.000Z","size":302,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T14:01:37.112Z","etag":null,"topics":["ai","claude","claude-code","developer-tools","hooks","plugin","productivity","rules"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lexxes-Projects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["LXMedia1"],"ko_fi":"lexxes"}},"created_at":"2026-03-22T11:11:46.000Z","updated_at":"2026-03-22T13:38:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Lexxes-Projects/obey","commit_stats":null,"previous_names":["lexxes-projects/obey"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Lexxes-Projects/obey","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lexxes-Projects%2Fobey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lexxes-Projects%2Fobey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lexxes-Projects%2Fobey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lexxes-Projects%2Fobey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lexxes-Projects","download_url":"https://codeload.github.com/Lexxes-Projects/obey/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lexxes-Projects%2Fobey/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32028547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"ssl_error","status_checked_at":"2026-04-20T00:17:31.068Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","claude","claude-code","developer-tools","hooks","plugin","productivity","rules"],"created_at":"2026-04-04T15:14:13.314Z","updated_at":"2026-04-20T01:00:44.572Z","avatar_url":"https://github.com/Lexxes-Projects.png","language":"Shell","funding_links":["https://github.com/sponsors/LXMedia1","https://ko-fi.com/lexxes"],"categories":["Plugins"],"sub_categories":["All Plugins"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003eobey\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\u003cstrong\u003eMakes Claude actually follow your rules.\u003c/strong\u003e\u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://ko-fi.com/lexxes\"\u003e\u003cimg src=\"https://img.shields.io/badge/Ko--fi-Support%20obey-ff5e5b?style=flat-square\u0026logo=ko-fi\u0026logoColor=white\" alt=\"Ko-fi\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"demo.gif\" alt=\"obey demo\" width=\"600\"\u003e\n\u003c/p\u003e\n\n## The problem\n\nYou tell Claude \"never push to main.\" Claude agrees. Five minutes later, Claude pushes to main.\n\nThe memory system is passive — Claude writes rules down but doesn't actively check them. Hooks exist but require manual regex setup. There's no way to say \"remember this\" and have it actually stick.\n\n## The solution\n\n**obey** is a Claude Code plugin that stores your rules, injects them into every session, and actively blocks violations.\n\n```bash\n/remember never push to main\n# → Rule saved (global, hook-enforced)\n# → Claude is now blocked from running \"git push origin main\"\n\n/remember always explain your reasoning before writing code\n# → Rule saved (global, instruction)\n# → Injected at the start of every session as a reminder\n\n/remember never use .unwrap() --rust\n# → Rule saved (Rust projects only, blocks .unwrap() in code)\n```\n\nThat's it. Rules persist across sessions, survive context compaction, and get actively enforced.\n\n## How it works\n\n```\nYou say: \"/remember never force push\"\n                │\n    obey evaluates the rule:\n    ├── Scope: global (applies everywhere)\n    ├── Mechanism: hook (can be blocked by code)\n    ├── Pattern: git push --force\n    └── Saved to ~/.config/obey/global-rules.json\n                │\n    Next session starts:\n    ├── SessionStart hook fires\n    ├── All rules injected into Claude's context\n    └── Claude sees: \"RULE: Never force push\"\n                │\n    Claude tries: git push --force\n    ├── PreToolUse hook fires\n    ├── Pattern matches → BLOCKED\n    ├── Claude sees: \"Rule violated: Never force push\"\n    └── Claude adjusts behavior\n```\n\n## Install\n\n### From marketplace\n```\n/plugin marketplace add https://github.com/Lexxes-Projects/lexxes-plugins.git\n/plugin install obey@lexxes-plugins\n```\n\n### Local development\n```\nclaude --plugin-dir /path/to/obey\n```\n\n### Requirements\n- `jq` — auto-installed on first run (via apt, brew, choco, pacman, or dnf)\n\n## Commands\n\n### `/remember \u003crule\u003e [flags]`\n\nSave a persistent rule.\n\n```bash\n/remember never push to main                    # Auto-detected as global, hook-enforced\n/remember prefer functional style                # Auto-detected as global, instruction\n/remember never use console.log --node           # Node.js projects only\n/remember always run cargo clippy --rust          # Rust projects only\n/remember this project uses port 3000 --local    # This project only\n```\n\n**Flags:**\n- `--global` — applies to all projects (default for general rules)\n- `--local` / `--project` — only this project\n- `--rust` / `--node` / `--python` / `--go` / `--java` — only projects with that stack\n\n**Two enforcement types:**\n- **hook** — actively blocks violations (e.g., blocks `git push origin main`)\n- **instruction** — injected as reminder at session start AND right before the relevant tool is used (e.g., \"explain reasoning before writing code\" reminds you every time Claude is about to Write/Edit)\n- **both** — blocked AND reminded\n\n### `/rules [flags]`\n\nShow all active rules.\n\n```bash\n/rules              # Show all rules\n/rules --global     # Global rules only\n/rules --local      # Project rules only\n/rules --stack      # Stack-specific rules only\n```\n\n### `/forget \u003cid or keyword\u003e`\n\nRemove a rule.\n\n```bash\n/forget 17741838840474     # Remove by ID (shown in /rules output)\n/forget force push          # Remove by keyword search\n```\n\n## Rule scopes\n\n| Scope | Storage | Applies when |\n|---|---|---|\n| **Global** | `~/.config/obey/global-rules.json` | Every project, every session |\n| **Stack** | `~/.config/obey/stack-rules.json` | Project has matching stack file (Cargo.toml, package.json, etc.) |\n| **Project** | `.claude/obey.rules.local.json` | Only in this project directory |\n\nStack detection checks for: `Cargo.toml` (rust), `package.json` (node), `pyproject.toml`/`setup.py`/`requirements.txt` (python), `go.mod` (go), `pom.xml`/`build.gradle` (java).\n\n## What gets enforced\n\n**Hook-enforced (actively blocked):**\n- `git push` to main/master\n- `git push --force`\n- `cargo publish` / `npm publish`\n- `--visibility public` (making repos public)\n- `rm -rf` (dangerous deletions)\n- `.unwrap()` in Rust code\n- `console.log()` in production code\n- Editing `.env` files\n- Any custom pattern you define\n\n**Instruction-enforced (reminded at the right moment):**\n- Style preferences (\"prefer tabs over spaces\") → reminded before every Write/Edit\n- Process rules (\"always explain before coding\") → reminded before every Write/Edit\n- Quality standards (\"keep functions under 50 lines\") → reminded before every Write/Edit\n- Command rules (\"always run tests before committing\") → reminded before every Bash command\n- General guidance (\"keep responses short\") → reminded at session start only\n\nInstruction rules are smart about **when** to remind — a rule about writing code only triggers before Write/Edit, not before every Bash command.\n\n## Full hook coverage\n\nobey hooks into **every event** in the Claude Code lifecycle — 17 hooks total:\n\n| Hook | Purpose |\n|---|---|\n| **SessionStart** | Inject all rules into context at session start |\n| **InstructionsLoaded** | Re-inject rules when CLAUDE.md loads or reloads |\n| **UserPromptSubmit** | Detect natural rule statements, auto-save them |\n| **PreToolUse** | Block violations + inject reminders before tools |\n| **PermissionRequest** | Auto-deny actions that violate rules |\n| **PostToolUse** | Check output for violations + audit trail |\n| **PostToolUseFailure** | Check if failure relates to a rule violation |\n| **SubagentStart** | Inject rules into subagent context |\n| **SubagentStop** | Audit subagent completion |\n| **Stop** | Completion checklist — Claude can't finish until done |\n| **PreCompact** | Rules survive context compaction |\n| **PostCompact** | Fresh injection after compaction |\n| **TaskCompleted** | Per-task completion checklist |\n| **ConfigChange** | Remind about rules when settings change |\n| **Notification** | Remind about active rules when idle |\n| **SessionEnd** | Audit session end |\n\n### Completion checklist (Stop hook)\n\nRules with `stop` scope fire when Claude tries to finish:\n\n```bash\n/remember always run tests before finishing\n/remember always update the README before finishing\n/remember summarize what you did before stopping\n```\n\nClaude cannot stop until the checklist is complete.\n\n### Post-tool checks\n\nRules can check tool output after execution:\n\n```bash\n/remember warn if test output contains failures     # checks Bash output for FAIL/ERROR\n/remember warn if TODO comments in written code      # checks Write output for TODO/FIXME\n```\n\n### Audit trail\n\nEvery Bash command, file write, and edit is logged to `~/.config/obey/audit/YYYY-MM-DD.log`:\n\n```\n14:30:05 [abc12345] BASH: git push origin main\n14:30:12 [abc12345] WRITE: src/main.rs\n14:30:15 [abc12345] EDIT: src/lib.rs\n14:31:00 [abc12345] SESSION END (clear)\n```\n\n## Natural rule detection\n\nEven without `/remember`, obey detects rule-like language and saves it automatically:\n\n```\nYou: \"don't make repos public without asking\"\nClaude: \"I saved this as a rule: 'Don't make repos public without asking'.\n         Scope: global. Want to keep it or remove it?\"\n```\n\nDetected patterns: \"never\", \"always\", \"don't\", \"make sure\", \"prefer\", \"should\", \"must\", \"from now on\"\n\n## Cross-platform\n\nWorks on **Linux**, **macOS**, and **Windows** (Git Bash/MSYS2). All scripts use temp files instead of pipes to avoid `/proc/fd/` issues on Windows.\n\n## Uninstall\n\n```\n/plugin uninstall obey@lexxes-plugins\n```\n\nIf the plugin entry persists in `settings.json`, manually remove the `\"obey@lexxes-plugins\": true` line.\n\nClean up rule files:\n```bash\nrm -rf ~/.config/obey                          # Global + stack rules\nrm -f .claude/obey.rules.local.json            # Project rules\n```\n\n## FAQ\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eDoes this slow Claude down?\u003c/strong\u003e\u003c/summary\u003e\n\nBarely. The SessionStart hook runs once per session (~50ms). The PreToolUse hook only fires on Bash/Edit/Write tools and does a fast grep match (~10ms). Instruction-only rules have zero runtime cost — they're just text in the context.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eCan I share rules with my team?\u003c/strong\u003e\u003c/summary\u003e\n\nGlobal and stack rules are personal (stored in `~/.config/obey/`). Project rules in `.claude/obey.rules.local.json` are gitignored by default. If you want to share project rules, remove the gitignore entry and commit the file.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eWhat if I want to bypass a rule temporarily?\u003c/strong\u003e\u003c/summary\u003e\n\nWhen a rule blocks an action, Claude will tell you. You can say \"yes, do it anyway this time\" and Claude can ask you to approve the specific action. The rule stays active for next time.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eHow is this different from hookify?\u003c/strong\u003e\u003c/summary\u003e\n\nhookify requires you to manually write `.local.md` files with regex patterns. obey lets you say `/remember never push to main` and handles everything — scope detection, pattern generation, storage, and enforcement. obey also supports global and stack-specific rules, not just project-level.\n\u003c/details\u003e\n\n## License\n\nMIT\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eBuilt by \u003ca href=\"https://github.com/Lexxes-Projects\"\u003eLexxes Projects\u003c/a\u003e\u003c/sub\u003e\u003cbr\u003e\n  \u003csub\u003eIf obey saves you from rule-breaking AI, \u003ca href=\"https://ko-fi.com/lexxes\"\u003esupport the project\u003c/a\u003e\u003c/sub\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLexxes-Projects%2Fobey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLexxes-Projects%2Fobey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLexxes-Projects%2Fobey/lists"}