{"id":50721336,"url":"https://github.com/codex-devlab/rune","last_synced_at":"2026-06-10T00:02:09.559Z","repository":{"id":362391237,"uuid":"1258863453","full_name":"codex-devlab/rune","owner":"codex-devlab","description":"Static Instruction Injection Optimizer for LLM agents (SIOP)","archived":false,"fork":false,"pushed_at":"2026-06-04T04:05:29.000Z","size":74,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-04T04:05:38.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codex-devlab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2026-06-04T01:50:43.000Z","updated_at":"2026-06-04T04:05:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codex-devlab/rune","commit_stats":null,"previous_names":["codex-devlab/rune"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codex-devlab/rune","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-devlab%2Frune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-devlab%2Frune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-devlab%2Frune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-devlab%2Frune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codex-devlab","download_url":"https://codeload.github.com/codex-devlab/rune/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codex-devlab%2Frune/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34130642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-10T00:02:09.487Z","updated_at":"2026-06-10T00:02:09.545Z","avatar_url":"https://github.com/codex-devlab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rune\n\n```\n─────────────────────────────────────────────────────────\n  ᚱᚢᚾᛖ  rune v0.1  ·  static instruction injection optimizer\n─────────────────────────────────────────────────────────\n```\n\nYour LLM agent reads `CLAUDE.md`, `.cursorrules`, and a pile of rules files\nbefore every single response. You never measured how much that costs.\n\n**rune** finds the waste.\n\n## What it does\n\n- **analyze** — count every token injected before your agent speaks.\u003cbr\u003e\n  　\u003csub\u003etiktoken · platform auto-detection · works on empty projects\u003c/sub\u003e\n- **dedup** — find rules you wrote twice (you did).\u003cbr\u003e\n  　\u003csub\u003esentence-transformers · cosine similarity · HIGH / MEDIUM / LOW confidence\u003c/sub\u003e\n- **trigger** — discover which rules fire conditionally vs. always.\u003cbr\u003e\n  　\u003csub\u003eTF-IDF keyword extraction · parsed trigger markers\u003c/sub\u003e\n- **scaffold** — bootstrap lean rule structures from templates.\u003cbr\u003e\n  　\u003csub\u003eclaude-code-base · python-backend · trigger-first layout\u003c/sub\u003e\n- **watch** — stream live session events to `events.jsonl` for later analysis.\u003cbr\u003e\n  　\u003csub\u003efile-watch loop · JSON event log\u003c/sub\u003e\n\n## Quick Start\n\n```bash\npip install rune\n\nrune analyze .          # works on empty projects — never crashes\nrune init               # bootstrap CLAUDE.md + .claude/rules/\nrune scaffold --type python-backend\nrune watch .            # start logging session events\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample output\u003c/summary\u003e\n\n```\nrune analyze — ~/my-project\nPlatform: claude_code\n\n  파일                              타입        토큰\n  ──────────────────────────────────────────────────\n  CLAUDE.md                         claude_md    342\n  .claude/rules/git.md              rule         180\n  .claude/rules/python.md           rule         210\n  .claude/rules/deploy.md           rule         195\n  .claude/rules/security.md         rule         220\n\n총 토큰: 1,147\n중복 탐지: 1쌍 (HIGH confidence)\n  - .claude/rules/git.md ↔ .claude/rules/deploy.md (97.3%)\n\n추천: rune optimize --dry-run 으로 최적화 미리보기\n```\n\n\u003c/details\u003e\n\n## Supported Platforms\n\n| Platform | Detection | Status |\n|---|---|---|\n| **Claude Code** | `.claude/` directory · `CLAUDE.md` | ✅ Stable |\n| **Cursor** | `.cursor/` directory · `.cursorrules` | 🔜 Planned |\n| **GitHub Copilot** | `.github/copilot-instructions.md` · `.github/copilot/` | 🔜 Planned |\n| **Gemini CLI** | `GEMINI.md` · `.gemini/` directory | 🔜 Planned |\n| **Windsurf** | `.windsurfrules` | 🔜 Planned |\n| **OpenCode** | `.opencode/` directory | 🔜 Planned |\n| **Generic** | `AGENTS.md`, `CLAUDE.md`, `GEMINI.md` scan | ✅ Stable |\n\n## Commands\n\n| Command | Description |\n|---|---|\n| `rune analyze [path]` | Analyze token injection footprint |\n| `rune analyze --json` | Machine-readable JSON output |\n| `rune analyze --no-semantic` | Skip sentence-transformers (faster, less accurate dedup) |\n| `rune init [path]` | Initialize recommended project structure |\n| `rune scaffold --type \u003ctype\u003e` | Generate project-type rule templates |\n| `rune watch [path]` | Monitor session events → `events.jsonl` |\n\n## User Levels\n\nrune never crashes on edge cases. It adapts output to what you actually have.\n\n| Level | What you have | rune output |\n|---|---|---|\n| 0 | No config at all | Guidance to run `rune init` |\n| 1 | A single `CLAUDE.md` | Token count, baseline established |\n| 2 | Some rules (3–4 files) | Dedup analysis + trigger suggestions |\n| 3 | Heavy setup (5+ sources) | Full optimization report |\n\n## Pipeline\n\n```\nINVENTORY → TOKENIZE → SCORE → DEDUP → TRIGGER\n```\n\n```\nrune/\n├── adapters/       # platform detection + source listing\n│   ├── base.py     # Platform enum, detect_platform(), InjectionAdapter ABC\n│   ├── claude_code.py\n│   ├── cursor.py\n│   └── generic.py\n├── pipeline/\n│   ├── inventory.py  # orchestrates adapter selection\n│   ├── tokenizer.py  # tiktoken + char-count fallback, paragraph chunking\n│   ├── scorer.py     # tier-1 structural + tier-2 TF-IDF importance\n│   ├── dedup.py      # cosine similarity (sentence-transformers → TF-IDF)\n│   └── trigger.py    # keyword extraction (parsed markers → TF-IDF)\n├── models/\n│   ├── source.py     # Chunk, InjectionSource\n│   └── report.py     # DedupPair, TriggerResult, AnalysisReport\n├── cli/\n│   ├── main.py       # typer app entry point\n│   ├── analyze.py    # rune analyze\n│   ├── init_cmd.py   # rune init\n│   ├── scaffold.py   # rune scaffold\n│   └── watch.py      # rune watch\n└── scaffold/\n    └── templates/    # claude-code-base, python-backend\n```\n\n## Research\n\nrune addresses the **Static Instruction Injection Optimization Problem (SIOP)** —\nthe static config layer (`CLAUDE.md`, `.cursorrules`, `rules/`) injected before every LLM session\nhas no tooling to measure or optimize its token footprint.\n\nExisting tools (RTK, context-mode, summarization) target *tool output* and *conversation history*.\nrune targets the *pre-session static layer* — a different, unaddressed problem.\n\nThe dedup and trigger results from `rune analyze` quantify what can be recovered through:\n- lazy-loading (trigger-gated rules loaded on demand)\n- deduplication (merge identical/near-identical rules)\n- verbatim compaction (remove redundant prose within rules)\n\n## License\n\nMIT\n\n```\n                  ᚠ    ᚢ    ᚦ    ᚨ    ᚱ    ᚲ\n                  ᚷ    ᚹ    ᚺ    ᚾ    ᛁ    ᛃ\n                  ᛇ    ᛈ    ᛉ    ᛊ    ᛏ    ᛒ\n                  ᛖ    ᛗ    ᛚ    ᛜ    ᛞ    ᛟ\n\n                        ᚱᚢᚾᛖ\n                  every token has a cost\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-devlab%2Frune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodex-devlab%2Frune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodex-devlab%2Frune/lists"}