saas-multi-tenancy

saas-multi-tenancy is a skill for Claude Code, Codex from 05-deepak-patidar/claude-skills. It costs 102 tokens per session (1,335 once invoked), scanned A, original, MIT.

A guide for keeping each customer’s data separate in a shared software service, including data access, tenant context, and customer operations.

In plain words
What is it for?
Use it when building a service for multiple businesses or customer accounts, adding customer-scoped data, or investigating possible cross-customer leaks.
Why use it?
It helps prevent one customer from seeing or changing another customer’s records, especially when many parts of the application access shared tables.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building a service for multiple businesses or customer accounts, adding customer-scoped data, or investigating possible cross-customer leaks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/05-deepak-patidar/claude-skills/saas-multi-tenancy
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add 05-deepak-patidar/claude-skills --skill saas-multi-tenancy
Clone the repo
git clone --depth 1 https://github.com/05-deepak-patidar/claude-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for saas-multi-tenancy

README.md
[![agentmods](https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/saas-multi-tenancy/github.svg)](https://agentmods.dev/skills/05-deepak-patidar/claude-skills/saas-multi-tenancy)
Your own site
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/saas-multi-tenancy"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/saas-multi-tenancy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for saas-multi-tenancy

Your own site · 80×15
<a href="https://agentmods.dev/skills/05-deepak-patidar/claude-skills/saas-multi-tenancy"><img src="https://agentmods.dev/badge/skills/05-deepak-patidar/claude-skills/saas-multi-tenancy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,335 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00102 $0.01335
Opus 5.5 $0.00041 $0.00534
Sonnet 5.5 $0.00020 $0.00267
Haiku 4.5 $0.00010 $0.00134

Measured 1mo ago against content hash e82c91610420, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

saas-multi-tenancy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

saas-multi-tenancy/SKILL.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SaaS Multi-Tenancy

In a multi-tenant system, the worst bug class isn't downtime — it's tenant A seeing tenant B's data. One leaked invoice ends the customer relationship and possibly the company. Design so that isolation failures are structurally impossible, not just carefully avoided, because "carefully" doesn't survive the 400th endpoint.

Choosing the isolation model (decide once, explicitly)

  • Shared schema + tenant_id column — the default. Cheapest to operate, easiest to migrate, scales to thousands of tenants. Requires the discipline below.
  • Schema-per-tenant / database-per-tenant — buy isolation with operational pain (N× migrations, connection management, cost). Justified by: hard compliance walls, wildly divergent tenant sizes, or contractual "your data is physically separate". Don't drift here for comfort.
  • Hybrid (big tenants carved out) is legitimate — but only after the shared model measurably strains.

The rest of this skill assumes shared-schema, where the discipline matters most.

Gate 1: Scoping that fails CLOSED

The core principle: a forgotten WHERE clause must return nothing, not everything.

  • Two layers, always: application-level scoping (every query goes through a tenant-scoped session/repository that injects tenant_id — never hand-written per query) AND database-level enforcement (Postgres RLS with FORCE, policies keyed off a per-request setting, app connecting as a role that cannot bypass RLS — superusers silently bypass it; verify the role, and boot-guard against misconfiguration).
  • tenant_id NOT NULL on every tenant table + FK to the tenants table + composite indexes leading with it (database-design). New tenant-scoped table = added to the RLS/policy list in the same migration, enforced by convention and a test that scans the schema for unpoliced tables.
  • The tenant comes from the authenticated principal, never from the request — no ?account_id= params, no tenant in the POST body, no trusting a JWT claim you didn't issue (threat-model-security Gate 1).

Read the full file on GitHub · 56 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 56 lines · 102 tokens per session scan A e82c91610420

Subscribe to this mod's changes

saas-multi-tenancy is a skill published in the GitHub repository 05-deepak-patidar/claude-skills (4 stars, last pushed 3mo ago), licensed MIT. It adds 102 tokens to every session and 1,335 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

axum-idioms

Axum (0.8+) web framework patterns: type-safe extractors, Tower middleware, route routing, and graceful shutdown. Use when implementing HTTP APIs or web services in Rust. Pair with rust-idioms.

irahardianto/awesome-agv · 50 tokens

hono-idioms

Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun. Use when building Hono APIs. Pair with typescript-idioms.

irahardianto/awesome-agv · 53 tokens

logging-implementation

Structured logging implementation patterns: log levels, mandatory context fields (correlationId, userId, duration), security (PII scrubbing), and per-language library choices (Go slog, TypeScript pino, Python structlog). Load when implementing logging in any operation entry point. Prerequisite…

irahardianto/awesome-agv · 74 tokens

rails-idioms

Ruby on Rails framework patterns: ActiveRecord scopes, N+1 query prevention, model validations, RESTful routing, and RSpec/Minitest testing. Use when building, maintaining, or auditing Rails web applications and APIs. Pair with ruby-idioms.

irahardianto/awesome-agv · 57 tokens

api-documentation

OpenAPI 3.1 specification writing, request/response examples, error documentation, versioning, and interactive API portal patterns.

irahardianto/awesome-agv · 30 tokens

django-idioms

Django and Django REST Framework (DRF) patterns: ORM queries, model managers, class-based views, serializers, migrations, and pytest-django testing. Use when building or maintaining Django backend applications. Pair with python-idioms.

irahardianto/awesome-agv · 53 tokens