The Claude Bible
Home / Quick setup: a structured Claude
Level: Advanced · 9 lessons

Quick setup: a structured Claude

The one-hour assembly guide: engine, CLAUDE.md, Obsidian memory, git transport, hooks, curated skills and a self-maintaining heartbeat.

Open the interactive course237 lessons, quizzes, exercises, a final exam with a diploma, 3 languages, free.

The map: what a structured Claude looks like

Out of the box, Claude Code is a brilliant amnesiac. Every session starts from zero: no memory of your projects, no knowledge of your rules, no accumulated lessons. Everything you taught it yesterday is gone this morning. This module fixes that. It is a hands-on assembly guide: at the end, you will have a structured Claude, one that remembers, follows your rules, improves over time, and maintains itself. Budget about one hour of setup.

A structured Claude is made of seven components, each covered by one lesson in this module:

Why bother? Because the value of an assistant compounds only if its knowledge does. An unstructured Claude solves the same problem for you twice and makes the same mistake twice. A structured Claude writes the lesson down the first time, links it to related lessons, and recalls it in the right context next month. The difference after three months of daily use is not subtle: this whole course was built with (and is largely a product of) exactly the setup you are about to install.

This module is deliberately self-contained. It overlaps with the deep-dive modules on extending Claude Code and on the second brain: those explain the why and the internals; this one gives you the ordered, copy-paste path. If a step intrigues you, follow the pointer to the full lesson. If you just want a working setup today, follow the commands in order and come back for theory later.

One principle before we start: structure lives in files, not in chat. Everything we install below is plain text on your disk: Markdown rules, Markdown notes, JSON settings, small scripts. Nothing is locked in a proprietary database, everything is versionable, inspectable and portable. That is what makes this setup durable across Claude versions: the files survive even when the tool changes.

Key points
  • A structured Claude has seven components: engine, constitution (CLAUDE.md), memory (notes + Obsidian), git transport, hooks, skills, and scheduled heartbeat
  • Knowledge compounds only if it is written to files: chat context dies with the session
  • This module is the ordered copy-paste path; the extending and second-brain modules hold the theory
  • Everything lives in plain text (Markdown, JSON, scripts): versionable, inspectable, portable

Install Claude Code and log in

First component: the engine. Anthropic's recommended path since 2026 is the native installer, a self-contained binary that auto-updates and does not depend on Node.js at runtime:

Package managers work too if you prefer them (brew install --cask claude-code, winget install Anthropic.ClaudeCode, or npm install -g @anthropic-ai/claude-code), with one caveat: brew and winget installs do not auto-update, and the npm route wants Node.js 22 or newer since v2.1.198. On native Windows, install Git for Windows as well: it gives Claude Code a proper Bash tool instead of falling back to PowerShell for everything.

Then run claude in a terminal. On first launch a browser opens for OAuth login. Two account types work, and the distinction matters for your wallet:

For a personal structured setup, the subscription route is almost always the right one. Watch one trap: if the ANTHROPIC_API_KEY environment variable is set, it can take precedence over your subscription and silently bill you per token. If you have an old key lying around in your shell profile, remove it or scope it to the projects that need it.

Verify the install with claude --version, then from inside a session run /doctor (alias /checkup). Doctor is a bundled diagnostic skill that checks your install health, PATH issues, unparseable settings files, slow hooks, and even flags unused skills or MCP servers that cost you context for nothing. Run it now to confirm a clean baseline, and remember it exists: it is the first thing to run whenever your setup misbehaves after the customizations we are about to add.

Where things live from now on: the directory ~/.claude/ is your Claude home. ~/.claude/CLAUDE.md will hold your global rules (next lesson), ~/.claude/settings.json your configuration and hooks, ~/.claude/skills/ your installed skills, and ~/.claude/projects/ the per-project data including memory. Every component of this module is a file somewhere under this tree or referenced from it.

Optional extras, worth knowing but not blocking: the IDE extensions (VS Code, JetBrains) embed the same engine in your editor; the desktop and web apps offer Claude Code sessions outside the terminal; and yes, Claude Code runs natively on an Android phone via Termux, which becomes genuinely useful once your memory is git-synced. The second brain module has a dedicated lesson on that pocket setup.

Key points
  • Native installer: curl install.sh on macOS/Linux, irm install.ps1 on Windows; it auto-updates, brew/winget/npm variants do not
  • Log in with a subscription (flat fee) rather than a Console API account (per-token billing) for personal use; a stray ANTHROPIC_API_KEY can silently override the subscription
  • /doctor (alias /checkup) diagnoses install, settings, hooks and context-wasting extras; run it after every big setup change
  • ~/.claude/ is the home of everything: CLAUDE.md, settings.json, skills/, projects/

Your global CLAUDE.md: a constitution, not a novel

Second component: the constitution. The file ~/.claude/CLAUDE.md is injected into every session, across all projects, with the strongest instruction priority the harness gives to user content. It is the single most leveraged file in your whole setup: one line here changes the behavior of every future session. That leverage cuts both ways, so the file must be curated ruthlessly.

A battle-tested structure, refined over months on the course author's setup:

The pointer principle deserves emphasis, because it is where most setups rot. If you paste a full protocol into CLAUDE.md and into a skill and into a memory note, the three copies drift apart within weeks and Claude follows whichever it read last. The rule: CLAUDE.md is a router. Detail lives in the skill or note it points to, and is updated there only. This also keeps the file small, which matters twice: every byte is loaded into every session's context, and a short constitution is one Claude actually follows. Under 5 KB is a good target; if yours crosses 10 KB, it has almost certainly absorbed content that belongs in a skill.

A minimal skeleton to start from:

# Rules (absolute)
- Never delete: archive to _ARCHIVES/ instead.
- Secrets never in chat: set env vars, verify by length, never echo.
- Technical decisions: decide and execute. Escalate only paid costs,
  security, and product decisions.
- Update the memory after every delivered batch of work.

# Session start
- Read the memory index. When I name a project, load its memory notes
  before acting.

# Protocols (pointers)
- Memory sync protocol: see the sync-memory note.
- New project: attach the code-graph tool, reuse existing patterns first.

Three operational details. First, changes apply at the next session, not the current one: CLAUDE.md is read once at startup, so test edits by opening a fresh session. Second, keep an archive of previous versions (a dated copy in an archive folder) before any rewrite: your constitution is exactly the kind of file you will want to roll back someday. Third, if you work on Windows with PowerShell scripts touching your files, consider keeping the file pure ASCII: it avoids a whole class of encoding corruption when tools rewrite it.

Project-level CLAUDE.md files (in each repo root) stack on top of the global one and carry project-specific facts: build commands, architecture notes, conventions. Same principles apply: short, imperative, pointers over prose. The global file carries who you are and how you work; the project file carries what this codebase is.

Key points
  • ~/.claude/CLAUDE.md loads into every session with top instruction priority: highest-leverage file of the setup
  • Structure: absolute rules first, then session-start routine, then one-line pointers to skills and notes
  • CLAUDE.md is a router: protocols live in exactly one owning file, never duplicated, or the copies drift
  • Keep it small (about 5 KB), archive before rewrites, and remember changes only apply to the next session

Plug Obsidian into Claude's memory

Third component: the memory, and the window into it. Claude Code persists memory as plain Markdown notes in a per-project folder under ~/.claude/projects/<project-slug>/memory/, with an index file, MEMORY.md, loaded into context at each session start. That folder is the brain. Obsidian is the free tool that turns the same folder into something a human can navigate: backlinks, full-text search, and a graph view where your knowledge becomes visible.

The setup move that makes everything work is deceptively simple: open the memory folder itself as your Obsidian vault. Not a copy, not an export, the folder itself. Download Obsidian from obsidian.md (free, no account needed; on Windows, winget install Obsidian.Obsidian), choose "Open folder as vault", and point it at the memory directory. From then on there is a single source of truth: what you see and edit in Obsidian is exactly what Claude loads and writes. No synchronization, because there is nothing to synchronize.

Inside the vault, three conventions keep the brain healthy as it grows from ten notes to several hundred:

One structural subtlety if you work on several projects: Claude keeps a separate memory folder per working directory, so knowledge fragments across stores. The fix on the author's setup is filesystem links (junctions on Windows, symlinks elsewhere): the per-project memory folders are mounted as subfolders (for example _projets/<name>) inside the one home vault. Obsidian sees a single unified brain; each project store remains physically where Claude expects it; editing through the mount edits the real store. One vault, many stores, zero copies.

Two quality-of-life touches worth stealing: color the graph by note type (Obsidian graph groups: one color for project_ notes, another for feedback_, another for reference_), so the shape of your knowledge is readable at a glance; and keep bulky, regenerable material (exported conversation logs, generated code graphs) excluded from the main graph filter so it does not drown the signal.

That is the whole trick. No plugin marketplace spelunking required, no paid sync: one folder, opened by two programs, each seeing what the other writes. The deep-dive lessons earlier in the second brain module cover the recall mechanics and note-writing discipline; the next lesson makes this brain durable and portable with git.

Key points
  • Open Claude's memory folder ITSELF as the Obsidian vault: single source of truth, nothing to sync
  • Atomic notes with frontmatter (name, description, type), one fact per note
  • Wikilinks liberally plus MOC hub notes and the MEMORY.md index: no orphan notes, or they are never recalled
  • Multiple project memory stores unify into one vault via filesystem junctions/symlinks, no copies

Version your brain with git

Fourth component: the transport. Your memory vault is now the most valuable directory on your machine, and it lives in a dot-folder that no backup tool thinks about. The fix is the same one code uses: make the vault a git repository with a private remote. You gain history (every note change is a commit you can inspect and revert), backup (the remote survives your disk), and synchronization (the same brain on your desktop, your laptop, and even your phone).

Before the first push, audit for secrets. This step is not optional. Months of working notes accumulate exactly the things that must never reach a remote: tokens pasted during debugging, passwords quoted in session summaries. Grep the vault for the classic patterns (sk_live, ghp_, AKIA, long hex strings, the words password and token) and redact hits by replacing the value with a marker before committing. The author's first scan of a mature vault found a production admin password sitting in a session note; assume yours has an equivalent.

Then scope what travels. A good default .gitignore excludes what is bulky, regenerable, or risk-laden:

The atomic notes, the index, the hub notes: those are the brain, and those travel.

The daily protocol is two habits: pull at the start of any session that will touch memory, commit and push after each memory update, with a message naming the subject. If that sounds like discipline you will forget, you are right, which is why the next lesson automates both ends with hooks. On conflicts, apply the memory-specific rule: never overwrite, keep both versions in the note and flag the contradiction for review. A brain merges by accretion, not by force-push.

The payoff that surprises people: the phone. Claude Code runs natively on Android inside Termux, and once your vault is a git repo, the phone clones it and mounts it as its own session memory (a symlink from the phone's ~/.claude/projects/<slug>/memory to the clone). Desktop Claude and pocket Claude then read and write the same brain, a commit apart. A dedicated lesson in this course's second brain module walks through that pocket setup, traps included.

One caution to close: a private repo is private to the hosting account. Treat the vault remote with the same care as a password manager export: strong authentication on the account, no sharing the repo casually, and remember that redaction before commit beats deletion after push, because git history remembers what you pushed even after you remove it.

Key points
  • The vault becomes a git repo with a private remote: history, backup, multi-device sync
  • Before the first push: grep the vault for secrets (tokens, passwords, long hex) and redact; assume there is at least one
  • Exclude conversation exports, regenerable graphs and archives via .gitignore; the atomic notes and index travel
  • Protocol: pull at session start, commit+push after each memory update; conflicts merge by keeping both, never force

Hooks that keep the structure alive

Fifth component: the reflexes. Everything installed so far depends on habits: pull before working, update memory after a batch, push when done. Habits decay. Hooks are Claude Code's mechanism for turning them into automation: shell commands that the harness itself runs at lifecycle events. They are configured in ~/.claude/settings.json (user-wide) or a project's .claude/settings.json, and as of mid-2026 there are around thirty events to hook, from SessionStart and SessionEnd to Stop (end of each assistant turn), PreToolUse, PostToolUse and beyond.

For a structured setup, two hooks carry most of the value:

The shape in settings.json:

{
  "hooks": {
    "SessionStart": [{ "hooks": [{ "type": "command",
      "command": "bash ~/.claude/hooks/pull-brain.sh" }] }],
    "SessionEnd": [{ "hooks": [{ "type": "command",
      "command": "bash ~/.claude/hooks/push-brain.sh" }] }]
  }
}

A more advanced pattern from the author's setup solves a real gap: there is no native "session went idle" event, yet you want memory synchronized when you wander off mid-session. The solution is a two-stage architecture. Stage one, a global Stop hook: after every assistant turn, a tiny script registers the session (id, transcript path, working directory) in a pending file, costing milliseconds. Stage two, a scheduled task every 15 minutes: it checks pending sessions, and for any whose transcript has not changed in 30 minutes, runs Claude headless against that same session (claude -p --resume <session-id> "sync memory...") so the model itself writes the session's lessons into the vault. Idle sessions get their memory saved without anyone touching the keyboard.

Automation that calls Claude from a hook chain needs anti-loop guards, and they are worth internalizing even if you copy nothing else: the headless runs set a marker environment variable so the Stop hook ignores their own turns (otherwise each sync spawns registrations that spawn syncs); a stamp file records what state was already synced so the same idle session is never processed twice; a lock prevents overlapping runs; and caps bound the damage (at most two syncs per pass, hard timeout each). Any hook that can trigger the thing that triggered it must carry this kind of guard.

Operational notes. Hooks load at session start: sessions already open when you edit settings.json do not gain the new hook until relaunched. Keep hooks fast and non-blocking: a slow SessionStart hook delays every session you will ever open (the /doctor checkup flags slow hooks for exactly this reason). Log failures somewhere visible instead of failing loudly: the author's scripts append a line to an alerts note in the vault, which surfaces in Obsidian where a human actually looks. And treat hooks as code: they run unattended with your permissions, so version them alongside the vault.

Key points
  • Hooks in settings.json run shell commands on lifecycle events (~30 events by mid-2026); SessionStart pull + SessionEnd push automate the vault protocol
  • No native idle event: emulate with a Stop hook that registers activity plus a 15-minute scheduled task that syncs sessions idle 30+ minutes via headless claude -p --resume
  • Self-triggering automation needs anti-loop guards: marker env var, already-synced stamps, a lock, and hard caps
  • Hooks load at session start (relaunch to apply), must stay fast and non-blocking, and deserve versioning like code

Skills: install ECC and superpowers, curate hard

Sixth component: the capabilities. Skills are folders of instructions (a SKILL.md plus optional scripts) that teach Claude a workflow, and the ecosystem around them has matured into real collections you can install in minutes. Two are worth installing on day one of a structured setup, and one discipline keeps them from backfiring.

ECC (everything-claude-code) is the largest curated collection, by Affaan Mustafa, MIT-licensed. Note the repository was renamed in 2026: the canonical address is now github.com/affaan-m/ECC (the old everything-claude-code URL redirects). As of July 2026 it bundles 278 skills, 67 agents, 34 rules and a set of hook automations, covering agent orchestration, frontend patterns, testing, git workflows, security scanning and much more. Install it as a plugin:

/plugin marketplace add https://github.com/affaan-m/ECC
/plugin install ecc@ecc

superpowers, by Jesse Vincent, is the other keystone: not a pile of capabilities but a process discipline. It installs workflow skills that force good engineering habits: brainstorming before building, systematic debugging before patching, test-driven development, verification before claiming completion. It lives in the official Anthropic plugin marketplace, so installation is a single command, no marketplace add needed:

/plugin install superpowers@claude-plugins-official

Its core rule is worth adopting verbatim: if a skill might apply to the task at hand, invoke it before acting. Skills you have but never invoke are dead weight.

Now the discipline: curate, do not hoard. It is tempting to install all 278 ECC skills. Resist. Every installed skill's name and description participates in skill matching; hundreds of irrelevant ones pollute that matching and burden the context. When the author of this course integrated ECC, he kept 67 skills out of the 271 the repo had then: the agent-orchestration, frontend, engineering, QA and content categories that matched his real stack, and deliberately skipped whole categories (crypto trading, HIPAA healthcare, five backend stacks he never touches). Install what maps to work you actually do; you can always add a skill the day you need it. The /doctor checkup now even flags unused skills as context cost, which tells you how real the problem is.

Third-party skills from outside big-name sources deserve one more gate: an audit before installation. A skill runs with the full permissions of your agent. The vetting protocol, covered in depth in the safety module's lesson on auditing third-party skills: clone into a quarantine folder without executing anything, read every script, grep for dangerous patterns (eval and exec calls, network calls, base64 blobs, destructive commands, prompt-injection phrasing like "ignore previous instructions"), then copy only the audited folder into ~/.claude/skills/, never a whole unaudited bundle. Discovery beyond the marketplaces: the find-skills skill searches the open ecosystem, and directories like skills.sh rank skills by real installs.

After installing, restart the session (or run /reload-plugins) and test-drive one skill end to end: ask for a task the skill covers and confirm Claude announces it is using it. If it does not trigger, the usual cause is a description mismatch: the skill's description does not contain the words you naturally use. That is fixable (edit the description), and knowing to check it puts you ahead of most users.

Key points
  • ECC (github.com/affaan-m/ECC, renamed from everything-claude-code): 278 skills, install via /plugin marketplace add + /plugin install ecc@ecc
  • superpowers (official marketplace): process discipline skills; its meta-rule: if a skill might apply, invoke it before acting
  • Curate hard: install the subset matching your real stack (the author kept 67 of 271), because every skill's description participates in matching and costs context
  • Third-party skills run with full agent permissions: quarantine-clone, read, grep for dangerous patterns, install only the audited folder

The heartbeat: scheduled tasks, nightly dreaming, statusline

Seventh component: the heartbeat. Hooks react to sessions; scheduled tasks act when no session is running. This layer is what makes the structure self-maintaining: consolidation, refresh and audits happen nightly and weekly whether or not you showed up that day. On Windows the scheduler is Task Scheduler (schtasks or PowerShell's ScheduledTasks module); on macOS and Linux, cron or launchd. Each task is a small script plus a schedule.

The rhythm on the author's setup, as a template:

One convention ties the layer together: alerts land in the vault. Every task appends failures and findings to a single alerts note at the vault root. Logs live next to the scripts for forensics, but the note is what a human sees, because it shows up in Obsidian where you already look. Automation you never hear from is automation you cannot trust; automation that emails you is automation you learn to ignore. A note in the brain is the middle path.

Finishing touch, the statusline: Claude Code renders a custom status bar by piping session JSON (model, context usage, cost, rate-limit state) into a command you configure under statusLine in settings.json. A small script turns that into a live dashboard: context percentage, quota bars, cost of the session. One documented trap from the author's machine: refreshInterval is in milliseconds. Set to 1, it spawned a fresh interpreter process roughly 28 times per second and visibly froze the terminal; 1000 (one tick per second) is a sane value. When your terminal stutters mysteriously, check that number first.

With the heartbeat installed, step back and look at what you built across this module: rules that load themselves, memory that writes itself, sync that happens without you, skills that fire on their own triggers, and maintenance that runs while you sleep. The last lesson compresses it all into a checklist you can rerun on any new machine.

Key points
  • Scheduled tasks make the structure self-maintaining: daily conversation export (with secret redaction) and graph refresh, nightly headless dream consolidation, 15-minute idle-sync, weekly vault lint
  • The dream consolidates with two built-in safeties: dated backup before each run, and archive-never-delete for contradicted notes
  • All automation reports to one alerts note at the vault root: visible in Obsidian, unlike logs and unlike email
  • statusLine turns session JSON into a live dashboard; refreshInterval is in MILLISECONDS, and a too-small value can freeze the terminal

The one-hour checklist

Everything in this module, compressed into the runbook you can replay on any new machine. Times are honest estimates for someone doing it the second time; first time, double them and enjoy the scenery.

Phase 1: engine (10 min)

Phase 2: constitution (10 min)

Phase 3: memory and Obsidian (10 min)

Phase 4: git transport (10 min)

Phase 5: hooks (10 min)

Phase 6: skills (10 min)

Phase 7: heartbeat (10 min, plus overnight to verify)

The verification mindset matters more than the list: every phase ends with a proof, not a feeling. A fresh session that recites rules, a note recalled unprompted, a hook that demonstrably fired, a skill that triggered unnamed. If you cannot show the proof, the phase is not done, whatever the config files say.

Where to go from here: the extending module for MCP servers and writing your own skills, the second brain module for recall mechanics and the pocket setup on Android, the orchestration module when one Claude stops being enough, and the safety module before your hooks and skills multiply. The structure you just built is the foundation all of those stand on. Maintain it with the one habit that outranks every tool in this course: when you learn something durable, write it into the brain before you close the session.

Key points
  • Seven phases, each ending with a PROOF: rules recited, note recalled, hook fired, skill triggered, dream ran overnight
  • Order matters: engine, constitution, memory, git, hooks, skills, heartbeat; each phase assumes the previous
  • If you cannot demonstrate the proof, the phase is not done, whatever the config says
  • The habit that outranks every tool: write durable lessons into the brain before closing the session
Work with me

Need this level of execution on your project?

I am Pierre Bottazzi. I built this entire course solo, end to end: 237 lessons in 3 languages, the app, the design, the SEO, the accounts system. That is what I do for clients too: web apps, mobile apps, AI automation, SEO/GEO. First call is free, no strings attached.

Contact me on LinkedInSee sept-tools.com (industry)See totemsauvage.com (art gallery)
Inspiration

Inspired by 0xloucash

One of my inspirations. Loucash (0xloucash) has a gift for always digging up the sharpest AI tips and tricks, then turning them into setups that actually work. With InstallClaw he configures your own OpenClaw AI agent, at your place, in 48 hours.

His InstagramInstallClaw