Skip to content
Back to search

claude-mega-brain

SkillWorks with Claude CodeGitHub

OKF-powered knowledge context for Claude Code — injects your project's knowledge base at every session

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/guhcostan--claude-mega-brain/badge.svg)](/listings/guhcostan--claude-mega-brain)

HTML

<a href="/listings/guhcostan--claude-mega-brain"><img src="/api/listings/guhcostan--claude-mega-brain/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

/plugin marketplace add guhcostan/claude-mega-brain
/plugin install mega-brain@mega-brain

Then in any project:

/mega-brain:init

Start a new session — the knowledge base loads automatically.

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 15 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "mega-brain",
  3. "owner": {
  4. "name": "Gustavo Costa",
  5. "url": "https://github.com/guhcostan"
  6. },
  7. "plugins": [
  8. {
  9. "name": "mega-brain",
  10. "source": "./",
  11. "description": "OKF-powered knowledge context for Claude Code",
  12. "version": "0.2.1"
  13. }
  14. ]
  15. }
README.md · README · 276 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. <img src="assets/logo.png" width="280" alt="claude-mega-brain logo" />
  3. # claude-mega-brain
  4. *Loads the knowledge. Skips the search.*
  5. [![CI](https://img.shields.io/github/actions/workflow/status/guhcostan/claude-mega-brain/test.yml?style=flat-square&color=111111&label=CI)](https://github.com/guhcostan/claude-mega-brain/actions)
  6. [![Stars](https://img.shields.io/github/stars/guhcostan/claude-mega-brain?style=flat-square&color=111111&label=stars)](https://github.com/guhcostan/claude-mega-brain)
  7. [![Release](https://img.shields.io/github/v/release/guhcostan/claude-mega-brain?style=flat-square&color=111111&label=release)](https://github.com/guhcostan/claude-mega-brain/releases)
  8. [![License](https://img.shields.io/badge/license-MIT-111111?style=flat-square)](LICENSE)
  9. [![Claude Code](https://img.shields.io/badge/works%20with-Claude%20Code-111111?style=flat-square)](https://github.com/anthropics/claude-code)
  10. **100% accuracy · 0 tool calls · −66% tokens vs Obsidian+MCP**
  11. Real agentic sessions. [Benchmark →](benchmarks/results/agentic-obsidian-vs-mega-brain.md)
  12. </div>
  13. ---
  14. ## Install
  15. ```
  16. /plugin marketplace add guhcostan/claude-mega-brain
  17. /plugin install mega-brain@mega-brain
  18. ```
  19. Then in any project:
  20. ```
  21. /mega-brain:init
  22. ```
  23. Start a new session — the knowledge base loads automatically.
  24. ---
  25. ## The problem
  26. Without claude-mega-brain, Claude guesses from training data:
  27. ```
  28. User: What column stores the order total?
  29. Claude (no context): Typically total_amount (DECIMAL) or amount (FLOAT)...
  30. # Wrong — this project uses total_cents (INT64)
  31. ```
  32. With claude-mega-brain, the exact schema is injected at `SessionStart`:
  33. ```
  34. <mega-brain>
  35. Knowledge: 4 documented concepts found in project
  36. docs/orders.md [BigQuery Table] — total_cents INT64, status STRING(pending/confirmed/shipped/done)
  37. docs/customers.md [BigQuery Table] — customer_id STRING, email STRING, country STRING
  38. docs/wau.md [Metric] — COUNT(DISTINCT user_id) WHERE session_date >= CURRENT_DATE-7
  39. docs/net_revenue.md [Metric] — SUM(total_cents - refund_cents)/100 WHERE status='done'
  40. </mega-brain>
  41. User: What column stores the order total?
  42. Claude: total_cents (INT64) — from docs/orders.md
  43. # Correct. 0 tool calls. First turn.
  44. ```
  45. ---
  46. ## Benchmark
  47. 10 questions with project-specific values unknowable from training data.
  48. Real agentic sessions — not simulated.
  49. ![Benchmark chart](assets/benchmark.svg)
  50. | metric | no context | Obsidian+MCP | CLAUDE.md (raw files) | **claude-mega-brain** |
  51. |---|--:|--:|--:|--:|
  52. | accuracy (no tools) | 50% | 13% | 100% | **100%** |
  53. | accuracy (agentic) | 100%† | 100%† | 100% | **100%** |
  54. | tool calls avg | 1.1 | 0.9 | 0.1 | **0** |
  55. | tokens avg | 61,521 | 49,186 | 20,624 | **16,547** |
  56. | latency avg ms | 10,267 | 10,986 | 5,494 | **4,384** |
  57. † raw and Obsidian+MCP reach 100% agentic accuracy by using tool calls to explore the project — spending 3–4× more tokens and time. Without tools, they drop to 50% and 13%.
  58. CLAUDE.md (raw files) matches mega-brain on accuracy but uses 25% more tokens and is 25% slower. mega-brain's compressed OKF index is smaller and faster — the gap widens as knowledge bases grow.
  59. [Full results](benchmarks/results/agentic-obsidian-vs-mega-brain.md) · [Reproduce](benchmarks/)
  60. ---
  61. ## How it works
  62. At `SessionStart`, a hook scans the entire project for any `.md` file with `type:` in its YAML frontmatter and injects a compact index:
  63. ```
  64. <mega-brain>
  65. Knowledge: 8 documented concepts found in project
  66. Recent (log.md):
  67. 2026-06-29 — added customers table
  68. index.md [Index] — Central reference for all sales data
  69. docs/orders.md [BigQuery Table] — One row per completed order
  70. docs/customers.md [BigQuery Table] — Customer profiles
  71. docs/wau.md [Metric] — Weekly active users
  72. ...
  73. </mega-brain>
  74. ```
  75. No dedicated folder needed — documents can live anywhere in the project. When Claude reads an OKF file, linked concepts surface automatically via `PostToolUse`.
  76. **Zero overhead when not in use** — if no documented concepts are found, the hook exits in <5ms.
  77. ---
  78. ## How it compares
  79. | tool | auto-inject | schema enforcement | tool calls to answer | accuracy (no tools) |
  80. |------|-------------|-------------------|---------------------|---------------------|
  81. | **claude-mega-brain** | ✓ SessionStart hook | required (`type:`) | **0** | **100%** |
  82. | CLAUDE.md + additionalDirectories | manual setup | none | 0 | 100%* |
  83. | Obsidian + MCP | ✗ manual | none | 1–3 | 13% |
  84. | Notion | ✗ manual | proprietary | N/A | — |
  85. | Logseq | ✗ plugin-based | none | N/A | — |
  86. | mem.ai | ✗ none | none | N/A | — |
  87. \* CLAUDE.md matches mega-brain accuracy but uses 25% more tokens and is 25% slower — raw file dump vs compressed structured index.
  88. ---
  89. ## OKF Format
  90. Any `.md` file in the project with `type:` in its YAML frontmatter is automatically picked up. No dedicated folder needed.
  91. ```markdown
  92. ---
  93. type: BigQuery Table
  94. title: Orders
  95. description: One row per completed customer order.
  96. resource: https://console.cloud.google.com/bigquery?p=acme&d=sales&t=orders
  97. tags: [sales, revenue]
  98. timestamp: 2026-06-29T00:00:00Z
  99. ---
  100. # Schema
  101. | Column | Type | Description |
  102. |-------------|-----------|--------------------------|
  103. | order_id | STRING | Globally unique order ID |
  104. | customer_id | STRING | FK → customers |
  105. | total_cents | INT64 | Order total in cents |
  106. | status | STRING | pending/confirmed/shipped/done |
  107. # Joins
  108. Joined with [customers](customers.md) on `customer_id`.
  109. ```
  110. ### Reserved files
  111. | File | Purpose |
  112. |------|---------|
  113. | `index.md` (with `type: Index`) | Knowledge map — Claude reads this first |
  114. | `log.md` (with `type: Log`) | Append-only changelog — last 3 entries injected at session start |
  115. ### Common types
  116. `BigQuery Table` · `BigQuery Dataset` · `Table` · `Metric` · `API` · `Runbook` · `Concept` · `Service` · `Pipeline`
  117. Types are freeform — add your own.
  118. ---
  119. ## Usage
  120. ### Start from scratch
  121. ```
  122. /mega-brain:init
  123. ```
  124. Creates `index.md` and `log.md` anywhere you want. Start a new session — context injects automatically.
  125. ### Migrate existing docs
  126. ```
  127. /mega-brain:migrate
  128. ```
  129. Scans `openapi.yaml`, `schema.prisma`, `schema.sql`, `docs/`, `README` sections and adds `type:` frontmatter to generate OKF concepts.
  130. ### Add a single concept
  131. ```
  132. /mega-brain:ingest
  133. ```
  134. Document a specific table, metric, API, or service. Saves the file wherever makes sense for your project structure.
  135. ---
  136. ## Installation
  137. ### Claude Code
  138. ```
  139. /plugin marketplace add guhcostan/claude-mega-brain
  140. /plugin install mega-brain@mega-brain
  141. ```
  142. ### Local development
  143. ```bash
  144. claude plugin install /path/to/claude-mega-brain
  145. ```
  146. ---
  147. ## Config (`.mega-brain.json`)
  148. Optional per-project overrides:
  149. ```json
  150. {
  151. "dir": "knowledge",
  152. "maxConcepts": 100,
  153. "priorityTypes": ["Metric", "BigQuery Table"]
  154. }
  155. ```
  156. | Field | Default | Description |
  157. |-------|---------|-------------|
  158. | `dir` | *(none)* | Limit scanning to this subdirectory (relative to project root). When unset, the entire project is scanned. |
  159. | `maxConcepts` | `60` | Max concepts in injected index |
  160. | `priorityTypes` | `[]` | Types shown at top of index |
  161. | `exclude` | `[]` | Additional dirs to skip when scanning |
  162. ---
  163. ## FAQ
  164. **Does it slow down every session?**
  165. No. If no OKF directory exists, the hook exits in <5ms with no context injected.
  166. **Can I use it with an existing wiki or docs folder?**
  167. Add `type:` YAML frontmatter to any Markdown file and drop it in your OKF dir. Done.
  168. **What if I have 500 concepts?**
  169. Set `maxConcepts` in `.mega-brain.json`. The index stays compact; `index.md` holds the full map.
  170. ---
  171. ## References
  172. - [Open Knowledge Format — Google Cloud](https://cloud.google.com/blog/products/data-analytics/how-the-open-knowledge-format-can-improve-data-sharing)
  173. - [LLM Wiki pattern — Andrej Karpathy](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)
  174. - [Mega Brain — Thiago Finch](https://www.instagram.com/reel/DZI-ys4h29A/) — the meme this plugin is named after
  175. ---
  176. ## Star History
  177. <a href="https://www.star-history.com/?type=date&repos=guhcostan%2Fclaude-mega-brain">
  178. <picture>
  179. <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=guhcostan/claude-mega-brain&type=date&theme=dark&legend=top-left" />
  180. <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=guhcostan/claude-mega-brain&type=date&legend=top-left" />
  181. <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=guhcostan/claude-mega-brain&type=date&legend=top-left" />
  182. </picture>
  183. </a>
  184. ---
  185. ## License
  186. [MIT](LICENSE) — The shortest license that works.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.