Enterprise monorepo velocity for everyone.
Meta, Google, and Microsoft run massive monorepos because it eliminates dependency hell, enforces consistent tooling, and makes cross-team collaboration effortless. But they built billions of dollars of custom infrastructure to make it work at scale — virtual filesystems, distributed build caches, custom source control.
SAM brings that same architecture to every engineering team. Fortune 1000 companies with hundreds of API domains in a single repository can now give each developer the experience of working on a single microservice — fast clone, local editor, targeted tests, safe deploy — while keeping everything in one repo.
Developers fetch only the domains they own. MonoGraph resolves the dependencies they need. Ghost folders in Finder and VS Code show the full monorepo structure without downloading a single byte. Navigate into a folder, it hydrates with all its dependencies. Push your code, see the blast radius across the entire organization before it ships.
sam init git@company.com/enterprise-api # blobless clone — seconds, not minutes
sam setup # ghost folders in Finder (dimmed)
./sam-start.sh ~/Developer/enterprise-api # start MonoGraph + watch daemon
# In Finder: double-click any dimmed folder → hydrates with dependencies
# In VS Code: click any ghost domain in SAM sidebar → hydrates
# In terminal: sam fetch bigquery --with-deps# Prerequisites
brew install go python@3.12 uv node
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install
git clone https://github.com/sam-framework/sam.git
cd sam
./install.sh
# Clone a monorepo
sam init https://github.com/your-org/monorepo.git
cd monorepo
# Start everything (MonoGraph + Finder watch)
./sam-start.sh .
# Or start manually
sam setup # create ghost folders
sam use --profile your-team-api # hydrate your profile| Command | What it does |
|---|---|
sam init <url> |
Blobless clone + sparse checkout + create .sam/ |
sam use --profile <name> |
Hydrate a profile's domains + resolved deps |
sam fetch <domain> |
Hydrate a single domain |
sam fetch <domain> --with-deps |
Hydrate with resolved dependencies |
sam plan <domain> |
Show what fetching would hydrate (dry run) |
sam impact |
Show blast radius of your changes |
sam deploy --profile <name> |
Deploy only your changed services |
sam graph --domain <path> |
Show dependency graph |
sam setup |
Create ghost folders in Finder (dimmed) |
sam watch |
Auto-hydrate when you navigate into a ghost folder in Finder |
sam refresh |
Update ghost/hydrated state in Finder |
sam dehydrate <domain> |
Remove a domain's files, return to ghost state |
sam dehydrate --all |
Reset all domains to ghost state |
Terminal Finder VS Code
| | |
sam CLI sam watch MonoLens
| | |
┌──────┴────────────────────┴────────────────────┘
| sam-core (Rust)
└──────┬────────────┬────────────────┐
| | |
git sparse profiles.yaml MonoGraph
checkout workspace.yaml daemon :7474
| Component | Language | Purpose |
|---|---|---|
| sam-core | Rust | Core library: git ops, profile parsing, Finder integration |
| sam CLI | Rust | All user commands (4.4MB binary) |
| MonoGraph | Python | Dependency engine: static import analysis + git co-change mining |
| MonoLens | TypeScript | VS Code extension: ghost folder sidebar, click-to-hydrate, impact gutter |
| MonoWatch | Go | Pre-push git hook: impact analysis before every push |
SAM uses native macOS chflags hidden to dim non-hydrated folders. Supports nested folder structures up to any depth.
- Enable hidden files: press Cmd+Shift+. in Finder (one-time)
sam setupcreates the full directory tree as ghost folders (dimmed), up to 4 levels deep by defaultsam watchmonitors Finder navigation — when you double-click a dimmed folder, it hydrates that folder plus all subfolders and dependenciessam dehydrate <domain>removes files, folder returns to dimmed state- Container folders (directories that only contain subdirectories) stay visible for navigation
- Leaf folders (directories with actual source files) appear dimmed until hydrated
# Start Finder integration
./sam-start.sh ~/Developer/monorepo
# Stop
./sam-stop.sh
# Custom depth (default: 4)
sam setup --depth 6MonoLens adds a SAM sidebar to VS Code with ghost folder visualization, click-to-hydrate, and inline impact annotations.
# Install
cd monolens && npm install && npm run compile
# In VS Code: Cmd+Shift+P → "Install from VSIX" → select monolens-0.1.0.vsix
# Open your SAM repo in VS Code — MonoLens activates automaticallyFeatures:
- SAM Domains sidebar — all domains listed with ghost/hydrated/shared state
- Click to hydrate — click a ghost domain to fetch it
- File decoration — badges on folders in the native explorer (○ ghost, ● hydrated, S shared)
- Impact gutter — CodeLens annotations on shared code showing dependent domains
- Profile switching —
Cmd+Shift+P→ "SAM: Switch workspace profile" - Impact analysis —
Cmd+Shift+P→ "SAM: Show change impact"
Teams share .sam/profiles.yaml (committed to the repo):
profiles:
sales-api:
domains:
- apis/sales
- apis/pricing
auto_include:
- shared/auth
- shared/types
ai_infer: true # MonoGraph resolves additional deps
watch:
- apis/inventory # alerts only, not hydrated
platform:
domains: "*" # full monolith
ai_infer: false-
sam init—git clone --filter=blob:none --sparsedownloads the full tree structure without file contents. Fast clone regardless of repo size. -
sam setup— Creates the full directory tree up to 4 levels deep (configurable with--depth N). Leaf directories with source files getchflags hidden(dimmed). Container directories stay visible for navigation. Starts MonoGraph daemon. -
sam use --profile— Reads your team's profile, calls MonoGraph to resolve dependencies via static import analysis and git co-change mining, thengit sparse-checkout addto materialize only what you need. -
sam watch— Background daemon that polls Finder's current window path every 500ms via AppleScript. When you navigate into a ghost folder, it resolves dependencies via MonoGraph and hydrates the folder with all its deps. -
sam fetch --with-deps— Adds a domain to sparse checkout, materializes all files and subdirectories recursively, resolves dependencies, updates workspace state, clears hidden flags on the domain and all parent directories. -
sam dehydrate— Removes a domain from sparse checkout, recreates the empty skeleton directory, sets the hidden flag. Terminal only — explicit and safe. -
sam impact— Queries MonoGraph for the blast radius of your uncommitted changes. Shows affected domains with risk levels (critical/high/medium/low).
MonoGraph analyzes your monorepo to answer: "if I need this folder, what other folders do I also need?"
Two methods:
- Static import analysis — tree-sitter parsers (Go, TypeScript, Python, Java, C#) read your source code and extract import relationships
- Co-change mining — reads
git logto find folders that historically change together in the same commits
API (localhost:7474):
GET /health → status + graph readiness
POST /analyze → trigger graph build for a repo
POST /resolve → resolve dependencies for domains
POST /impact → blast radius for changed files
GET /graph?domain=X → dependency edges for a domain
GET /cochange?file=X → co-change partners for a file
SAM CLI works without MonoGraph running — falls back to static profile resolution.
- sam CLI works without MonoGraph. Always falls back to static resolution. Never blocks the developer.
- MonoGraph is read-only. Only
sam fetchwrites to the working tree. - profiles.yaml is committed. Team-shared config.
- workspace.yaml is gitignored. Local machine state.
- MonoWatch is advisory by default. Warns but doesn't block pushes unless
block_on_critical: true. - Common operations under 3 seconds. Network/git ops are the exception.
- Hydrate pulls deps automatically. Dehydrate is explicit, single-domain only. Safe by design.
| Script | Purpose |
|---|---|
./install.sh |
Build and install all components |
./sam-start.sh <repo> |
Start MonoGraph + watch daemon for a repo |
./sam-stop.sh |
Stop all SAM background services |
# sam CLI + sam-core (Rust)
cargo build --release
cp target/release/sam /usr/local/bin/
# MonoWatch pre-push hook (Go)
cd monowatch && go build -o /usr/local/bin/monowatch .
# MonoGraph dependency engine (Python)
cd monograph && uv sync
# MonoLens VS Code extension
cd monolens && npm install && npm run compile# Clone the company monorepo (takes seconds, not minutes)
sam init git@github.com:your-org/enterprise-api.git
cd enterprise-api
# See what profiles are available
cat .sam/profiles.yaml
# Your team lead says "use the sales-api profile"
sam use --profile sales-api
# ✓ Hydrated 4 domains: apis/sales, apis/pricing, shared/auth, shared/types
# Set up Finder ghost folders + start background services
./sam-start.sh .# See what your changes might break before pushing
sam impact
# ⚠ 1 critical-risk domain: apis/orders
# ⚠ 3 high-risk domains: apis/payments, apis/shipping, apis/billing
# Check the dependency graph for a domain
sam graph --domain apis/sales
# apis/sales (root)
# ├── shared/auth (static import)
# ├── shared/types (static import)
# ├── apis/pricing (static import)
# └── apis/inventory (co-change, 12 commits)
# Preview what fetching a new domain would pull in
sam plan apis/orders
# Domain Source Files Status
# apis/orders profile 42 not hydrated
# apis/payments auto_include 18 not hydrated
# shared/auth auto_include 6 hydrated# Hydrate a single domain
sam fetch bigquery
# Hydrate with all dependencies (via MonoGraph)
sam fetch bigquery --with-deps
# Done working on bigquery? Free up space
sam dehydrate bigquery
# Nuclear option: dehydrate everything, start fresh
sam dehydrate --all
sam use --profile your-team-api# Start ghost folders + auto-hydrate daemon
./sam-start.sh ~/Developer/enterprise-api
# In Finder: press Cmd+Shift+. to show dimmed folders
# Double-click any dimmed folder → it hydrates with dependencies
# In terminal: sam dehydrate <domain> to remove it
# Stop background services
./sam-stop.sh# Switch to a different team's profile
sam use --profile orders-api
# Use the full monolith (everything hydrated)
sam use --profile platform
# Dry run — see what a profile would hydrate without doing it
sam use --profile orders-api --dry-run# Edit some files in shared/auth
vim shared/auth/src/token.go
# Check blast radius
sam impact
# Domain Risk Calls/Day Teams
# apis/orders critical 214 orders-team
# apis/payments critical 198 payments-team
# apis/sales high 43 sales-team
# JSON output for CI integration
sam impact --format json# Deploy only the domains in your profile
sam deploy --profile sales-api
# SAM runs the deploy command defined in profiles.yaml
# with SAM_DOMAIN and SAM_PROFILE environment variables| Component | Language | Version | Purpose |
|---|---|---|---|
| sam-core | Rust 1.77+ | 0.1.0 | Core library with C FFI. Git ops, profile parsing, workspace state, Finder integration |
| sam CLI | Rust 1.77+ | 0.1.0 | 4.4MB statically compiled binary. All user commands |
| MonoGraph | Python 3.12 | 0.1.0 | FastAPI daemon. tree-sitter for multi-language AST parsing (Go, TypeScript, Python, Java, C#). networkx for graph operations. git log mining for co-change analysis |
| MonoLens | TypeScript 5.x | 0.1.0 | VS Code Extension API (^1.85.0). esbuild bundled. 36KB VSIX |
| MonoWatch | Go 1.22 | 0.1.0 | 9.6MB binary. Pre-push git hook. cobra CLI |
| Dependency | Used by | Purpose |
|---|---|---|
| clap | sam CLI | CLI argument parsing (derive API) |
| reqwest | sam-core | HTTP client for MonoGraph API |
| serde + serde_yaml | sam-core | YAML/JSON serialization |
| cbindgen | sam-core | C header generation for FFI |
| FastAPI + uvicorn | MonoGraph | HTTP daemon |
| tree-sitter | MonoGraph | Multi-language import parsing |
| networkx | MonoGraph | Dependency graph operations |
| Tool | Purpose |
|---|---|
| Cargo | Rust workspace (sam-core + sam CLI) |
| uv | Python package management (MonoGraph) |
| npm + esbuild | TypeScript bundling (MonoLens) |
| Go modules | Go build (MonoWatch) |
| Requirement | Minimum |
|---|---|
| macOS | 15.1 (Sequoia) or later |
| Rust | 1.77+ |
| Python | 3.12+ |
| Go | 1.22+ |
| Node.js | 18+ |
| Git | 2.25+ (sparse-checkout support) |
| VS Code | 1.85+ (for MonoLens extension) |
| Xcode CLI Tools | Required for git and system headers |
- Finder ghost folders — uses
chflags hidden(macOS native, no kernel extensions) - Finder path polling — uses AppleScript to read Finder's current window path
- Show hidden files — requires Cmd+Shift+. enabled in Finder
- Windows
- Linux (sam-core and MonoGraph work, Finder integration is macOS only)
MIT