Engineering

Remove a feature flag that's fully rolled out

Mention Merlin on a flag cleanup issue in Linear. It checks the gate is fully rolled out in Statsig, removes the flag and its dead code and opens a pull request.

@Merlin from now on, when someone asks you in a Linear comment to remove a feature flag, first check in Statsig that its gate passes for 100% of users. Then remove the flag checks and the branch that no longer runs, keep the tests green and open a pull request in acme/web linked to the issue. If the gate isn't fully rolled out, reply on the issue with its current state and change nothing. Only read Statsig: don't change the gate.

ENG
Get started for free
  1. Starts whenSomeone mentions @Merlin in a comment on a flag cleanup issue
  2. Merlin worksClaude Code or Codex checks the gate is at 100% in Statsig, then removes the flag checks and the code path that no longer runs
  3. You getA pull request that removes the flag and the dead branch, linked on the issue

Tools

  • Linear
  • Statsig
  • GitHub

Capabilities

  • Integrations
  • Your agent's MCP

How it works

From a flag cleanup issue to a pull request without the dead code.

Mention @Merlin in a comment on the issue and name the flag to remove.

ENENG › Issues › ENG-472

Remove the new_checkout flag

The new checkout has been at 100% for three weeks. Remove the flag and the old checkout code.

Activity

Leonow

@Merlin can you remove new_checkout? Check it's really at 100% first.

Leave a comment…

Properties

In Progress

Leo

Labels

Tech debt

Before and after

Rolled-out flags get cleaned up instead of piling up.

Without Merlin

An engineer confirms the rollout, hunts down every flag check and works out which branch is now dead.

  1. 01Open the cleanup issue
  2. 02Check the gate's rollout
  3. 03Look for overrides
  4. 04Search for every flag check
  5. 05Delete the old checkout path
  6. 06Delete its tests
  7. 07Run the test suite
  8. 08Open a pull request
  9. 09Link it on the issue

With Merlin

One comment gets the rollout confirmed and the flag removed in a pull request ready for review.

  1. @Merlin on the cleanup issueAsked in a Linear comment
  2. Checks Statsig, then removes the flag on Leo's MacBookClaude Code with read-only Statsig
  3. Pull request linked on the issueThe gate itself is untouched

Setup

Connect Linear and GitHub, then give the agent Statsig.

Set these up once and anyone can ask Merlin to clean up a flag from its issue. If the gate isn't fully rolled out, Merlin replies with its state and changes nothing.

  1. 01Connect a machineRuntimeInstall the Merlin desktop app or CLI on a computer running Claude Code or Codex. You can also use a machine a teammate shares with your workspace.
  2. 02Connect LinearIntegrationsOnce you connect your Linear workspace, Merlin can read the linked issue and comment there too.
  3. 03Add Statsig to your agentYour agent's MCPConnect the Statsig MCP server to Claude Code or Codex on the machine that runs this. Its credentials stay on that machine.
  4. 04Install the GitHub appIntegrationsPick the repositories Merlin can access, so it can read and link the pull requests there. Pushes use the machine owner's own Git access.
  5. 05Keep your code on the machineRuntimeMerlin reads the code in a local project on the runtime, so keep the repository checked out there.
  6. 06Give Statsig read-only accessYour agent's MCP

    Sign the Statsig MCP server in with read-only access on the machine that runs this, so the run can check a gate's rollout but can't change it.

  7. 07Paste the setup promptGuidanceAn owner or admin sends the prompt below to @Merlin once, and it becomes workspace guidance for every future run.

Prompt

Tell Merlin how to remove a rolled-out flag.

@Merlin from now on, when someone asks you in a Linear comment to remove a feature flag, first check in Statsig that its gate passes for 100% of users. Then remove the flag checks and the branch that no longer runs, keep the tests green and open a pull request in acme/web linked to the issue. If the gate isn't fully rolled out, reply on the issue with its current state and change nothing. Only read Statsig: don't change the gate.

ENG

Once, when you paste it

  1. PromptYou paste the prompt to @Merlin
  2. GuidanceMerlin saves your rules as workspace guidance

Every time someone mentions Merlin on an issue

  1. IntegrationLinear sends Merlin the comment
  2. RuntimeMerlin picks an available machine
  3. ContextThe run gathers context
  4. WorkClaude Code or Codex checks the gate and removes the flag
  5. SteeringYour team steers it from the issue
  6. ResultMerlin links the pull request on the issue

Bring your coding agents into the tools your team already uses.

Let your whole team hand work to Claude Code and Codex today. Connect one machine and add Merlin to Slack, Linear or GitHub. 14-day free trial, no API keys, no card.