Loading...
Unleash's Ruby client fits naturally into Rails with its `is_enabled?` predicate style. But once toggles end up in views, helpers, and service objects, tracking them manually becomes a chore. Let FlagShark handle it.
FlagShark generates a PR that removes the dead branch and keeps only the winning code path
class ArticlesController < ApplicationController
def show
@article = Article.find(params[:id])
unleash_ctx = Unleash::Context.new(user_id: current_user.id.to_s)
if UNLEASH.is_enabled?("article-reactions", unleash_ctx)
@reactions = @article.reactions.includes(:user)
end
render :show
end
endclass ArticlesController < ApplicationController
def show
@article = Article.find(params[:id])
@reactions = @article.reactions.includes(:user)
render :show
end
endFlagShark uses Parser gem and custom Rake task integration to find every call to isEnabled(), getVariant(), getAllToggles()across your Rails, Sinatra codebase.
Each detected flag key is matched against your Unleash project to check rollout status, last evaluation date, and whether the flag is archived or still active.
For each stale flag, FlagShark creates a pull request that removes the SDK call, eliminates the dead code branch, and preserves the winning path. Every PR includes a before/after diff you can review.
The Unleash Ruby client is typically initialized as a global constant (e.g., `UNLEASH`) in a Rails initializer — grep-based tools find the constant easily, but miss cases where it's aliased or passed as a dependency to service objects.
Grep misses flags behind abstractions. AST-level scanning catches SDK calls that regex can't.
Every cleanup goes through code review. No surprises, no broken builds.
Only flags at 100% rollout for your configured threshold are suggested for removal.
New stale flags are detected automatically. Your codebase stays clean without manual audits.
isEnabled()getVariant()getAllToggles()Plus custom patterns you define in .flagshark.yaml
FlagShark uses the Parser gem to find `is_enabled?` and `get_variant` calls on your Unleash client constant. It traces the constant through initializers, service objects, and concern modules.
Yes. FlagShark scans `.erb` and `.haml` templates for Unleash calls. It generates diffs that remove conditional rendering blocks while preserving the enabled code path.
FlagShark detects classes that inherit from Unleash's strategy base class. When a toggle using a custom strategy is removed, it flags the strategy class for deletion.
Connect your repo, see stale flags in minutes, and get cleanup PRs automatically.
Free tier available • No credit card required • 5-minute setup
Find and remove stale Unleash feature toggles from React, Next.js, and Node.js TypeScript projects.
Identify and safely remove stale Unleash toggles from Django, FastAPI, and Flask Python applications.
Systematically identify and remove stale Unleash toggles from Go services and CLI applications.
Find and remove dead Unleash toggles from Spring Boot applications and Java microservices.
Use Rust's type system and FlagShark to find and remove dead Unleash toggles from Actix and Axum services.