ai-sdlc-workflow: Command for Claude Code

.cursor/commands/tenant-context-check.md

tenant-context-check is a command for Claude Code, Cursor from phuoctrung-ppt/ai-sdlc-workflow. It costs 47 tokens per session (277 once invoked), scanned A, original, MIT.

A command that audits whether code keeps data belonging to different tenants, or customers sharing one application, isolated from one another.

In plain words
What is it for?
Use it on a specified code path in a multi-tenant project to check tenant-scoped tables, routes, queries, API responses, shared entities, and quota errors, and report pass/fail issues with file locations.
Why use it?
It looks for missing tenant filters and other paths that could expose one customer's data to another customer.

Command for Claude CodeCursor

Written for Cursor and Claude Code: installed under .cursor/, but also a Claude Code command (commands/*.md). Also seen: mentions AGENTS.md.

This is phuoctrung-ppt/ai-sdlc-workflow's own configuration. It tells Claude Code and Cursor how to work on ai-sdlc-workflow itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai-sdlc-workflow configures →

Reuse

Borrowing it

Nothing to install: this file belongs to phuoctrung-ppt/ai-sdlc-workflow. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/phuoctrung-ppt/ai-sdlc-workflow/master/.cursor/commands/tenant-context-check.md
Clone the repo
git clone --depth 1 https://github.com/phuoctrung-ppt/ai-sdlc-workflow

Made for: Claude Code, Cursor.

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 tenant-context-check

README.md
[![agentmods](https://agentmods.dev/badge/commands/phuoctrung-ppt/ai-sdlc-workflow/tenant-context-check.svg)](https://agentmods.dev/commands/phuoctrung-ppt/ai-sdlc-workflow/tenant-context-check)
Your own site
<a href="https://agentmods.dev/commands/phuoctrung-ppt/ai-sdlc-workflow/tenant-context-check"><img src="https://agentmods.dev/badge/commands/phuoctrung-ppt/ai-sdlc-workflow/tenant-context-check.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 277 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.00047 $0.00277
Opus 5 $0.00023 $0.00138
Sonnet 5 $0.00009 $0.00055
Haiku 4.5 $0.00005 $0.00028

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

Security

Grade A, and why

tenant-context-check 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 8d 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.

.cursor/commands/tenant-context-check.md · 22 lines

What it actually says

Domain example — this command is for multi-tenant projects that use tenant_id column isolation (see .cursor/rules/004-multi-tenancy-pattern.mdc). Skip this command if your project is single-tenant or uses a different isolation model. Adapt the checklist to match AGENTS.md §5.

Audit tenant isolation for: {code_path}

Per .cursor/rules/004-multi-tenancy-pattern.mdc and AGENTS.md §5:

  1. All tenant-scoped tables have tenant_id (or are explicitly marked as global)
  2. Tenant guard applied on every tenant-scoped route
  3. Every query that touches tenant-scoped data filters by tenant_id
  4. No cross-tenant data leaks in API responses
  5. Global/shared entities (users, roles, etc.) have tenant_id NULL or use a global flag per AGENTS.md §5
  6. Soft limits (quotas) return 403 with an appropriate upgrade/contact prompt

Output: PASS/FAIL with file:line issues.

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. 8d ago First seen · 22 lines · 47 tokens per session scan A f91a3b331e84

Subscribe to this mod's changes

tenant-context-check is a command published in the GitHub repository phuoctrung-ppt/ai-sdlc-workflow (2 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 277 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-08-31.