preflight

A command that checks whether the environment is ready for Twilio development, including account settings, profiles, and required environment variables. Environment variables are configuration values provided outside the code.

In plain words
What is it for?
Use it before Twilio work, after changing accounts, or when authentication and configuration problems occur.
Why use it?
It can reveal expired credentials, the wrong Twilio account, or missing settings before they cause confusing authentication errors.

Command

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.

agentmods
npx agentmods add commands/wittyreference/twilio-claude-plugin/preflight
Clone the repo
git clone --depth 1 https://github.com/wittyreference/twilio-claude-plugin
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,952 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00028 $0.01952
Opus 5 $0.00014 $0.00976
Sonnet 5 $0.00006 $0.00390
Haiku 4.5 $0.00003 $0.00195

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

Security

Grade A, and why

preflight 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 2d 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.

commands/preflight.md · 199 lines

How it starts

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

Preflight Environment Verification

Verify that the local environment is ready for Twilio development before starting real work. Catches expired tokens, wrong CLI profiles, and missing env vars early.

Checks to Run

Run these 4 checks in order and report results in a summary table.

Check 1: Twilio CLI Profile

twilio profiles:list
  • PASS: Active profile exists and its Account SID matches $TWILIO_ACCOUNT_SID
  • WARN: Active profile exists but its SID doesn't match $TWILIO_ACCOUNT_SID (wrong profile?)
  • FAIL: No profiles configured or no active profile

Check 2: Environment Variables

Load from .env file if present. Check each variable:

Required (FAIL if missing or malformed):

Variable Format
TWILIO_ACCOUNT_SID Must start with AC, 34 chars
TWILIO_AUTH_TOKEN Must be non-empty
TWILIO_PHONE_NUMBER Must start with +

Optional (INFO if missing):

Variable Expected Prefix Feature
TWILIO_API_KEY SK API key auth
TWILIO_API_SECRET API key auth
TWILIO_VERIFY_SERVICE_SID VA Phone verification
TWILIO_SYNC_SERVICE_SID IS Real-time state sync
TWILIO_TASKROUTER_WORKSPACE_SID WS Skills-based routing
TWILIO_TASKROUTER_WORKFLOW_SID WW Task routing
TWILIO_MESSAGING_SERVICE_SID MG Sender pools
TEST_PHONE_NUMBER + E2E testing

For variables with a known prefix, WARN if the value is set but doesn't match the expected prefix.

Check 2.5: Regional Configuration

Check for regional env vars that silently redirect all API traffic:

# Check shell environment
echo "TWILIO_REGION=${TWILIO_REGION:-}" "TWILIO_EDGE=${TWILIO_EDGE:-}"
# Check .env file for uncommented regional vars
grep -E '^TWILIO_(REGION|EDGE|AU1_API|IE1_API)' .env
# Check callback URL
grep '^TWILIO_CALLBACK_BASE_URL' .env
  • PASS: TWILIO_REGION and TWILIO_EDGE are not set in env, no uncommented regional API keys in .env, callback URL points to .twil.io (US1)
  • WARN: TWILIO_REGION or TWILIO_EDGE is set — all API calls route to regional endpoints
  • WARN: TWILIO_CALLBACK_BASE_URL contains .au1. or .ie1. — callbacks point to regional deployment
  • WARN: Uncommented TWILIO_AU1_API_KEY or TWILIO_IE1_API_KEY in .env — SDK may pick up regional credentials

Read the full file on GitHub · 199 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. 2d ago First seen · 199 lines · 28 tokens per session scan A b82f21b29aa6

Subscribe to this mod's changes

preflight is a command published in the GitHub repository wittyreference/twilio-claude-plugin (2 stars, last pushed 3mo ago), licensed MIT. It adds 28 tokens to every session and 1,952 once invoked, about $0.0001 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.