Day 47 of 52 · about 20 min · Basics · Bonus
Debug a setup that is not doing what you expect
When a hook, skill or server seems ignored, the cause is usually a file in the wrong place or a stray comma. A few checks find it faster than rewriting, so practise them on a setup broken on purpose.
You’ll finish with
- A broken settings file found with
claude doctorand fixed. - A skill and an MCP server traced to where their files sat.
- The checks to run before you rewrite anything.
You’ll need
- The Acme Quotes project with
scripts/make-broken-setup.mjsfrom the Day 47 kit, and Node.js 22 or newer. - Claude Code, run in a new practice folder, not your project.
Before you start
Tell us about your setup and the steps change to fit it. Your answers stay in this browser, and you can change them at any time.
Which system are you on?
Commands differ between systems. Pick the one you’ll run Claude Code on.
The steps
One step at a time. When a step’s check matches, tick it and the next one opens.
Step 1 of 5: Build the broken practice folder
A script writes a small folder with three planted mistakes, next to your project.TerminalRun: node scripts/make-broken-setup.mjs
Run: cd ../acme-broken-setup
What happens: Nothing in your project changes.
The same two commands work in PowerShell. scripts/make-broken-setup.mjsJavaScript// Day 47: builds a small practice folder whose Claude Code setup has three // planted mistakes, so you can find them with Claude Code's own checks. // // node scripts/make-broken-setup.mjs [folder] // // It writes only to the folder you name, by default ../acme-broken-setup // (next to this project), and refuses to touch a folder that already exists. // Nothing in this project changes, so the mistakes never reach your real // setup or a later kit. Tested by test/broken-setup.test.js. import { existsSync, mkdirSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; const root = path.resolve(fileURLToPath(new URL('..', import.meta.url))); const target = path.resolve(process.argv[2] ?? path.join(root, '..', 'acme-broken-setup')); if (existsSync(target)) { console.error(`${target} already exists. Delete it, or pass another folder name.`); process.exit(1); } // The answers are in the Day 47 lesson, not here, so the folder can't give // them away. Each file below holds one mistake. const files = { 'README.md': [ '# Broken setup (practice)', '', 'Three things in this folder\'s Claude Code setup are wrong on purpose.', 'Start Claude Code here and use the checks from Day 47 of the', 'HorizonLux 52-Day Claude Code Challenge to find and fix them:', 'https://horizonlux.com/resources/claude-code-challenge', '', ].join('\n'), '.claude/settings.json': [ '{', ' "hooks": {', ' "SessionStart": [', ' {', ' "hooks": [', ' {', ' "type": "command",', ' "command": "node",', ' "args": ["-e", "console.log(\'The practice hook ran, so the hooks in this folder loaded.\')"]', ' }', ' ]', ' }', ' ],', ' }', '}', '', ].join('\n'), '.claude/skills/release-notes.md': [ '---', 'description: Writes short release notes from the commits since the last tag. Use when the user asks for release notes or a changelog entry.', '---', '', 'Write release notes for the changes since the last git tag.', 'Group them under Added, Changed and Fixed, one line per change.', '', ].join('\n'), '.claude/.mcp.json': [ '{', ' "mcpServers": {', ' "claude-code-docs": {', ' "type": "http",', ' "url": "https://code.claude.com/docs/mcp"', ' }', ' }', '}', '', ].join('\n'), }; for (const [rel, text] of Object.entries(files)) { const file = path.join(target, ...rel.split('/')); mkdirSync(path.dirname(file), { recursive: true }); writeFileSync(file, text); } console.log(`Created ${target}`); console.log('Three things in its Claude Code setup are wrong. Open a terminal there and follow Day 47.');No peeking: the mistakes are in this file.
Check it worked
The script prints
Createdwith the new folder’s path.Step 2 of 5: Find the broken settings file
Start Claude Code in the practice folder and read what it reports.In order:
You
You run claude here
File
Claude Code reads .claude/settings.json
Claude
A Settings Error dialog opens
Fix it with Claude, exit, or continue without the file.
Invalid JSON switches off the whole file, hooks included. Choose to exit. Run
claude doctorin your terminal: it reports invalid settings files without starting a session. Delete the comma after the last]in.claude/settings.json, then startclaudeagain.Check it worked
No dialog this time, and
/hookslists a SessionStart hook from project settings.If it didn’t work
No Settings Error appears.
Check you started
claudeinsideacme-broken-setup, not in your project.Step 3 of 5: Find the skill that never loads
A skill needs its own folder with SKILL.md inside.In Claude CodeYou type: /skills
What happens:
release-notesis missing, though.claude/skills/release-notes.mdexists./contextshows the same gap: no description for it under skills.For macOS, Linux and WSL
Terminalmkdir -p .claude/skills/release-notes mv .claude/skills/release-notes.md .claude/skills/release-notes/SKILL.mdFor Windows
PowerShellNew-Item -ItemType Directory .claude\skills\release-notes Move-Item .claude\skills\release-notes.md .claude\skills\release-notes\SKILL.mdCheck it worked
Run
/skillsagain.release-notesis listed.If it didn’t work
It still isn’t listed.
Run
/reload-skills.Step 4 of 5: Find the MCP server that never appears
Project servers belong in .mcp.json at the folder root, not inside .claude.In Claude CodeYou type: /mcp
What happens:
claude-code-docsisn’t listed: Claude Code never reads.claude/.mcp.json.Claude Code reads .mcp.jsononly when a session starts.For macOS, Linux and WSL
Terminalmv .claude/.mcp.json .mcp.jsonFor Windows
PowerShellMove-Item .claude\.mcp.json .mcp.jsonExit Claude Code, move the file, start
claudeagain and approve the server.Check it worked
/mcplistsclaude-code-docsas connected.Step 5 of 5: Keep the checks for next time
Ask Claude Code what it loaded before you change any file.Is it loaded?
/context: everything in this session/hooks,/skills,/mcp: one feature each, with its source
Is it broken?
claude doctor: invalid settings files/doctor: a checkup that asks before fixingclaude --safe-mode: your setup switched off, to compare
For a message you don’t recognise, search its exact text in the error reference. Check it worked
Start
claude --safe-modein the folder./hooksshows no project hooks, proving the fixes came from your files.
Finish · 5 of 5 steps to go
You can find what didn’t load
What you’ll have checked
/hooks,/skillsand/mcpeach show today’s fix.claude doctorreports no invalid settings files.
Lesson updates by email
Get lesson updates by email
Leave your email and we’ll tell you when we add or update a lesson.
Claude Code for your team
Want Claude Code set up across your team?
HorizonLux sets up and repairs Claude Code for teams: CLAUDE.md rules, hooks that enforce them and reviewed MCP servers. Book a free call to talk it through.
Related
Questions
Questions about Day 47
Why build a separate folder?
So the planted mistakes never touch your real project or a later kit. Delete `acme-broken-setup` when you’re done.
Sources
Checked against the official Claude Code docs on .
- Debug your configuration
- Settings
- Error reference
- Troubleshooting
- Extend Claude with skills
- Connect to MCP servers
Independent resource, not affiliated with Anthropic. HorizonLux wrote this lesson; Claude Code is made by Anthropic.