{"id":48934862,"url":"https://github.com/manavarya09/team-brain","last_synced_at":"2026-04-17T11:05:06.290Z","repository":{"id":349645810,"uuid":"1195672545","full_name":"Manavarya09/team-brain","owner":"Manavarya09","description":"Git-native shared AI memory for teams. Your team's knowledge, conventions, and decisions — automatically loaded into Claude Code, Cursor, and Copilot.","archived":false,"fork":false,"pushed_at":"2026-04-06T22:21:16.000Z","size":29,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-07T00:25:57.764Z","etag":null,"topics":["adr","agents-md","ai-coding","claude","claude-code","conventions","developer-tools","onboarding","shared-context","team-memory"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/Manavarya09.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"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}},"created_at":"2026-03-30T00:14:39.000Z","updated_at":"2026-04-06T22:21:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Manavarya09/team-brain","commit_stats":null,"previous_names":["manavarya09/team-brain"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Manavarya09/team-brain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavarya09%2Fteam-brain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavarya09%2Fteam-brain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavarya09%2Fteam-brain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavarya09%2Fteam-brain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Manavarya09","download_url":"https://codeload.github.com/Manavarya09/team-brain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavarya09%2Fteam-brain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31926262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T10:35:34.458Z","status":"ssl_error","status_checked_at":"2026-04-17T10:35:09.472Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["adr","agents-md","ai-coding","claude","claude-code","conventions","developer-tools","onboarding","shared-context","team-memory"],"created_at":"2026-04-17T11:04:51.496Z","updated_at":"2026-04-17T11:05:06.286Z","avatar_url":"https://github.com/Manavarya09.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Team Brain\n\n**Git-native shared AI memory for teams.**\n\nYour teammate debugged that issue yesterday. Your team decided on REST over GraphQL last month. Your codebase has conventions that every AI session ignores.\n\nTeam Brain fixes this. Record lessons, decisions, and conventions once — they're automatically loaded into every Claude Code session, for every team member. No servers. No accounts. Just git.\n\n---\n\n## The Problem\n\nAI coding agents are single-player:\n\n- Your teammate spent 2 hours debugging a Stripe webhook — Claude doesn't know\n- The team agreed to use async/await everywhere — Claude uses `.then()` anyway\n- You onboarded a new dev — their Claude starts from absolute zero\n- Architecture decisions live in Slack threads nobody can find\n\nCLAUDE.md exists, but it's manually maintained and nobody updates it.\n\n## The Solution\n\nTeam Brain stores team knowledge in `.team-brain/` and auto-generates a `BRAIN.md` that Claude reads every session. Commit it to git. Everyone on the team gets the same context.\n\n```\n.team-brain/\n├── BRAIN.md                      # Auto-generated, Claude reads this\n├── conventions/\n│   └── always-use-async-await.md\n├── decisions/\n│   └── 001-rest-over-graphql.md\n├── lessons/\n│   └── 2026-03-30-stripe-webhook-retry.md\n└── knowledge/\n    └── api-rate-limits.md\n```\n\n---\n\n## Features\n\n### Record Lessons\n```\n/team-brain learn Stripe webhooks retry 3 times with exponential backoff\n```\nClaude captures the context from your current conversation, creates a structured entry, and regenerates BRAIN.md.\n\n### Record Decisions (ADR Format)\n```\n/team-brain decide Use REST over GraphQL for public API\n```\nCreates an Architecture Decision Record with Context, Decision, and Consequences sections.\n\n### Add Conventions\n```\n/team-brain convention Always use async/await, never .then() chains\n```\nConventions get highest priority in BRAIN.md — Claude sees them first.\n\n### Search the Brain\n```\n/team-brain recall stripe webhooks\n```\nKeyword + fuzzy search across all entries. Returns the most relevant matches with context snippets.\n\n### Onboard New Developers\n```\n/team-brain onboard\n```\nGenerates a comprehensive onboarding guide from all team brain entries — conventions, decisions, lessons, and project knowledge in one document.\n\n### Cross-Tool Generation\n```\n/team-brain sync              # Regenerate BRAIN.md\n/team-brain sync cursorrules  # Also generate .cursorrules (for Cursor)\n/team-brain sync agents       # Also generate AGENTS.md (universal standard)\n```\n\n### Auto-Loading\nTeam Brain includes a SessionStart hook that automatically loads context at the beginning of every Claude Code session. If any entries are newer than BRAIN.md, it regenerates automatically.\n\n---\n\n## Installation\n\n### Quick Install\n```bash\ngit clone https://github.com/Manavarya09/team-brain.git ~/.claude/plugins/team-brain\n```\n\n### Add the SessionStart hook to your settings\nAdd to `~/.claude/settings.json`:\n```json\n{\n  \"hooks\": {\n    \"SessionStart\": [\n      {\n        \"hooks\": [{\n          \"type\": \"command\",\n          \"command\": \"bash ~/.claude/plugins/team-brain/hooks/load-brain.sh\"\n        }]\n      }\n    ]\n  }\n}\n```\n\n### Initialize in your project\n```\n/team-brain init\n```\nThis creates `.team-brain/` in your repo root. Commit it to git.\n\n---\n\n## Usage\n\n### Quick Start\n```bash\n# Initialize team brain in your project\n/team-brain init\n\n# Add your first convention\n/team-brain convention Use TypeScript strict mode everywhere\n\n# Record a lesson from today's debugging\n/team-brain learn React useEffect cleanup runs on unmount AND re-render\n\n# Record an architecture decision\n/team-brain decide Use Zod for runtime validation at API boundaries\n\n# Commit and push so teammates get the context\ngit add .team-brain/ \u0026\u0026 git commit -m \"team-brain: add initial conventions and decisions\"\ngit push\n```\n\n### For Teammates\n```bash\n# Pull latest team brain entries\ngit pull\n\n# Context loads automatically on next Claude Code session\n# Or manually sync:\n/team-brain sync\n```\n\n### Search and Recall\n```bash\n/team-brain recall validation     # Search for entries about validation\n/team-brain recall                # Show recent entries\n/team-brain status                # Show stats and contributor info\n```\n\n---\n\n## Entry Format\n\nEvery entry is a markdown file with YAML frontmatter:\n\n```yaml\n---\ntitle: Stripe webhooks retry 3 times with exponential backoff\ntype: lesson\nauthor: manavarya\ndate: 2026-03-30\ntags: [stripe, webhooks, payments]\nstatus: active\n---\n\n## Context\nSpent 2 hours debugging why payment confirmations were duplicated.\n\n## Detail\nStripe retries failed webhook deliveries 3 times over 24 hours.\nOur handler wasn't idempotent, causing duplicate order processing.\nFixed by checking idempotency key before processing.\n\n## Related\n- PR #47: Add idempotency check to webhook handler\n```\n\n### Entry Types\n| Type | Directory | Priority | Format |\n|------|-----------|----------|--------|\n| Convention | `conventions/` | Highest | Rule + Examples + Rationale |\n| Decision | `decisions/` | High | ADR: Context + Decision + Consequences |\n| Lesson | `lessons/` | Medium | Context + Detail + Related |\n| Knowledge | `knowledge/` | Normal | Free-form project knowledge |\n\n---\n\n## How It Works\n\n1. **You record knowledge** via `/team-brain learn`, `/team-brain decide`, or `/team-brain convention`\n2. **Entries are saved** as markdown files in `.team-brain/`\n3. **BRAIN.md is auto-generated** — a prioritized summary under 180 lines\n4. **On session start**, the hook loads BRAIN.md into Claude's context\n5. **Teammates pull** via git and get the same context\n6. **Optionally generates** `.cursorrules` (Cursor) and `AGENTS.md` (universal)\n\n### Why 180 Lines?\n\nClaude Code applies instructions from context files with ~92% accuracy under 200 lines. Above 400 lines, accuracy drops to ~71%. Team Brain auto-prioritizes (conventions \u003e decisions \u003e lessons \u003e knowledge) and caps BRAIN.md at 180 lines to stay in the sweet spot.\n\n---\n\n## Configuration\n\nSettings are in `.team-brain/config.json`:\n\n```json\n{\n  \"brain_max_lines\": 180,\n  \"auto_generate\": true,\n  \"inject_into_claude_md\": true,\n  \"generate_cursorrules\": false,\n  \"generate_agents_md\": false,\n  \"priority_order\": [\"conventions\", \"decisions\", \"lessons\", \"knowledge\"],\n  \"max_entries_per_section\": 20,\n  \"include_dates\": true,\n  \"include_authors\": true\n}\n```\n\n| Setting | Description | Default |\n|---------|-------------|---------|\n| `brain_max_lines` | Max lines in BRAIN.md | 180 |\n| `inject_into_claude_md` | Auto-inject into CLAUDE.md | true |\n| `generate_cursorrules` | Also generate .cursorrules | false |\n| `generate_agents_md` | Also generate AGENTS.md | false |\n| `priority_order` | Section priority in BRAIN.md | conventions first |\n| `max_entries_per_section` | Max entries per section | 20 |\n\n---\n\n## Requirements\n\n- Claude Code (any version with skill/hook support)\n- Node.js (ships with Claude Code)\n- Git (for sharing with teammates)\n\n---\n\n## FAQ\n\n**Q: How is this different from just editing CLAUDE.md?**\nA: CLAUDE.md is static and manually maintained. Team Brain auto-generates it from structured entries, stays under the 180-line sweet spot, and makes it easy for any team member to contribute knowledge without editing a shared file.\n\n**Q: What happens when two people add entries on the same branch?**\nA: Each entry is its own file, so git merges cleanly. BRAIN.md is auto-generated, so even if it conflicts, running `/team-brain sync` regenerates it.\n\n**Q: Does this work with Cursor / Copilot?**\nA: Yes. Run `/team-brain sync cursorrules` to generate `.cursorrules` for Cursor. Run `/team-brain sync agents` to generate `AGENTS.md` which Copilot and other tools read.\n\n**Q: Will this slow down my sessions?**\nA: The SessionStart hook runs in under 100ms. It only regenerates BRAIN.md if entries have changed.\n\n**Q: Where is the data stored?**\nA: Everything is in `.team-brain/` in your repo root. It's just files in git — no databases, no cloud, no external services.\n\n---\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\nAreas where help is needed:\n- [ ] Auto-learn hook: detect patterns worth remembering from tool output\n- [ ] Conflict resolution UI for BRAIN.md merge conflicts\n- [ ] Team analytics dashboard (who's contributing, coverage gaps)\n- [ ] Integration with Linear/Jira for linking entries to tickets\n- [ ] VS Code extension for browsing team brain entries\n\n---\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n\n---\n\n**Your AI should know what your team knows.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanavarya09%2Fteam-brain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanavarya09%2Fteam-brain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanavarya09%2Fteam-brain/lists"}