agentleFS
swsounds42swsounds42/claude-dotfiles/CLAUDE.md

claude-dotfiles

CLAUDE.md0 starsChanged 41 days agoMITView on GitHub

Default to delegation. Before responding to ANY user request: Bias toward skill/agent invocation, not inline action. A 299-skill stack only pays off if it fires. Every prompt is a routing decision first, an action second. Before editing any file, read it first. Before modifying a function, grep for all callers. Research before you edit. Edit-to-read ratio should be 1:4 or better — if you're editing without reading, you're causing retries that compound token waste. Avoid re-reading the same file. If…

The file

We split this CLAUDE.md into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default to delegation: Before responding to ANY user request:

    line 3
  2. Distinctive:

    Before editing any file, read it first.

    line 13
  3. Very specific:

    Avoid re-reading the same file.

    line 15
  4. Distinctive:

    If the work matches an anti-pattern row above, do not start typing — invoke the skill first.

    line 44
  5. Distinctive:

    When a user request matches an installed skill, MUST invoke it automatically via the Skill tool.

    line 88
  6. Distinctive:

    If multiple skills could apply, pick the most specific one.

    line 162

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

ROUTING IMPERATIVE — read this first, every prompt

Default to delegation. Before responding to ANY user request:

  1. Check the Cascade hook output (top of context — [CASCADE SKILLS], [CASCADE ROUTING], and [CASCADE MODEL] blocks). If a skill or agent appears with score ≥ 0.20, INVOKE IT before doing inline work. If [CASCADE MODEL] recommends Opus or Haiku, delegate the work via the Task tool with that model: parameter rather than running on the session's default model.
  2. Scan the routing table below. If the request matches a row, MUST invoke the listed skill — do not paraphrase or do it yourself.
  3. Spawn a specialist subagent for any task spanning > 1 file or requiring domain depth (SF, Python, frontend, security, etc.).

Bias toward skill/agent invocation, not inline action. A 299-skill stack only pays off if it fires. Every prompt is a routing decision first, an action second.

Read-before-edit discipline (CodeBurn-flagged: 6.8M tokens/mo)

Before editing any file, read it first. Before modifying a function, grep for all callers. Research before you edit. Edit-to-read ratio should be 1:4 or better — if you're editing without reading, you're causing retries that compound token waste.

Avoid re-reading the same file. If you need to look at <file> again, point Claude at exact lines or function names in your prompt: In <file> lines <start>-<end>, look at the <function> function. Top historical re-read offenders: sf_attribution_context.json, page.tsx, generate_all_digests.py.

Anti-patterns — NEVER do these inline:

PatternMUST invoke
Code review / PR review / "looks good?"code-reviewer agent + tob-differential-review skill
SOQL / Salesforce querysf-soql skill
SF report / dashboard / list view changessf-reports skill
Find a past Claude Code session by topic ("which session did I work on X")session-finder or session-search skill
"Should I automate this?" / structured automation triageautomation-advisor skill
Tufte-style data report / publication-quality HTML dashboard with sparklines + Chart.jstufte-report skill
Salesforce campaign clonesf-campaign-cloner skill
Writing in Sam's voice / samwarren.io essaydispatch-draft skill
AI-sounding text → make naturalhumanizer skill
New Claude tool discoverycascade-discover skill
Brain introspection — stats, audit weak descriptions, rebuild index, trace routing, "why didn't X fire"cascade-brain skill
Multi-step code featuregsd-plan-phase or gsd-quick skill
Hard bug crossing systemsgsd-debug skill
Internal Slack post / FAQ / status updateinternal-comms skill
Marketing positioning / campaign strategyproduct-marketing-context first, then relevant marketing skill
McKinsey-grade strategic memo / board updatembb-frame skill
PDF/DOCX/PPTX/XLSX manipulationanthropic-skills:* skill (the matching one)
Token waste audit / "which skills/MCPs am I not using" / Claude Code health checkcodeburn optimize --provider claude -p 30days (CLI)
AI-slop UI detection / pre-ship HTML design check / find purple gradients/Inter/cards-in-cardsnpx impeccable detect <path> (CLI)
Stress-test plan against project context / build CONTEXT.md / ADR-as-you-go interrogationgrill-with-docs skill (manual: invoke /grill-with-docs)
Find refactor candidates / Ousterhout deep-module review / surface architectural frictionimprove-codebase-architecture skill
"Be terse" / "cut output tokens" / "caveman mode" / long debugging sessions where output bloat is killing youcaveman skill (toggles persistent compressed-output mode)

If the work matches an anti-pattern row above, do not start typing — invoke the skill first.

Cascade Model Router (aggressive mode)

The Cascade UserPromptSubmit hook automatically classifies every prompt and emits a [CASCADE MODEL] directive when the work would be better handled by a Claude tier other than Sonnet 4.6 (the recommended session default). The router is silent for standard work — only Opus escalations and Haiku downgrades produce a directive.

The router is in aggressive mode: it leans toward Haiku for ambiguous prompts and demands strong evidence before recommending Opus. Asymmetric thresholds:

  • Opus emits at confidence ≥ 0.85 (narrow, conservative)
  • Haiku emits at confidence ≥ 0.65 (broad, eager)
  • Plus a length-based fallback: prompts under 80 chars / 12 words default to Haiku unless a stronger pattern fires

Rationale: Opus on trivia wastes ~5× credits silently. Haiku failing on hard work wastes one turn the user retries with !opus. Recoverable failures are the cheaper failure mode.

How to act on [CASCADE MODEL] blocks:

TagWhat to do
[CASCADE MODEL] ⚡ ESCALATE: ... Opus 4.7 ...Spawn the actual reasoning work via the Task tool with model: 'opus'. Don't run inline if the session is on Sonnet/Haiku — the lighter session model will do worse on the work the router flagged as Opus-tier.
[CASCADE MODEL] DOWNGRADE: ... Haiku 4.5 ...Spawn via Task tool with model: 'haiku' to save credits. Run inline only if the session is already on Haiku.
(no [CASCADE MODEL] block)Sonnet 4.6 is sufficient. Run inline.

Tier intent (aggressive mode):

  • Opus 4.7 — GSD planning/debug/research skills, "design a [system|architecture|pipeline|layer|...]", security audits, strategic memos, board updates, mbb-frame, production-grade hard debugging (race conditions, intermittent failures, root-cause analysis)
  • Sonnet 4.6 (silent default) — standard build tasks (implement/build/create/write + code noun), code review, bug fixes, test writing, doc updates, refactors, multi-file work, drafting messages
  • Haiku 4.5 — confirmations (yes/lgtm/ship-it), typo/lint fixes, commit messages, Cascade/GSD quick commands, gws-* / recipe-* / sf-(soql\|metadata\|deploy\|...) mechanical ops, single-field updates, deletions, run/execute, lookups, and any short prompt without a stronger signal

Manual overrides — include in any prompt:

  • !opus / --opus / force opus → escalate
  • !sonnet / --sonnet / force sonnet → standard
  • !haiku / --haiku / force haiku → downgrade

Kill switch: export CASCADE_MODEL_ROUTER=off disables the router for the session.

Tuning: decisions are logged to ~/Desktop/personal-os-main/.cascade/sessions/model-decisions.jsonl. Inspect with:

  • node ~/Desktop/personal-os-main/scripts/hooks/model-router.cjs --stats — distribution of recent decisions
  • node ~/Desktop/personal-os-main/scripts/hooks/model-router.cjs --tail 20 — last 20 with confidence + reason
  • node ~/Desktop/personal-os-main/scripts/hooks/model-router.cjs "<prompt>" — classify a specific prompt

Thresholds and pattern lists live in ~/Desktop/personal-os-main/scripts/hooks/model-router.cjs — tune EMIT_THRESHOLD_OPUS, EMIT_THRESHOLD_HAIKU, SHORT_PROMPT_CHARS, SHORT_PROMPT_WORDS, or the MODEL_PATTERNS array directly.

Recommended baseline: Sonnet 4.6 is the configured default — set via the "model" key in settings.json, so new sessions start on Sonnet. Opt up to Opus per-session with /model opus (or !opus) for marathon ship-work and hard reasoning; the router still escalates the cases that genuinely need Opus and downgrades trivial work to Haiku. The content-aware guard (hasRealWorkSignal()) rescues short real-work prompts — troubleshooting, scoped questions, review/feedback — so they fall through to Sonnet instead of getting downgraded.

Skill Auto-Routing

When a user request matches an installed skill, MUST invoke it automatically via the Skill tool. Do NOT wait for a slash command — detect the intent and activate the skill.

Routing Table

If the request involves...Invoke skill
Writing blog posts, articles, newsletters, content with research/citationscontent-research-writer
Optimizing tweets, Twitter engagement, social media reachtwitter-algorithm-optimizer
Creating visual art, posters, designs, static graphics (PNG/PDF)canvas-design
Styling artifacts with themes (slides, docs, reports, landing pages)theme-factory
Generating changelogs from git historychangelog-generator
Organizing messy files, deduplicating, restructuring foldersfile-organizer
Organizing invoices/receipts for tax prepinvoice-organizer
Writing internal comms (status reports, newsletters, FAQs, 3P updates)internal-comms
Building MCP servers for external API integrationmcp-builder
Creating or updating Claude skillsskill-creator
Testing local web apps with Playwrightwebapp-testing
Building complex HTML artifacts (React, Tailwind, shadcn/ui)artifacts-builder
Enhancing image quality/resolution for screenshotsimage-enhancer
Creating animated GIFs for Slackslack-gif-creator
Brainstorming domain names and checking availabilitydomain-name-brainstormer
Researching and qualifying sales leadslead-research-assistant
Extracting/analyzing competitor ads from ad librariescompetitive-ads-extractor
Analyzing meeting transcripts for behavioral patternsmeeting-insights-analyzer
Tailoring resumes for specific job descriptionstailored-resume-generator
Downloading YouTube videosvideo-downloader
Picking raffle/giveaway winners from listsraffle-winner-picker
Connecting Claude to external apps (Gmail, Slack, GitHub actions)connect
Debugging LangChain/LangGraph agents via LangSmith traceslangsmith-fetch
Applying Anthropic brand colors/typographybrand-guidelines
Analyzing coding patterns and developer growthdeveloper-growth-analysis
Creating skills and sharing on Slackskill-share
Creating slide decks, presentations, pitch decks, visual HTML slidesfrontend-slides
Creating markdown-based developer presentations with Slidevslidev
Writing, fixing, improving, or adapting prompts for any AI tool (Cursor, GPT, Midjourney, etc.)prompt-master
Starting a project that will involve multiple AI tools and needs sharp first-attempt promptsprompt-master
Pasting a bad prompt and asking to fix, optimize, or adapt it for a different toolprompt-master
Vague Claude Code coding request — missing scope, file paths, or clear task definitionprompt-mini
Building something with a named stack (Next.js, Supabase, etc.) but no specific file targetsprompt-mini
Managing SF reports — listing, creating, updating filters, bulk filter flips, running reportssf-reports
Managing SF dashboards — listing, creating, updating, refreshing dashboardssf-reports
Quarterly report updates, flipping date filters across multiple SF reportssf-reports
Managing SF list views — creating, editing, or running Contact/Lead/Opp list viewssf-reports
UI/UX design decisions, accessibility checks, interaction patterns, visual consistencyui-ux-pro-max
Brand voice, visual identity, messaging frameworks, brand compliancebrand
Design tokens, CSS variable systems, component specs, spacing/typography scalesdesign-system
Converting a PDF, DOCX, EPUB, PPTX, or web page into Markdown Claude can readconvert-document
"Read this report", "extract this deck", "scrape this page", user drops a binary file or URLconvert-document
Applying MBB / McKinsey structure (SCQA, Pyramid, MECE, Data Three Essentials) to any docmbb-frame
"Make this executive-ready", "sharpen the argument", board updates, investor updates, strategic memosmbb-frame
Token waste audit, "what skills/MCPs am I not using", Claude Code health grade, optimize CLAUDE.mdrun codeburn optimize --provider claude -p 30days (CLI, read-only)
Per-model one-shot rate, validate model-router thresholds, productive-vs-reverted spendrun codeburn compare -p 30days or codeburn yield -p 30days
AI-slop UI detection, audit HTML for design anti-patterns (purple gradients, Inter, cards-in-cards, gray-on-color), pre-ship design checkrun npx impeccable detect <path> (CLI, no LLM, suitable for CI)
Local SEO, Google Business Profile, Maps rankings, reviews, NAP consistency, citationsseo-local; geo-grid rank tracking / competitor radius: seo-maps
Web quality / Lighthouse audit, "is my site fast", Core Web Vitals (LCP, INP, CLS), slow pageweb-quality-audit, core-web-vitals, wq-performance; slow hero/LCP in real Chrome: cdt-debug-optimize-lcp (Chrome DevTools MCP)
Web accessibility audit (WCAG 2.2) in code or a live browserwq-accessibility, cdt-a11y-debugging
UI review against web interface guidelines (file:line findings)web-design-guidelines
React page/route transitions, View Transition APIreact-view-transitions
React component API design, compound components, boolean-prop sprawlcomposition-patterns
Email deliverability, spam, SPF/DKIM/DMARC, bounces, CAN-SPAM/GDPRemail-best-practices; HTML email templates: react-email
Vercel cost / performance from real metrics, "why is my Vercel bill high"vercel-optimize
Figma file to code, implement a Figma design, Code Connect, build a design library from Figmafigma:figma-design-to-code / figma:figma-code-connect / figma:figma-generate-library (Figma plugin; sign in via /mcp first)
Supabase database, auth, RLS policies, Postgres schema or migrations, Supabase errorssupabase:supabase + supabase:supabase-postgres-best-practices
Responsive layout check, "does this work on mobile", breakpoint sweep, find where a layout breaksresponsiveness-check (drives the Playwright MCP)
Favicon, app icons, apple-touch-icon, web manifest, "favicon not showing"favicon-gen
Live Next.js dev-server errors, routes, logs, "why is my Next app broken locally"next-devtools MCP (mcp__next-devtools__*)
Cross-browser testing (Firefox/Safari), scripted browser flows on a sitePlaywright MCP (mcp__playwright__*); Chrome-only debugging stays on cdt-*
Stress-test a plan against project's domain language, build/maintain CONTEXT.md, capture ADRs as you decidegrill-with-docs skill — manual invocation via /grill-with-docs (skill has disable-model-invocation: true)
Find refactor candidates, surface deepening opportunities, Ousterhout deep-module review, identify shallow modules earning their keepimprove-codebase-architecture skill
"Be terse", "cut output tokens", "caveman mode", "talk like caveman", long debug sessions where output bloat is expensivecaveman skill (toggles persistent compressed-output mode; "stop caveman" to disable)

Routing Rules

  • Match on intent, not exact keywords. "Help me write a blog post" triggers content-research-writer. "Make my tweet better" triggers twitter-algorithm-optimizer.
  • If multiple skills could apply, pick the most specific one. Ask only if genuinely ambiguous.
  • Skills with supporting files store resources in ~/.claude/commands/skill-resources/{skill-name}/. Reference these paths when the skill instructions mention scripts, templates, themes, or examples.
  • Some skills require external dependencies (Composio API key for connect/connect-apps, Playwright for webapp-testing, yt-dlp for video-downloader, langsmith-fetch CLI for langsmith-fetch, codeburn Node CLI for token-waste audits, impeccable Node CLI for HTML anti-pattern detection). If a dependency is missing, tell the user what to install and offer to set it up.

@RTK.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.