multitenant

multitenant is a skill for Claude Code from TheBeardedBearSAS/claude-craft. It costs 46 tokens per session (797 once invoked), scanned A, original, MIT.

Guidance for multitenant applications, where one application serves multiple separate customers or organizations.

In plain words
What is it for?
Use it to choose shared or dedicated database isolation, add tenant-aware access control, encrypt fields, and test data separation.
Why use it?
It helps prevent one customer from seeing or changing another customer's data while controlling infrastructure costs.

Skill for Claude Code

Written for Claude Code: context: fork in frontmatter.

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

Good fit Use it to choose shared or dedicated database isolation, add tenant-aware access control, encrypt fields, and test data separation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thebeardedbearsas/claude-craft/multitenant
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 TheBeardedBearSAS/claude-craft --skill multitenant
Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 hooks.

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 multitenant

README.md
[![agentmods](https://agentmods.dev/badge/skills/thebeardedbearsas/claude-craft/multitenant/github.svg)](https://agentmods.dev/skills/thebeardedbearsas/claude-craft/multitenant)
Your own site
<a href="https://agentmods.dev/skills/thebeardedbearsas/claude-craft/multitenant"><img src="https://agentmods.dev/badge/skills/thebeardedbearsas/claude-craft/multitenant/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 multitenant

Your own site · 80×15
<a href="https://agentmods.dev/skills/thebeardedbearsas/claude-craft/multitenant"><img src="https://agentmods.dev/badge/skills/thebeardedbearsas/claude-craft/multitenant.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 797 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00046 $0.00797
Opus 5 $0.00023 $0.00398
Sonnet 5 $0.00009 $0.00159
Haiku 4.5 $0.00005 $0.00080

Measured 5d ago against content hash ea9374537bda, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

multitenant 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 5d 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.

.claude/skills/multitenant/SKILL.md · 63 lines

How it starts

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

Multitenant — Quick Reference

Servir plusieurs clients (tenants) sur la même base de code avec isolation stricte et un coût d'infra contrôlé.

Trois tiers d'isolation

Tier Isolation Coût Cas d'usage
Tier 1 — Shared schema colonne tenant_id partout, filtres SQL automatiques Faible Startups, free / petits clients
Tier 2 — Dedicated schema un schéma PostgreSQL par tenant Moyen SMB, clients exigeants
Tier 3 — Dedicated DB une base entière par tenant Élevé Enterprise, compliance stricte (HDS, FedRAMP)

Règle de migration : commencer Tier 1, migrer un client en Tier 2/3 quand il représente > 20 % du revenu OU exige un SLA spécifique.

Cinq invariants non-négociables

  1. tenant_id propagé à chaque requête (AsyncLocalStorage / SecurityContext / middleware).
  2. PostgreSQL Row-Level Security (RLS) activé sur TOUTES les tables. Filet de sécurité contre un oubli applicatif.
  3. Tests d'isolation obligatoires. Tenant A ne doit jamais lire/écrire les données de B — y compris via tri, requête nuée, agrégat.
  4. Audit trail isolé par tenant. Pas de log multi-tenant cross-référencé sans permission explicite.
  5. Field-level encryption sur PII / secrets sensibles (Halite PHP, Eloquent Casts, libsodium).

Pattern minimal — Shared schema + RLS

ALTER TABLE invoices ADD COLUMN tenant_id UUID NOT NULL;
ALTER TABLE invoices ENABLE ROW LEVEL SECURITY;
CREATE POLICY tenant_isolation ON invoices
  USING (tenant_id = current_setting('app.tenant_id')::uuid);
// Symfony — middleware qui set la variable session pour RLS
$conn->executeStatement(
    'SET LOCAL app.tenant_id = :tid',
    ['tid' => $tenantId]
);

Anti-patterns critiques

  • ❌ Oublier le filtre tenant_id dans une requête raw → fuite cross-tenant.
  • ❌ Cache Redis sans préfixe tenant → données de A retournées à B.
  • ❌ Job worker async qui perd le tenant_id → impossible de retrouver le contexte.
  • ❌ Signed URLs / tokens sans tenant_id dans le payload → utilisable cross-tenant.
  • ❌ Field encryption avec une clé unique partagée → compromission = exposition totale (préférer keys per tenant).

Read the full file on GitHub · 63 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 63 lines · 0 tokens per session scan A ea9374537bda

Subscribe to this mod's changes

multitenant is a skill published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 6d ago), licensed MIT. It adds 46 tokens to every session and 797 once invoked, about $0.0002 per session on Opus 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-09-03.

Related

Other skills, from other repositories

azure-postgres-ts

Connect to Azure Database for PostgreSQL Flexible Server from Node.js/TypeScript using the pg (node-postgres) package. Use for PostgreSQL queries, connection pooling, transactions, and Microsoft Entra ID (passwordless) authentication. Triggers: "PostgreSQL", "postgres", "pg client", "node-postgres", "Azure PostgreSQL…

microsoft/skills · 94 tokens

database-patterns

Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning. Use when creating migrations, designing schemas, normalizing data, managing database versions, or handling schema drift.

yonatangross/orchestkit · 49 tokens

database-expert

Advanced database design and administration for PostgreSQL, MongoDB, and Redis. Use when designing schemas, optimizing queries, managing database performance, or implementing data patterns.

travisjneuman/.claude · 36 tokens

generic-fullstack-feature-developer

Guide feature development for full-stack applications with architecture focus. Covers Next.js App Router patterns, NestJS backend services, database models, data workflows, and seamless integration. Use when adding new features, refactoring existing code, or planning major changes.

travisjneuman/.claude · 56 tokens

postgres-drizzle

Proactively apply when creating APIs, backends, or data models. Triggers on PostgreSQL, Postgres, Drizzle, drizzle-orm, drizzle-kit, database, schema, pgTable, tables, columns, indexes, queries, migrations, ORM, relations, relational queries, joins, transactions, SQL, connection pooling, PgBouncer, N+1, JSONB, RLS…

ccheney/robust-skills · 119 tokens

api-baas-neon

Serverless PostgreSQL with branching, autoscaling, and edge-compatible driver.

agents-inc/skills · 20 tokens