Legal noticePrivacy
Gaëtan Wittebolle.
UmamiContactFR
FR
← Guides
Claude Code, the guide
Chapter 21 / 22
  • 15Create visuals: artifacts, Design, Slides and images
  • 16Plugins and the marketplace
  • 17MCP: connect Claude to your tools
  • 18Let Claude work on its own: /goal, /loop, routines and workflows
  • 19Optimize costs and tokens: cache, model and tracking
  • 20Mods: change Claude Code itself
  • 21My complete setup

Part 6 · Going further

My complete setup

Chapter 21 · 23 min reading

This is my Claude Code setup, refined over months of daily use across several projects. Take what helps you, leave the rest. Last updated: October 2026.

Configuration architecture

Claude Code relies on a 3-level memory system:

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

Additional files:

  • ~/.claude/rules/: global rules, loaded in every session
  • ~/.claude/commands/ and ~/.claude/skills/: my commands and skills (both create a /command since January 2026)
  • ~/.claude/agents/: autonomous sub-agents
  • ~/.claude/scripts/: scripts called by hooks
  • ~/.claude/settings.json: plugins, deny list, global permissions, hooks, status line
  • ~/.claude/projects/<project>/memory/: auto-memory, which Claude writes itself
  • .claude/ in each project: project-specific rules and settings

The models I use in October 2026

Model or settingWhen I reach for itHow
Opus 5.5 (1M)Anything that needs quality: features, refactors, reading a codebaseClaude Code default, nothing to do
Fable 5.1 (1M)The most capable, and the most expensive ($10/$50 per million at API rates). Keep it for problems Opus can't crack/model fable
Sonnet 5.5 (1M)Long, well-scoped tasks, when Opus is more than you need/model sonnet
Haiku 5.5 (1M)Exploration sub-agents, short tasksmodel: haiku in the sub-agent's file
/fastFast iteration: same model, roughly 2.5x faster, but more expensive/fast mid-session
/effortThinking level (low, medium, high, xhigh, max). I run high on Opus 5.5/effort high

In practice I stay on Opus 5.5 for anything that needs quality, and I switch to Haiku for exploration sub-agents where only volume matters.

Careful: /fast does not downgrade you to a smaller model. You stay on Opus 5.5, it answers faster, and you pay for it ($8/$40 per million at API rates, double the normal price).

Default effort is medium on the 5.5 models. The higher the effort, the more Claude thinks before answering, and that thinking is billed as output. On the 5.5 models and Fable, thinking can't be turned off: effort is the only lever.

Switching models mid-session costs you. Each model has its own cache: switching halfway makes it reread the whole conversation without cache. My own numbers are in chapter 19. Changing effort, on the other hand, no longer breaks the cache on the 5.5 models and Fable 5.1. Turning on /fast recomputes it once. Pick the model at the start, adjust effort freely.

My global CLAUDE.md (~90 lines)

Loaded in every conversation. It contains:

  • Identity: solo builder, Next.js + Supabase + shadcn/ui + Tailwind v4 stack, answers in French, code in English
  • Brain: where my knowledge base lives and how to query it without hallucinating
  • Coding standards: strict TypeScript, never any, @/ imports, no console.log in final code
  • UI/UX: shadcn/ui required, Tailwind v4 with CSS variables, Recharts SSR pattern
  • Git: conventional commits in English, never push without asking, never force push to main
  • Writing style and design: the AI anti-patterns to strip from everything Claude writes
  • Tools: pnpm by default, Prettier via hook

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

Five files, loaded in every session.

safety.md, what's forbidden

  • rm -rf: use trash
  • sudo without confirmation
  • Deleting SQL migrations
  • supabase db reset (destroys data and credentials)
  • Overwriting a .env or a credentials file

quality.md, quality standards

  • Never mark a task done without proof that 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 or more, cut into vertical slices (DB + service + UI for one piece of a feature), plan reviewed by a second agent
  • Subagents to keep the main context clean
  • With the 1M window, no numeric threshold to watch. A deliberate /compact between two big features, with an instruction, rather than an auto-compact in the middle of a task. I turned auto-compact off
  • /rewind when things go off the rails

self-improvement.md, self-improvement

  • After I correct it: Claude saves the lesson to memory (feedback type)
  • Missing pattern detected: it suggests a rules update

writing-style.md, AI anti-patterns

  • The list of phrasings that give away generated text: em dashes, parallel structures, sententious lines

What moved out of the rules

My Next.js, Supabase, CHANGELOG, multi-agent TypeScript and PDF export patterns now live in skills (nextjs-patterns, supabase-patterns, project-changelog...). The difference matters: a rule loads in every session, a skill only when the topic comes up.

My hooks

Hooks are scripts that run at specific moments (session start, before or after a tool, end of a turn). Chapter 9 covers how they work. Here are the ones in my ~/.claude/settings.json:

  • SessionStart (brain): injects a pointer to my knowledge base and the latest entries from its log. At first, this hook pasted the full index and MEMORY.md into every session. That duplicated auto-memory, and the dump got truncated anyway. The short version does the same job.
  • SessionStart (conflict): warns me if another Claude Code session is already running on the same checkout.
  • PreToolUse (config protection): blocks edits to .eslintrc, .prettierrc, biome.json. Claude fixes the code instead of weakening the rules.
  • PostToolUse (Prettier): formats every edited file with the project's own Prettier. Never a Prettier downloaded on the fly.
  • PostToolUse (checks): flags a console.log slipped into TypeScript, and blocks em dashes in my content.
  • Stop (TypeScript): when Claude finishes its turn, runs tsc --noEmit. If it touched .ts files and errors remain, the hook sends the errors back and Claude fixes them before handing control back.
  • Stop (notification and measurement): macOS notification, and sends the session's numbers to TokenClimate.
  • SessionEnd and PreCompact: write a session summary into the brain.

The JSON skeleton, in the current format (each script receives the event context as JSON on standard input):

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          { "type": "command", "command": "~/.claude/scripts/session-start.sh" }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/scripts/config-protection.sh"
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/scripts/prettier-file.sh"
          },
          { "type": "command", "command": "~/.claude/scripts/console-warn.sh" }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "~/.claude/scripts/stop-typecheck.sh"
          }
        ]
      }
    ]
  }
}

My active plugins

Installed from the official marketplace, except the last one (chapter 16):

  • superpowers: brainstorming, plans, TDD, systematic debugging, review, worktrees.
  • commit-commands: /commit, /commit-push-pr, /clean_gone.
  • claude-md-management: audits and updates CLAUDE.md files.
  • frontend-design: design guidance so generated interfaces don't look like a template.
  • typescript-lsp: Claude queries the TypeScript language server instead of rereading whole files to find a definition.
  • vercel: Vercel skills and tools (deployment, env, logs).
  • claude-carbon: mine. I wrote it to see the CO2 and cost of each session in my status line.

My MCP servers

MCP servers connect Claude Code to external services (chapter 17).

Local

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

Cloud (claude.ai connectors)

  • Notion: read, create and edit pages and databases
  • Gmail and Google Calendar: email and calendar
  • Supabase: SQL, migrations, edge functions, types
  • Vercel: deployments, logs, project configuration
  • Sentry: production errors
  • PostHog: product analytics
  • Context7: up-to-date docs for any library
  • Canva and Excalidraw: designs and diagrams
  • Claude Docs: shared documents people can comment on

They all show up in /mcp. With tool search on by default, they cost almost nothing until Claude uses them. I push a carousel into Notion or check a Vercel deployment without leaving the terminal.

The Prompt Discovery principle (my old /code workflow)

For months, I coded with a four-step /code command. It's sitting in my archives now, but the principle still holds for writing your own multi-step skills.

The problem: Lost in the Middle

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

The fix, Prompt Discovery: each step is read right before it runs, so the instructions stay fresh at the end of the context.

How I used it

/code Add a user profile page

Explores the codebase, executes, verifies (TypeScript, build).

/code --plan Add a notification system

Explores, writes a plan, waits for user approval, executes, verifies.

The 4 steps

StepFileWhat happens
Explore01-explore.mdLaunches sub-agents to analyze the codebase, reads 3+ similar files
Plan02-plan.mdWrites 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)

The native commands I use all the time

  • /effort: I raise or lower thinking depending on the task, without breaking the cache.
  • /code-review: reviews the diff before every commit. --fix applies the fixes.
  • /loop and /goal: a task that repeats, or a condition to hit before Claude stops (chapter 18).
  • /rewind (or double Esc): undoes the latest code changes and steps back in the conversation. When Claude heads down the wrong path, this works better than fixing things by hand.
  • /compact: between two features, with an instruction about what to keep.
  • /usage: at the end of a session, to see what it cost and whether the cache held.

My custom sub-agents

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

In ~/.claude/agents/, I keep two:

  • code-reviewer: reviews a diff against my stack rules (strict TypeScript, App Router, Supabase, shadcn/ui), with a final verdict.
  • copy-anti-ia-linter: runs a French text through the AI anti-patterns from my rules and returns a table of violations.

For exploration, I let Claude launch its own sub-agents, on Haiku 5.5 when only volume matters.

Impact on context and cache: a sub-agent keeps what it reads in its own context, only its summary comes back. The trade-off: it doesn't read the main conversation's cache, and its cache only lasts 5 minutes, even on a subscription. A fork, on the other hand, starts from the parent's cache: the forked subagent from /subtask, or the session copy from /fork.

My skills and commands

None of these commands are native: they're my own .md files in ~/.claude/commands/ or ~/.claude/skills/. A command unused for more than 60 days goes into an archive folder.

Development

/oneshot · /explain · /audit · /deploy-check · /perf-audit · /push-prod · /meta-prompt

Plus skills that load on their own when the topic comes up: nextjs-patterns, supabase-patterns, project-changelog, multi-agent-typescript.

Content and marketing

/carousel · /lk · /newsletter · /email · /outreach · /image · /photo-gaetan · /deck · /yt · /yt-title · /thumbnail-yt · /voff · /caption · /lint-copy

Brain

/brain · /capture · /flush · /query · /lint · /emerge

What replaced my old homemade workflows

  • Multi-round brainstorming: the brainstorming skill from superpowers.
  • Code review: /code-review, native.
  • Commit, push and PR: /commit-push-pr from the commit-commands plugin.

New project checklist

  1. Create the project and initialize git
  2. Run claude in the project folder
  3. Run /init to generate the CLAUDE.md automatically (if there's no CLAUDE.md, Claude Code reads an existing AGENTS.md)
  4. Trim the CLAUDE.md to under 200 lines (keep the essentials)
  5. Create .claude/settings.local.json with permissions
  6. Add scoped rules in .claude/rules/ if needed
  7. Add comments in the key utility files

The settings that matter in ~/.claude/settings.json

{
  "modelSettings": {
    "claude-opus-5-5": { "effortLevel": "high" },
    "claude-sonnet-5-5": { "effortLevel": "medium" }
  },
  "permissions": { "defaultMode": "auto" },
  "env": { "ENABLE_PROMPT_CACHING_1H": "1" }
}

What each option does:

  • modelSettings: the thinking level saved per model. You rarely write it by hand: when you confirm a level with /effort, Claude Code saves it here for the current model. Careful: an effortLevel set at the root of your user settings no longer applies to Opus 5.5, which goes back to its medium default until you set a level for it. max isn't accepted anywhere in settings, you can only set it for one session with /effort max.
  • defaultMode: "auto": auto mode (the default mode, see chapter 9). Setting it explicitly locks it in if the default ever changes. Careful: defaultMode: "auto" and the autoMode rules are only read from ~/.claude/settings.json (or managed settings, or --settings), not from a project's .claude/settings.json. A classifier lets safe actions through and blocks destructive ones and anything touching prod.
  • ENABLE_PROMPT_CACHING_1H: requests the one-hour cache for the conversation and for subagents. On a subscription, the main conversation already has it, but everything drops to 5 minutes as soon as you switch to usage credits. Cache writes cost more (2x the input price instead of 1.25x). Useful if you often pause for more than 5 minutes.

You can also change these settings mid-session:

  • /effort for the thinking level
  • /config key=value to change one specific setting without opening the file
  • /output-style for the response style
  • /fast to switch to fast mode, without changing models

Status line with a context alert

The status line shows live info under the input area. These days I use the claude-carbon one (model, context, cost, CO2, 5-hour quota). If you want to write your own, here's a minimal version with 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 5.5] my-project | 45% ctx | $1.23. And above 60%: [Opus 5.5] my-project | 65% ctx [compact soon] | $2.10. Adjust the thresholds: on a 1M window, 60% is already 600,000 tokens reread on every message.

The JSON the script receives also contains rate_limits.five_hour, rate_limits.seven_day and a prompt_cache object, enough to show your quota and the cache state.

To turn it on, add this to settings.json:

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

Auto-memory: the official system and my own convention

The official system. Claude Code takes notes on its own in ~/.claude/projects/<project>/memory/. A MEMORY.md file acts as the index, loaded at the start of every session (the first 200 lines or 25 KB). You turn it off with autoMemoryEnabled: false or CLAUDE_CODE_DISABLE_AUTO_MEMORY=1. To make it remember something, tell it ("remember that migrations always go through a Supabase branch"), or open /memory.

The 4-type taxonomy I use (user, feedback, project, reference) is my personal convention, not an Anthropic requirement. The official contract stops at the MEMORY.md index. The sub-files, the categories and the naming conventions are structure I added to keep my brain readable. You can adopt it, simplify it, or not formalize anything at all.

In my setup, ~/Claude OS/brain/memory/MEMORY.md lists the typed memories and points to individual markdown files:

  • user: who I am, how I collaborate, what I already know
  • feedback: the corrections I've given on how to work
  • project: decisions, status of initiatives, deadlines, current context
  • reference: pointers to external systems (Notion, dashboards, etc.)

That folder is a symlink to the project's official auto-memory folder. Result: Claude Code loads it natively, no hook needed, and the memories it writes land straight in my brain.

Global deny list (safety net)

In ~/.claude/settings.json, the deny list blocks dangerous commands regardless of permission mode, auto mode included:

{
  "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*)",
      "mcp__claude_ai_Gmail__send_message",
      "mcp__claude_ai_Gmail__reply"
    ]
  }
}

The Bash lines cover the most destructive commands: deleting files, overwriting git history, wiping a database. The last two stop Claude from sending an email from my Gmail: it can draft one, sending stays with me. Better to block them once and for all than to count on the classifier.

Advanced tips

The 3-file rule

Before creating a new component, route or action, Claude has to read at least 3 similar existing files. That keeps patterns consistent without documenting everything in CLAUDE.md.

Comments as instructions

Add // CLAUDE: comments in the key utility files. When Claude reads those files to understand the patterns, it picks up the instructions along the way. Unlike CLAUDE.md, they cost nothing until it opens the file.

Examples:

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

/effort instead of a magic word

For a long time the "ultrathink" keyword was how you forced deeper thinking from the prompt. Today depth is set with /effort: high or xhigh for an architecture problem or a subtle bug, medium or low for a mechanical task. On the 5.5 models, changing effort doesn't break the cache, so you can adjust it along the way.

Meta-prompt to optimize your prompts

My /meta-prompt skill generates a prompt using Anthropic's best practices: XML tags, examples, guided reasoning. I use it to write the system prompts behind my apps' AI features.

Typecheck at the end of the turn, not at commit time

My TypeScript hook runs on Stop, not on git commit. Claude sees its errors as soon as it hands control back and fixes them right away, instead of discovering them at commit time.

Typical folder structure

~/.claude/
├── CLAUDE.md                          ← Global preferences
├── settings.json                      ← Plugins, deny list, hooks, status line
├── rules/
│   ├── safety.md                      ← Prohibitions (rm -rf, sudo, db reset)
│   ├── quality.md                     ← Proof before "done"
│   ├── workflow.md                    ← Plan mode, subagents, /compact, /rewind
│   ├── self-improvement.md            ← Learning loop
│   └── writing-style.md               ← AI anti-patterns
├── skills/
│   ├── nextjs-patterns/SKILL.md       ← Loaded when touching Next.js
│   └── supabase-patterns/SKILL.md     ← Loaded when touching Supabase
├── commands/
│   ├── oneshot.md                     ← Small feature, no plan
│   └── deploy-check.md                ← Pre-deployment checklist
├── scripts/                           ← Hook scripts
└── agents/
    ├── code-reviewer.md               ← Diff review
    └── copy-anti-ia-linter.md         ← Lints French copy

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

Going further: what all this costs

I measured what this setup consumes over two months and 230 sessions in the guide "Claude Code without the waste".

The mechanics (cache, context, models, effort, cold restarts) are in chapter 19, along with the two tools I use to measure: claude-carbon and TokenClimate.

Key takeaways

  • Opus 5.5 by default, Haiku 5.5 for exploration sub-agents, Fable 5.1 in reserve. Pick the model at the start, adjust effort along the way.
  • A rule loads in every session, a skill only when it's needed. Put your specialized patterns in skills.
  • Hooks do the repetitive work: formatting, end-of-turn typecheck, config protection, measurement.
  • Auto-memory is native. To add a memory, ask Claude or use /memory.
  • The deny list blocks the worst regardless of mode. Don't rely on the classifier alone.

End-of-part quiz

Part 6: Going further

8 questions. You pass the part with 7 correct answers or more.

  1. 1/8 You're making the thumbnail for your next YouTube video: a visual background with the video title written on it. How do you do it from Claude Code?
  2. 2/8 A plugin from the community directory looks tempting. claude plugin details lists 12 skills and a SessionStart hook. What do you read first in its repo?
  3. 3/8 You connect the claude.ai Supabase connector to your production project. Your sessions start in auto mode. Which safeguard do you add?
  4. 4/8 Your /goal says "the tests in src/billing pass". Claude fixed the code but didn't rerun npm test in the conversation. What does the evaluator do?
  5. 5/8 Opus 5.5 session, 100,000-token conversation. You want an inventory of the project's log files, a simple task. What's the cheapest option?
  6. 6/8 You come back after three hours to a 300,000-token session. The task is done and you're moving on to another feature. What's the cheapest move?
  7. 7/8 You want to install a mod that shows a progress bar. claude plugin validate lists $.http.fetch and $.env.get in its calls:. What do you do?
  8. 8/8 You have 150 lines of Supabase patterns that you only use in two of your projects. Where do you put them?

0 of 8 answered

Sources

  • Claude Code, model configuration
  • Claude Code, prompt caching
  • Claude Code, status line
  • Claude Code, manage costs
← Chapter 20

Mods: change Claude Code itself

Chapter 22 →

Appendix A: the terminal for beginners