Setup
Claude Code setup
Four rules and a setup you can copy: a global CLAUDE.md, settings, hooks, three agents and a memory format.
Why I built itMy rules grew until Claude skipped some of them, so I rebuilt the setup from a blank page.
- The instructions loaded at every session start dropped from about 11,100 to about 1,800 tokens (Sep '26).
- Before the rebuild, some rules contradicted each other.
- I clicked through permission prompts for routine reads and edits.
- A rule now stays only if it answers a failure I saw twice.
How to talk to me
- Bottom line first, then bullets of one sentence each. A lookup gets one line. A decision gets your assessment, the strongest counter, and one recommendation.
- Be a peer: state assessments as facts, say when I am wrong and why, and say in one line when a claim is sound. If I push back and you change your view, name what changed it.
- Plain words. Gloss a technical term the first time. Numbers carry units and precision. A claim I could not check myself gets a source.
- One clarifying question at a time, and only when the answer changes what you do.
Autonomy
- A question is a question: answer it. Implement only when asked.
- Cheap and reversible: do it, then report. Irreversible, expensive, or reaching another person: ask first and say what it touches.
Real lines from the template. Placeholders in angle brackets are yours to fill.
What you get
A starting setup for Claude Code that you can fill in and run the same day.
- A global
CLAUDE.md(a note Claude reads at the start of every session) with placeholders. - An annotated
settings.json. - Two hook scripts (small scripts that run on their own at set moments).
- A slop checker for your writing.
- Three agents (separate Claude helpers with one narrow job each):
researcher,red-team(it challenges a plan from a fresh context) andpanelist(a reader for the recipient panel). - The memory format I use.
Builds on: petergyang/no-ai-slop (MIT), for slop-check.sh. Notices in the repo.
Copy it
Time to set up: 30 minutes. Pick the assistant you use. The choice is remembered on this device.
Hooks, agents, settings and scripts run on your machine, so this tool lives in Claude Code.
[ -d ~/how-i-work ] || git clone https://github.com/DanielErCohen/how-i-work.git ~/how-i-work
mkdir -p ~/.claude/agents ~/.claude/skills ~/.claude/hooks ~/.claude/scripts
cp -n ~/how-i-work/claude/CLAUDE.template.md ~/.claude/CLAUDE.md
cp -n ~/how-i-work/claude/agents/*.md ~/.claude/agents/
cp -Rn ~/how-i-work/skills/recipient-panel ~/.claude/skills/
cp -n ~/how-i-work/claude/scripts/slop-check.sh ~/.claude/scripts/
cp -n ~/how-i-work/claude/hooks/*.sh ~/.claude/hooks/
chmod +x ~/.claude/scripts/slop-check.sh ~/.claude/hooks/*.shOn a fresh Mac the first git run may prompt you to install the Command Line Tools. Accept, wait for the install, then run the block again.
The template has a rule that runs a recipient panel before anything goes to other people, so the block copies that skill too. It also copies the slop checker to ~/.claude/scripts/ and the hooks to ~/.claude/hooks/, and makes them executable. The cp -n flag never overwrites: an existing CLAUDE.md, agent, hook or script stays as it is. Read the hook scripts before you install them. Then replace each placeholder in angle brackets in ~/.claude/CLAUDE.md. Settings and hooks are in the steps below.
Open the link, copy the template text and paste it into the instructions of a Claude project. Hooks, agents, settings.json and scripts need Claude Code.
https://raw.githubusercontent.com/DanielErCohen/how-i-work/main/claude/CLAUDE.template.mdOpen the link, copy the template text and paste it into your assistant's instructions field. Then fill in the placeholders.
https://raw.githubusercontent.com/DanielErCohen/how-i-work/main/claude/CLAUDE.template.mdSetup steps
- Read settings.md. If you already have a settings file, back it up with
cp ~/.claude/settings.json ~/.claude/settings.json.bak-$(date +%F). Then merge the keys you want from settings.example.json into~/.claude/settings.json. Register the hooks there as the example shows. The slop-check hook needsjq. - In a code repo, add a map file: copy
templates/code-repo/CLAUDE.mdand fill it in. Then split your next task across agents using the four rules below.
Check your instructions
Read the instructions I supplied. List the product context and writing rules you will use. Flag any placeholders I still need to fill in. Make no file changes.Expected result: a short list of the supplied rules and any missing values; compare it with your instruction file.
Where it works
| Assistant | Support |
|---|---|
| Claude Code | All parts: CLAUDE.md, settings, hooks, agents and scripts. |
| Claude app | The CLAUDE.md text, as project instructions. Hooks, agents and settings need Claude Code. |
| Other assistants | The CLAUDE.md text, in any instructions field. The rest is specific to Claude Code. |
The four rules and what each part does
How I use AI in the first place is on the How I work page.
The four rules
- Split the models by job. The strongest model plans and orchestrates. A mid model writes the code and reviews it. The fastest model does research, recon and intel gathering, because it is fast and cheap for reading. Independent red-teams run on the strongest model. Today that means Opus, Sonnet and Haiku.
- One agent per task. Research, recon, planning, coding and review each get their own agent with a narrow brief. Keep each context small.
- Review before merge. Coding agents open PRs (pull requests: proposed code changes that wait for review). The red team, one adversarial reviewer with a fresh context, and review agents check them. The orchestrator (the main Claude session that plans the work and merges the results) merges only after that, and I sign off before release.
- Add a map of the codebase. A file in the repo covering structure, key files, conventions, and how to run and test. Claude reads it at the start of each session, so it does not rebuild the context every time.
The setup and the reason for each part
Global CLAUDE.md
A file that tells Claude who I am, how I want answers and which evidence rules apply. See the template.
settings.json
Four subagents run at a time and none can start another, so work stays readable.
- Long sessions compact at 70% of the context window, because a long context costs more and answers worse.
- A deny list blocks catastrophic commands, force pushes and reads of secret files such as
.env,~/.sshand~/.aws. - An ask list stops merges, repo deletes, outgoing messages, web fetches and web searches.
- Each key is explained in the repo.
Hooks
A hook is a small script that runs automatically at a set moment. The repo holds two.
- One pulls your notes repo when a session starts.
- One runs a slop check on every markdown and HTML file Claude writes and hands hits back to fix or justify.
- I also use rtk, an optional tool that shortens command output to save tokens. The hooks README links to it.
- Hooks in the repo.
slop-check.sh
A script that flags banned words, puffery and sentence patterns I do not want in my writing. It builds on petergyang/no-ai-slop, which its header credits. See the script.
Agents
The repo holds three agents.
researcherruns on the fast model and returns a sourced brief under 600 words.red-teamruns on the strongest model, writes no files (it can fetch the web) and gives an independent challenge.panelistruns on the fast model with read-only tools and reads a draft as one reader for the recipient panel.- All three are in the repo.
Memory
One fact per file, plus an index file with one line per memory.
- Claude reads the index and opens a file only when it matters.
- The format is in the repo.
GitHub stop rule
On any 403, 429 or secondary rate limit, all git and gh work stops and the error comes to me. It is one line in CLAUDE.md.
The nine steps show where these rules sit in a product round.
Came from
The rules came out of projects built with agents.
- In Sparktale I wrote the first CLAUDE.md map in Feb '26 and rewrote the rules from the conventions in merged pull requests in Mar '26.
- Parapet ran on Claude Code agents in sprints (short blocks of work with one goal). It taught me to review before merge and to test the production path end to end.
- I run the same setup on Wellness Coach, with one orchestrator and a standing team of role agents. I confirm every change to what the product does and sign off before release. Agents open PRs and a separate review agent checks them.
- The second brain holds the memory format and the session-start pull.
See also how the agents fit into Support delivery, Check the work and Prepare the release in the nine steps.
How my setup grew
Six changes between Feb '26 and Oct '26.
| Date | What changed | Why |
|---|---|---|
| Feb '26 | Wrote the first CLAUDE.md map and project rules, then added hooks, skills and agents. | A short map and rules let each session start from the repo's structure. |
| Mar '26 | Rewrote the rules from the conventions in merged pull requests. | Merged pull requests show the conventions a team applies in practice. |
| May '26 | Added the GitHub stop rule: on any rate-limit error, all git and gh work stops. | A rate-limit error means GitHub is refusing requests. Further calls can make it worse, and I need to see the exact error. |
| Aug '26 | Added a slop check hook on every markdown and HTML write. | The check catches banned words and constructions at write time, before I read the text. |
| Sep '26 | Rebuilt the setup: shorter loaded instructions, memory in one folder, the product-sparring skill. | Loaded instructions cost tokens in every session. |
| Oct '26 | Added the researcher and red-team agents. | Fast research and an independent challenge each deserve an agent with a narrow brief. |