explaingit

okikijesutech/cambium

Analysis updated 2026-05-18

1TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

A CLI tool that detects when a code file has drifted from its original purpose and grown too complex, before it needs a full rewrite.

Mindmap

mindmap
  root((repo))
    What it does
      Detects structural drift
      Ranks risky files
      Suggests file splits
    Tech stack
      TypeScript CLI
      Ollama local model
      Anthropic API option
    Use cases
      Pre-refactor codebase audit
      Git pre-commit hook
      Track drift over time
    Audience
      Developers
      Teams using AI coding agents

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Scan a codebase to find the files most at risk of having outgrown their original design.

USE CASE 2

Run a git pre-commit hook that warns or blocks commits when a file gets too big and complex.

USE CASE 3

Get an AI-generated explanation of how a specific file's responsibilities have drifted, with a suggested split.

USE CASE 4

Track how a file's complexity changes over time by comparing scans against a saved baseline.

What is it built with?

TypeScriptNode.jsOllamaClaude APIGit

How does it compare?

okikijesutech/cambium0xkinno/neuralvault0xmayurrr/ai-contractauditor
Stars111
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderatehardeasy
Complexity3/54/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Basic scanning works in seconds, but the drift command needs either a local Ollama model installed or an Anthropic API key, and local inference can take several minutes per file.

In plain English

Cambium is a command line tool that watches a codebase over time and warns when a single file has taken on too many unrelated jobs, before that mess becomes so tangled that fixing it requires a full rewrite instead of a small refactor. The idea behind it is that AI coding assistants are good at producing working code in the moment, but do not track how a project is drifting over many small commits, so a file that starts focused can slowly pick up extra responsibilities until nobody planned for it to become that complicated. Cambium works on any codebase regardless of whether AI wrote the code, a human did, or both. It scans every file and measures its size, complexity, how many other files depend on it, and how often it keeps getting changed in git history, then ranks files by combined risk. For the files that rank highest, it can call a local or hosted language model to explain what the file's original job probably was versus what it is actually doing now, and to suggest a specific way to split it apart. It also double checks its own suggestions against the file's real exported code and skips proposals that do not hold up, or files too small to be worth splitting. You install it globally through npm or run it directly with npx, and the main command is simply cambium. A quick scan command runs in seconds with no AI model involved. A baseline command saves a snapshot of the whole repo so later scans can show how each file changed since that point. A drift command is the one that calls a language model, and by default it uses a free local model through Ollama, though it can use Anthropic's Claude instead if you provide an API key, which then costs money per call. There is also a single-file check command fast enough to run in continuous integration, and a command that installs a git pre-commit hook so Cambium automatically looks at newly written code before it gets committed, either just warning or actually blocking the commit depending on the mode chosen. The author reports testing it against a real 126-file production codebase, where it correctly found the two most structurally troubled files without prior knowledge of that project and explained why each one was a problem.

Copy-paste prompts

Prompt 1
Help me install cambium and run cambium scan on my repository to find the riskiest files.
Prompt 2
Set up cambium baseline for my project so my team can track structural drift over time.
Prompt 3
Configure cambium to use my local Ollama model instead of the Anthropic API for the drift command.
Prompt 4
Help me install cambium's git pre-commit hook in strict mode for my repository.

Frequently asked questions

What is cambium?

A CLI tool that detects when a code file has drifted from its original purpose and grown too complex, before it needs a full rewrite.

What language is cambium written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, Ollama.

How hard is cambium to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is cambium for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.