Local-firstCloud-syncedMCP-native

Your code says what.
Write down why.

Your AI agent relearns your codebase every session. SourceBrain captures the why once, syncs it to the cloud, and hands it back over MCP, so every future session on any machine already knows it. Nothing relearned, nothing lost.

$curl -fsSL https://sourcebrain.io/install.sh | sh

That one line installs the CLI. No account needed for local mode. Free for solo use, no credit card.

~/app · claude
> why does the mobile app refresh its token twice on launch?
sourcebrain - search_lessons (MCP) (query: "token refresh mobile")
2 lessons · auth/refresh-rotation · mobile/retry-policy
It's intentional. Per auth/refresh-rotation, rotated tokens stay valid 30s so retries don't fail.
> huh. write that down so nobody chases it again
sourcebrain - add_lesson (MCP) (path: "mobile/token-double-refresh")
mobile/token-double-refresh saved (v1)
synced to cloud · team-knowledge
>
? for shortcutssourcebrain mcp · connected

Works with

ClaudeCursorVS Code+ any MCP client

Features

What SourceBrain does

A handful of focused features that keep a knowledge base from rotting into another stale wiki nobody trusts. Pick one to see it run.

Claude · connected over MCP
Why did we move off Stripe Checkout?
We switched to the Payment Element for inline upgrades and SCA support.

Connect Claude or Cursor over MCP and your agent searches, reads, and writes lessons as it works, answering from your team's knowledge and citing the lesson it used. No MCP? Pipe a bundle into any chat with sourcebrain context.

So, what actually leaves your machine? Your source code stays on your machine.

Every command SourceBrain ships, and exactly what it puts on the wire. Your code sits on your side of the boundary, except the one slice you point at yourself. Pick a command and watch it.

Your machine
SourceBrain cloud

Your source code

Never leaves your machine. It stops at the boundary.

  • The lesson prose you wroteCrosses
  • Anchors: file path, symbol, line rangeCrosses

An anchor is a pointer, not a copy. It says auth/token.go:40, it does not carry line 40 with it. To power semantic search, the server embeds the lesson text itself, so your prose reaches an embeddings provider. Your code does not.

See versioned sync

In your editor

The “why” shows up next to the code

The SourceBrain extension for VS Code surfaces the lessons anchored to a file, symbol, or line range, right where you're reading the code. No tab-switching to go look it up.

  • Gutter markers on every line that has a lesson anchored to it
  • Hover to read the lesson inline, with a link to open the full thing
  • Select code → right-click to capture a lesson anchored to those exact lines
On Pro, the capture flow's Draft with AI button writes the lesson for you to edit and save.

Build from the repo today (editor/vscode, launch with F5). Marketplace & Open VSX listing coming.

internal/auth/token.go
38// SignToken issues a short-lived JWT.
39func SignToken(uid string) (string, error) {
40 claims := jwt.MapClaims{"sub": uid}
41 tok := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
42 return tok.SignedString(secret)
43}
44 
45// VerifyToken parses and checks a token.
46func VerifyToken(raw string) (*Claims, error) {
47 return parse(raw, secret)
48}
◆ SourceBrain1 lessonGoLn 40, Col 3

Hover the dotted line, or drag to select code and capture a lesson.

Knowledge graph

See how your knowledge connects

Link lessons with [[wikilinks]] and SourceBrain turns them into a map you can explore: no commands, no git. Click a node to open the lesson, follow backlinks to related context, and spot the gaps at a glance.

  • Backlinks: every lesson that points here, in one place
  • Orphan detection: find lessons nothing links to
  • Broken links surfaced as dashed-red nodes
8 lessons · 9 links
lesson broken link
jwtsessionsoauthonboardingbillingmigrationssearchmcprate-limit

Drag a node to move it, or click one to open its lesson.

Why not a wiki?

You've written things down before

The problem was never the writing. It's that nothing kept what you wrote true, close to the code, or visible to the tools doing the work.

WikiNotionSourceBrain
Versioned with your code
Anchored to real files & symbols
Flagged when the code drifts
Served to your AI over MCP
Lives in your repo

Pricing

Simple pricing

Start free. Upgrade when your team grows.

Free

Solo & small projects

$0forever
1 workspace3 members150 lessons
  • Full CLI & VS Code extension
  • MCP / AI integration
  • Version history & stale checks
  • Teams, plans, roles & approval
  • Personal "My Lessons" (3 free)
Start for free
Most popular

Pro

Growing teams

$20per month
Unlimited workspaces25 membersUnlimited lessons
  • Everything in Free, plus:
  • Semantic search + relevance
  • AI drafts, answers & codebase scan
  • Organizations & shared context
  • Drift & conflict detection
Start Pro

Enterprise

Large orgs

Custom
25+ membersSelf-hostable
  • Everything in Pro, plus:
  • Self-hosted server option
  • Onboarding & migration help
  • Dedicated support
Contact us

FAQ

Common questions

Do I need an account to use SourceBrain?

No. Local mode runs fully offline with no signup: lessons live in a .sourcebrain/ folder inside your repo, just like a .git/ directory. You only need an account for cloud workspaces and team features.

What happens when I hit the Free plan's lesson limit?

Nothing breaks. Every lesson you already have stays readable and editable, and version history keeps working. You just can't add new lessons to that workspace until you upgrade. Local mode is unlimited on every plan.

Can I start local and move to the cloud later?

Yes. sourcebrain push uploads your local lessons to a cloud workspace, and sourcebrain pull brings cloud changes back down. If the same lesson changed in both places, you get a side-by-side diff and choose what to keep.

Does SourceBrain send my code to an AI?

Not unless you ask it to. Local mode never phones home. The optional AI features send only the exact files you pick, only when you run them, and everything they draft is yours to review before it is saved.

We have many repos. Do we need a workspace per repo, with separate member lists?

One workspace per repo is the normal setup, and on Pro you can group them in an organization: one member list covers every org-visible workspace, so onboarding someone is one invite instead of N. An org can also designate a shared conventions workspace whose lessons join search and AI answers in every repo's workspace, and lessons can link across workspaces with [[ws:workspace/path]].

Can I self-host SourceBrain?

Yes. The Enterprise plan includes the full server stack, deployed on your own infrastructure with Docker Compose. The CLI works the same against a self-hosted server as against the hosted version.

Is SourceBrain open source?

The client is source-available on GitHub: the sourcebrain CLI and the VS Code extension, so you can inspect exactly what runs on your machine. It ships under the Functional Source License, which becomes Apache 2.0 after two years. The hosted service (server, billing, and the AI integration) stays closed.

Write down the first thing you wish someone had told you

Free to start, no credit card. Install the CLI, run sourcebrain init, and capture that one gotcha this repo keeps teaching the hard way.

Create your workspace →
SourceBrain: memory for your AI coding agent