optimizely-exp-feature-flags

optimizely-exp-feature-flags is an agent for coding agents from smithdak/claude-marketplace. It costs 17 tokens per session (1,632 once invoked), scanned A, original, MIT.

An agent guide for reviewing Optimizely feature flags, their typed settings, and how they are accessed in code.

In plain words
What is it for?
Use it to review feature-flag defaults, typed variables, accessors, and flag lifecycle practices.
Why use it?
It helps detect missing fallback values and unsafe access to flag settings when the feature-flag service fails or returns unexpected data.

Agent

Part of the optimizely-exp plugin — 2 skills, 4 agents shipped together

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 agents/smithdak/claude-marketplace/feature-flags
Clone the repo
git clone --depth 1 https://github.com/smithdak/claude-marketplace

Or install optimizely-exp, the plugin that ships this one along with the rest of its 2 skills, 4 agents.

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 optimizely-exp-feature-flags

README.md
[![agentmods](https://agentmods.dev/badge/agents/smithdak/claude-marketplace/feature-flags.svg)](https://agentmods.dev/agents/smithdak/claude-marketplace/feature-flags)
Your own site
<a href="https://agentmods.dev/agents/smithdak/claude-marketplace/feature-flags"><img src="https://agentmods.dev/badge/agents/smithdak/claude-marketplace/feature-flags.svg" alt="Measured on agentmods" height="20"></a>
Per session 17 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,632 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.1 $0.00017 $0.01632
Opus 5 $0.00009 $0.00816
Sonnet 5 $0.00003 $0.00326
Haiku 4.5 $0.00002 $0.00163

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

Security

Grade A, and why

optimizely-exp-feature-flags 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.

plugins/optimizely-experimentation-analyzer/agents/feature-flags.md · 274 lines

How it starts

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

Optimizely Feature Flags Agent

Analyze feature flag implementation, typed accessors, and flag lifecycle management.

Analysis Areas

1. Missing Default Values

FF-001: Feature Flag Without Default (Warning)

Flags should have defaults for SDK failures:

Grep: isFeatureEnabled\(.*\)(?!\s*\?\?)
Grep: decide\(.*\)\.enabled(?!\s*\?\?)

Bad Pattern:

// No fallback if SDK fails!
const isEnabled = optimizely.isFeatureEnabled('new_feature', userId);
if (isEnabled) {
  showNewFeature();
}

Good Pattern:

// With default value
const isEnabled = optimizely.isFeatureEnabled('new_feature', userId) ?? false;

// Or with try/catch
let isEnabled = false;
try {
  isEnabled = optimizely.isFeatureEnabled('new_feature', userId);
} catch {
  console.warn('Feature flag check failed, using default');
}

2. Typed Feature Variables

FF-002: No Typed Feature Variables (Warning)

Feature variables should use typed accessors:

Grep: getFeatureVariable\(
Grep: getFeatureVariableString\(
Grep: getFeatureVariableInteger\(
Grep: getFeatureVariableDouble\(
Grep: getFeatureVariableBoolean\(
Grep: getFeatureVariableJSON\(

Bad Pattern:

// Generic accessor - type unsafe
const discount = optimizely.getFeatureVariable('pricing', 'discount', userId);
// discount is string | number | boolean | object | null

Good Pattern:

// Typed accessor
const discount = optimizely.getFeatureVariableDouble('pricing', 'discount', userId);
// discount is number | null

// Or with modern decide API
const decision = optimizely.decide('pricing', userId);
const discount = decision.variables.discount as number;

3. Render Loop Evaluation

FF-003: Flag Evaluated in Render Loop (Warning)

Flags should not be evaluated on every render:

Grep: function.*\{[\s\S]*?isFeatureEnabled
Grep: return.*isFeatureEnabled

Bad Pattern:

function Component() {
  // Called on EVERY render!
  const showBanner = optimizely.isFeatureEnabled('banner', userId);

  return showBanner ? <Banner /> : null;
}

Read the full file on GitHub · 274 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. 5d ago First seen · 274 lines · 17 tokens per session scan A 1e1854fe466d

Subscribe to this mod's changes

optimizely-exp-feature-flags is an agent published in the GitHub repository smithdak/claude-marketplace (3 stars, last pushed 7mo ago), licensed MIT. It adds 17 tokens to every session and 1,632 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.