Gaëtan Wittebolle.FR
← guides
Claude Code, the guide
Chapter 16 / 16

Part 1 · Foundations

  • 01What is Claude Code?
  • 02Step-by-step installation
  • 03CLAUDE.md, the brain of your project

Part 2 · Communicate and plan

  • 04How to talk to Claude Code
  • 05Plan before coding
  • 06The daily work cycle

Part 3 · Advanced tools

  • 07Specialized agents
  • 08The shortcuts that speed everything up
  • 09Permissions

Part 4 · Mastery

  • 10Memory between sessions
  • 11Case study, a feature from A to Z
  • 12The 11 fatal mistakes to avoid

Part 5 · Going to production

  • 13The checklists
  • 14Setting up infrastructure

Part 6 · Bonus, a power user's setup

  • 15Generating images from Claude Code
  • 16My complete setup

Part 6 · Bonus, a power user's setup

My complete setup

Chapter 16 · 20 min reading

👋

This page details my personal Claude Code setup, refined over months of daily use across multiple projects. Last updated: April 2026.

Configuration architecture

Claude Code uses a 3-tier memory system:

TierFileWhen it loads
Global~/.claude/CLAUDE.mdEvery conversation, every project
Project./CLAUDE.md at the project rootEvery conversation in that project
Subfolder./CLAUDE.md inside a subfolderWhen Claude reads a file in that folder

Additional files:

  • ~/.claude/rules/ → Global rules (loaded based on context)
  • ~/.claude/commands/ → Custom skills and commands
  • ~/.claude/agents/ → 16 autonomous sub-agents
  • ~/.claude/scripts/ → 4 automation scripts for hooks
  • ~/.claude/settings.json → 19 plugins, deny list, global permissions
  • ~/.claude/settings.local.json → 6 hooks, status line, local permissions
  • .claude/ in each project → Project-specific rules and settings

My global CLAUDE.md (~50 lines)

File loaded in EVERY conversation. Contains:

  • Identity: fullstack dev Next.js + Supabase + shadcn/ui + Tailwind v4, replies in French, code in English
  • Coding standards: TypeScript strict, Server Components by default, Server Actions + RLS + Zod
  • UI/UX: shadcn/ui mandatory, Tailwind v4 CSS vars, Recharts SSR pattern
  • Git: conventional commits in English, never push/force push without asking
  • Tools: pnpm by default, Prettier via hook

My global rules (~/.claude/rules/)

safety.md, what's FORBIDDEN

  • rm -rf → use trash
  • sudo without confirmation
  • Deleting SQL migrations
  • supabase db reset (destroys data + credentials)

supabase.md, mandatory patterns

  • createClient() (anon+RLS) for user pages
  • createAdminClient() ONLY for admin/scripts
  • Server action pattern: "use server" → createClient() → getUser() → Zod → query

nextjs.md, Next.js conventions

  • Server Components by default, Client Components only if state/events
  • READ 3 SIMILAR FILES before creating a new component/route/action
  • URL search params for filters (SSR-friendly), no useState
  • Never create middleware.ts without checking what already exists

quality.md, quality standards

  • Never mark a task done without proof it works
  • Demand elegance for non-trivial changes
  • Simplicity first, no laziness, minimal impact

workflow.md, session management

  • Plan mode for any task with 3+ steps
  • Subagents to keep context clean
  • /compact at 60%, STOP at 80%, /rewind if things go off the rails

self-improvement.md, auto-improvement

  • After a user correction → save to memory (feedback)
  • Missing pattern detected → suggest a rules update

changelog.md, automatic CHANGELOG

  • Update CHANGELOG.md after every code change

typescript-errors.md, multi-agent scope

  • Only fix TypeScript errors in your own files

writing-style.md, AI anti-patterns

  • Zero em-dashes, zero parallelism, zero pompous wording

pdf-export.md, carousel PDF export

  • Dimensions divisible by 4 (standard: 1080x1348px)
  • pypdf post-processing for exact MediaBox

My hooks (6 custom scripts)

Hooks run automatically at certain points. Configured in settings.local.json, they call scripts in ~/.claude/scripts/.

After every file edit (PostToolUse)

  • Prettier auto-format: npx prettier --write on the modified file
  • Console warn: alerts if console.log is detected in TypeScript/JavaScript
  • Suggest compact: suggests /compact at 40 tool calls, then every 25 after

Before certain actions (PreToolUse)

  • Config protection: blocks edits to linter/formatter configs (.eslintrc, .prettierrc, biome.json). Forces fixing the source code instead of weakening the rules.
  • Pre-commit TypeScript: runs npx tsc --noEmit before each git commit. Blocks the commit on error.

End of session (Stop)

  • TypeScript check: validates types and shows up to 15 errors
  • macOS notification: sound + clickable notification with project, branch, and session duration

My plugins (19 active)

Plugins add pre-configured workflows. Installable via the official marketplace.

Development

  • superpowers: full framework, 4-round brainstorming, TDD, structured debugging, plans, parallel code review, worktrees
  • commit-commands: /commit, /commit-push-pr, branch cleanup
  • typescript-lsp: integrated TypeScript language server
  • frontend-design: production-grade interface design

Integrations

  • vercel: deployment, env vars, status, marketplace, AI SDK
  • supabase: DB management, migrations, types, edge functions
  • stripe: payments, test cards, errors
  • sentry: error monitoring
  • playwright: screenshots, E2E tests, browser automation
  • Notion: read/write pages and databases

Productivity

  • claude-md-management: audit and improve CLAUDE.md files
  • ralph-loop: recurring in-session tasks
  • skill-creator: create new custom skills

My MCP servers

MCP servers connect Claude Code to external services via the Model Context Protocol.

Local

  • nano-banana: image generation and editing via Gemini (chapter 15)

Cloud (connected via claude.ai)

  • Notion: read, create, and edit pages and databases
  • Gmail: search, read, and draft emails
  • Google Calendar: manage the calendar
  • Supabase: run SQL, migrations, edge functions, types
  • Vercel: deployments, logs, project config
  • Stripe: payments, webhooks, authentication
  • Sentry: monitoring and alerts
  • Context7: up-to-date docs for any library
  • Canva: design creation and editing
  • Excalidraw: diagrams and technical schemas

Result: push a carousel to Notion, check a Vercel deployment, run SQL on Supabase, or search an email. Without leaving the terminal.

My /code workflow, Prompt Discovery

The problem, Lost in the Middle

LLMs pay more attention to tokens at the beginning and end of the context. A big initial prompt ends up "in the middle" after exploration → the model follows it less closely.

The fix: Prompt Discovery, each step is read JUST BEFORE it runs, keeping the instructions fresh at the end of the context.

How to use /code

/code Add a user profile page

→ Explores the codebase → Executes → Verifies (TypeScript, build)

/code --plan Add a notifications system

→ Explores → Builds a plan → User validation → Executes → Verifies

/code --plan --test --branch --pr Refactor the credits system

→ Explores → Plans → Git branch → Executes → Tests → PR

The 4 steps

StepFileWhat happens
Explore01-explore.mdSpawns sub-agents to analyze the codebase, reads 3+ similar files
Plan02-plan.mdBuilds a structured plan, identifies decisions (if --plan)
Execute03-execute.mdCodes in order: migrations → types → actions → UI
Verify04-verify.mdTypeScript check, lint, build, tests (if --test), PR (if --pr)

My custom sub-agents (16 agents)

A sub-agent is a "mini-Claude" dispatched for a specific task. It explores, analyzes, then sends a summary back to the main context. Upside: it can read 120K tokens and only return 1-2K.

Exploration

  • explore-codebase: project structure, stack, patterns, utilities (~500 words)
  • explore-supabase: SQL migrations, RLS policies, server actions (~800 words)
  • doc-lookup: documentation via Context7 MCP or web search (~1000 words)

Blog & content

  • blog-researcher: recent stats, source verification, free images
  • blog-writer: writing articles optimized for SEO and AI citations
  • blog-reviewer: quality review across 5 categories, scoring /100
  • blog-seo: on-page SEO optimization

SEO (7 specialized agents)

  • seo-content · seo-technical · seo-schema · seo-geo · seo-performance · seo-sitemap · seo-visual

Each SEO agent covers one area: content, technical, schema.org, AI citations, Core Web Vitals, sitemaps, visual rendering.

💡

Impact on context: a sub-agent can read 120K tokens and return only 1-2K to the main context. That's massive savings, and it lets you keep your context clean for the important instructions.

My skills and commands (43 commands)

Every .md file in ~/.claude/commands/ becomes a /name command.

Development (21 commands)

/code · /apex · /debug · /review · /component · /server-action · /form-builder · /migration-sql · /rls-policy · /refactor · /test-gen · /supabase-types · /codebase-map · /security-scan · /deploy-check · /push-prod · /pr · /clean-code · /explain · /perf-audit · /oneshot

Content & marketing (18 commands)

/carousel · /lk · /insta · /bip · /newsletter · /email · /veille · /image · /photo-gaetan · /banner · /video · /short · /deck · /content-repurpose · /recap · /ship · /metrics-share · /inbox-notion

Multi-step workflows

  • /code: Explore → Plan → Execute → Verify. Each step is a file read just-in-time (Prompt Discovery).
  • /apex: advanced version with flags --auto, --plan, --branch, --pr, --test
  • /brainstorm: deep research in 4 rounds, Exploration, Devil's Advocate, Synthesis, Crystallization
  • /debug: structured debugging in 5 steps, Init, Analysis, Solutions, Fix, Verify
  • /review: parallel code review with 4 reviewers, Code, Best Practices, Security, Devil Advocate

New project checklist

  1. Create the project and init git
  2. Run claude in the project folder
  3. Run /init to generate the CLAUDE.md automatically
  4. Trim CLAUDE.md to ~100-200 lines (keep what matters)
  5. Create .claude/settings.local.json with permissions
  6. Add scoped rules in .claude/rules/ if needed
  7. Add code comments in key utility files (zero cost)

settings.json configuration

The ~/.claude/settings.json file contains settings that significantly improve response quality. These 3 options are recommended by Boris Cherny (Claude Code's creator):

{
  "effortLevel": "high",
  "alwaysThinkingEnabled": true,
  "outputStyle": "Explanatory"
}

What each option does:

  • effortLevel: "high": Claude uses more tokens to reason. Slower but smarter. Boris uses this for everything.
  • alwaysThinkingEnabled: true: shows Claude's reasoning. You see why it makes each choice.
  • outputStyle: "Explanatory": adds "Insight" boxes that explain the patterns and frameworks used. Very helpful when exploring an unfamiliar codebase.

These settings are also accessible via:

  • /model to change the effort level
  • /config for the output style

Status line with context warning

The status line shows real-time info under the composer. My version adds a context warning:

#!/bin/bash
input=$(cat)

MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir')
PCT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)
COST=$(echo "$input" | jq -r '.cost.total_cost_usd // 0')

FOLDER="${DIR##*/}"

if [ "$PCT" -ge 80 ]; then
  CTX=" [COMPACT NOW]"
elif [ "$PCT" -ge 60 ]; then
  CTX=" [compact soon]"
else
  CTX=""
fi

echo "[$MODEL] $FOLDER | ${PCT}% ctx${CTX} | \$$COST"

Result: [Opus 4.6] my-project | 45% ctx | $1.23. And when context goes above 60%: [Opus 4.6] my-project | 65% ctx [compact soon] | $2.10

To enable it, add this to settings.local.json:

{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh",
    "padding": 2
  }
}

Global deny list (safety net)

In ~/.claude/settings.json, the deny list blocks dangerous commands everywhere, even in trust mode:

{
  "permissions": {
    "deny": [
      "Bash(rm -rf*)",
      "Bash(sudo*)",
      "Bash(supabase db reset*)",
      "Bash(git push --force*)",
      "Bash(git push -f*)",
      "Bash(git reset --hard*)",
      "Bash(git clean -f*)"
    ]
  }
}

These commands are the most destructive: deleting files, rewriting git history, wiping a database. Better to block them once and for all.

Advanced tips

The 3-files rule

Before creating a new component/route/action, Claude must READ at least 3 similar existing files. This guarantees pattern consistency without having to document everything in CLAUDE.md.

Code comments as instructions

Add // CLAUDE: comments in key utility files. When Claude reads these files to understand the patterns, it inherits the instructions for free, 0 extra tokens in the context.

Concrete examples:

  • supabase/server.ts → difference between anon client and admin
  • ai/types.ts → how to add a new AI skill
  • stripe/client.ts → don't expose the secret key client-side

/compact and /rewind, the 2 most underrated commands

/compact: summarizes the conversation and frees up context. Run it manually starting at 50-60% of context. Don't wait until 80%, that's the "dumb zone" where Claude loses quality. After a /compact, re-read the key files for your current task.

/rewind (Esc Esc): undoes the last code edits AND rolls back the conversation. When Claude heads in the wrong direction, /rewind is 3x more effective than fixing manually (the context is already polluted by the wrong approach).

The "ultrathink" keyword

Adding ultrathink in a prompt forces Claude to use deep reasoning (extended thinking). Ideal for complex architecture problems, design choices with lots of trade-offs, or debugging subtle issues.

Prompt Discovery (anti "Lost in the Middle")

Never give all the instructions for a workflow in one go. Split into step files read just-in-time so the instructions always stay "fresh" at the end of the context.

Meta-prompt to optimize your prompts

The /meta-prompt skill generates optimized prompts by applying Anthropic best practices: XML tags, few-shot examples, chain-of-thought, etc. Useful for building system prompts for your AI skills.

Pre-commit TypeScript hook

A PreToolUse hook that intercepts git commit and runs npx tsc --noEmit first. Blocks the commit on a TypeScript error, automatic safety net.

Sample folder layout

~/.claude/
├── CLAUDE.md                          ← Global preferences
├── settings.json                      ← Active plugins
├── settings.local.json                ← Hooks (Prettier + notification)
├── rules/
│   ├── safety.md                      ← Forbidden commands (rm -rf, sudo, db reset)
│   ├── supabase.md                    ← Mandatory Supabase patterns
│   ├── nextjs.md                      ← Next.js conventions
│   ├── workflow.md                    ← Best practices /compact, /rewind, sessions
│   └── changelog.md                   ← Update CHANGELOG after every change
├── commands/
│   └── code/
│       ├── skill.md                   ← /code workflow (entry point)
│       └── steps/
│           ├── 01-explore.md          ← Exploration step
│           ├── 02-plan.md             ← Plan step (if --plan)
│           ├── 03-execute.md          ← Execution step
│           └── 04-verify.md           ← Verification step
└── agents/
    ├── explore-codebase.md            ← Project exploration sub-agent
    ├── explore-supabase.md            ← Supabase schema sub-agent
    └── doc-lookup.md                  ← Documentation sub-agent

~/code/my-project/
├── CLAUDE.md                          ← ~100-200 lines, project-specific
└── .claude/
    ├── settings.local.json            ← Project permissions
    └── rules/
        ├── db-schema.md               ← DB schema (if applicable)
        └── roadmap.md                 ← Phases and sprints
← Chapter 15

Generating images from Claude Code