setup-dark-mode

setup-dark-mode is a command for Claude Code from Matt-Dionis/claude-code-configs. It costs 6 tokens per session (1,427 once invoked), scanned A, original, MIT.

A setup command for adding light, dark, and system theme switching to a web application. It configures the theme provider, CSS variables, a toggle component, and persistence through cookies or local storage.

In plain words
What is it for?
Use it to add dark mode and theme toggling to applications built with frameworks such as Next.js or Vite.
Why use it?
It removes the repeated framework-specific work needed to remember a user's theme and apply it consistently. It also provides a structure for switching themes without rebuilding the interface.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to add dark mode and theme toggling to applications built with frameworks such as Next.js or Vite.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/matt-dionis/claude-code-configs/setup-dark-mode
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.

Clone the repo
git clone --depth 1 https://github.com/Matt-Dionis/claude-code-configs

Made for: Claude Code.

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 setup-dark-mode

README.md
[![agentmods](https://agentmods.dev/badge/commands/matt-dionis/claude-code-configs/setup-dark-mode/github.svg)](https://agentmods.dev/commands/matt-dionis/claude-code-configs/setup-dark-mode)
Your own site
<a href="https://agentmods.dev/commands/matt-dionis/claude-code-configs/setup-dark-mode"><img src="https://agentmods.dev/badge/commands/matt-dionis/claude-code-configs/setup-dark-mode/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for setup-dark-mode

Your own site · 80×15
<a href="https://agentmods.dev/commands/matt-dionis/claude-code-configs/setup-dark-mode"><img src="https://agentmods.dev/badge/commands/matt-dionis/claude-code-configs/setup-dark-mode.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6 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,427 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.00006 $0.01427
Opus 5.5 $0.00002 $0.00571
Sonnet 5.5 $0.00001 $0.00285
Haiku 4.5 $0.00001 $0.00143

Measured 1mo ago against content hash ab8da6348776, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

setup-dark-mode 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 1mo 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.

configurations/ui/shadcn/.claude/commands/setup-dark-mode.md · 243 lines

How it starts

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

Set up dark mode with theme switching for your specific framework.

Instructions

Based on the framework detected or specified:

  1. Install required dependencies
  2. Set up theme provider
  3. Configure CSS variables
  4. Create theme toggle component
  5. Set up persistence (cookies/localStorage)

Framework Configurations

Next.js (App Router)

npm install next-themes

Create components/theme-provider.tsx:

"use client"

import * as React from "react"
import { ThemeProvider as NextThemesProvider } from "next-themes"
import { type ThemeProviderProps } from "next-themes/dist/types"

export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
  return <NextThemesProvider {...props}>{children}</NextThemesProvider>
}

Wrap in app/layout.tsx:

<ThemeProvider
  attribute="class"
  defaultTheme="system"
  enableSystem
  disableTransitionOnChange
>
  {children}
</ThemeProvider>

Vite

Create components/theme-provider.tsx:

import { createContext, useContext, useEffect, useState } from "react"

type Theme = "dark" | "light" | "system"

const ThemeProviderContext = createContext<{
  theme: Theme
  setTheme: (theme: Theme) => void
}>({
  theme: "system",
  setTheme: () => null,
})

export function ThemeProvider({ children }: { children: React.ReactNode }) {
  const [theme, setTheme] = useState<Theme>(
    () => (localStorage.getItem("theme") as Theme) || "system"
  )

  useEffect(() => {
    const root = window.document.documentElement
    root.classList.remove("light", "dark")

    if (theme === "system") {
      const systemTheme = window.matchMedia("(prefers-color-scheme: dark)")
        .matches
        ? "dark"
        : "light"
      root.classList.add(systemTheme)
      return
    }

    root.classList.add(theme)
  }, [theme])

  const value = {
    theme,
    setTheme: (theme: Theme) => {
      localStorage.setItem("theme", theme)
      setTheme(theme)
    },
  }

  return (
    <ThemeProviderContext.Provider value={value}>
      {children}
    </ThemeProviderContext.Provider>
  )
}

export const useTheme = () => {
  const context = useContext(ThemeProviderContext)
  if (context === undefined)
    throw new Error("useTheme must be used within a ThemeProvider")
  return context
}

Read the full file on GitHub · 243 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. 1mo ago First seen · 243 lines · 6 tokens per session scan A ab8da6348776

Subscribe to this mod's changes

setup-dark-mode is a command published in the GitHub repository Matt-Dionis/claude-code-configs (619 stars, last pushed 1y ago), licensed MIT. It adds 6 tokens to every session and 1,427 once invoked, about $0.0000 per session on Opus 5.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-09-03.