AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Oct 25, 2026, 01:00 JST

FitLog dev swaps Claude Code prompt warnings for a 48-line CLAUDE.md harness

Send on LINE
FitLog dev swaps Claude Code prompt warnings for a 48-line CLAUDE.md harness

3 Key Points

  1. What happened

    A FitLog developer replaced repeated prompt warnings with a harness — a 48-line CLAUDE.md "map" linking six docs, four PreToolUse hooks (protect-env, protect-native, format, a Stop-time git diff summary), and five Skills.

  2. Why it matters

    The harness turns rules that must never break — .env access, manual ios/ or android/ edits, changes to components/ui/ originals — into machine blocks, so Claude Code cannot rely on luck to follow them.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

Context & Analysis

The developer's starting point was a pattern of repeated failures: Claude Code would open .env files, try to edit ios/ and android/ directories managed by Expo, or modify originals in components/ui/ generated by Reusables. Adding "please don't" lines to prompts only made the instructions longer, and compliance felt like a matter of luck. The reframing was to separate rules that cause accidents if broken from recommendations that can be fixed afterward, and to enforce only the former mechanically.

The resulting structure splits labor between documentation and hooks. CLAUDE.md was cut to a 48-line map pointing to six docs files — architecture, db-schema, reusables-guide, conventions, harness, and design-docs — so details are loaded only when needed. The four hooks include protect-env and protect-native, plus a formatting hook that skips silently if Prettier is absent and a Stop-time summary of git diff --stat. Five Skills cover /commit, /review, /deploy, /cleanup, and /new-screen, with the high-impact /deploy marked disable-model-invocation so only an explicit user call can trigger it.

The write-up also names its own limits. The developer could not read the original OpenAI article because of a 403 error and designed from summaries instead. A broken README with typos and missing sentences let Claude fill in guessed meanings, showing that a corrupted map defeats the harness. And while the hooks passed a 10-case sample test, real-session behavior is still to be confirmed.

FAQ
What does the CLAUDE.md file contain now?
It is a 48-line "map" with the stack, common commands, a list of invariants, and a "Where to Look" table linking to six docs files such as architecture.md and db-schema.md.
How are the hooks configured to block actions?
A PreToolUse entry matches Bash, Read, Edit, and Write, then runs protect-env.sh and protect-native.sh; protect-env.sh exits with code 2 and prints a suggested alternative to stderr.
What did the developer say is still incomplete?
The hooks passed a 10-case sample test, but whether they fire correctly in actual development sessions is still unverified.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articlezg launches local-first search layer on Alibaba's zvec