npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@brainbank/git

v0.1.1

Published

Git history indexing plugin for BrainBank — commit search + co-edit analysis

Downloads

72

Readme

@brainbank/git

Git history indexing plugin for BrainBank. Indexes commit messages, diffs, and file change patterns. Computes co-edit relationships to suggest files that tend to change together.

Install

# Global install (CLI + programmatic)
npm i -g brainbank @brainbank/git

# Or as a project dependency
npm i @brainbank/git

Quick Start

import { BrainBank } from 'brainbank';
import { git } from '@brainbank/git';

const brain = new BrainBank({ dbPath: '.brainbank/db' })
  .use(git({ depth: 500 }));

await brain.initialize();
await brain.index({ modules: ['git'] });

// Search commit history by meaning
const results = await brain.search('authentication refactor');

Multi-Repo

Index multiple repositories into one shared database:

const brain = new BrainBank({ dbPath: '.brainbank/db' })
  .use(git({ repoPath: './frontend', name: 'git:frontend' }))
  .use(git({ repoPath: './backend',  name: 'git:backend' }));

API

git(options?): Plugin

Factory function — creates a git indexing plugin.

| Option | Type | Default | Description | |--------|------|---------|-------------| | repoPath | string | config | Repository root to index | | depth | number | 500 | Max commits to index | | maxDiffBytes | number | 8192 | Max diff size per commit (truncated beyond) | | name | string | 'git' | Plugin name for multi-repo (e.g. 'git:frontend') | | embeddingProvider | EmbeddingProvider | global | Per-plugin embedding override |

GitIndexer

Core indexing engine. Parses git log, computes diffs, embeds commit content, and stores in SQLite + HNSW.

Key behaviors:

  • Incremental — only processes new commits not already in the database
  • Zombie cleanup — detects commits with data but missing vectors, re-indexes them
  • Co-edit computation — analyzes which files change together across commits
  • Diff truncation — large diffs are truncated to maxDiffBytes for embedding quality

CoEditAnalyzer

Suggests files that historically change together based on git commit co-occurrence.

// After indexing
const gitPlugin = brain.plugin('git');
const coEdits = gitPlugin.suggestCoEdits('src/auth/login.ts', 5);
// → [{ file: 'src/auth/middleware.ts', count: 12 },
//    { file: 'src/auth/session.ts', count: 8 }]

Embedded Commit Format

Each commit is embedded as enriched text for better semantic matching:

Commit: feat(auth): add JWT token rotation
Author: Jane Doe
Date: 2024-03-15
Files: src/auth/token.ts, src/auth/middleware.ts
Changes:
<truncated diff>

How It Works

Repository → git log → parse commits → filter new
    → extract diffs + file stats → embed commit text
    → store in SQLite + HNSW
    → compute co-edit pairs from file co-occurrence

Peer Dependencies

  • brainbank >= 0.7.0

Plugin Capabilities

@brainbank/git implements the following capability interfaces, discovered by the core at runtime:

| Interface | What it does | |-----------|-------------| | IndexablePlugin | Participates in brain.index() — commit parsing + embedding | | VectorSearchPlugin | Provides GitVectorSearch for semantic commit search | | BM25SearchPlugin | Provides FTS5 keyword search against fts_commits | | ContextFormatterPlugin | Formats git history + co-edit suggestions for brain.getContext() | | MigratablePlugin | Owns its schema — git_commits, commit_files, co_edits, git_vectors, fts_commits | | ReembeddablePlugin | Participates in brain.reembed() | | CoEditPlugin | Suggests files that tend to change together |

License

MIT