# Introduction
Most individuals’s Claude Code setup by no means will get previous day one. They run the installer, log in, kind a immediate, get one thing helpful again, and by no means contact a config file once more. Weeks later, classes begin dropping monitor of earlier choices, the identical permission immediate reveals up fifty occasions a day, and each lengthy job ends the identical method: a wall of context warnings and a dialog that needs to be deserted and restarted from scratch.
None of that may be a limitation of the mannequin. It is a limitation of the setup. Claude Code ships with smart defaults, however smart defaults and excessive efficiency are completely different bars, and the hole between them is sort of solely made up of a handful of information most inexperienced persons by no means open. This information closes that hole. It walks by means of the precise configuration, permissions, hooks, and command habits that separate a contemporary set up from a setup that holds up underneath actual, sustained agentic work, verified in opposition to Anthropic’s present documentation somewhat than assumed from an older model of the software.
# Putting in Claude Code the Proper Approach
Claude Code installs as a standalone command-line interface (CLI), and the present really useful path is the native installer somewhat than npm, although npm nonetheless works as a fallback:
# macOS, Linux, or WSL
curl -fsSL https://claude.ai/set up.sh | bash
# Home windows PowerShell
irm https://claude.ai/set up.ps1 | iex
# Or, through npm, if you happen to'd somewhat handle it together with your current Node toolchain
npm set up -g @anthropic-ai/claude-code
As soon as put in, cd into an precise mission listing earlier than working claude for the primary time. This issues greater than it sounds prefer it ought to: Claude Code scopes its mission reminiscence and settings to the listing you launch it from, so beginning it from your property folder or your desktop means it by no means picks up the correct context for something you are engaged on.
cd your-project-directory
claude
The primary run walks you thru authentication — both OAuth login with a Claude subscription (Professional, Max, or Crew) or an software programming interface (API) key tied to a Console account. Past the terminal, Claude Code can also be accessible by means of a VS Code extension, a JetBrains plugin, a desktop app, and a web-based model at claude.ai for classes you wish to choose up from a browser somewhat than a terminal. All of them learn from the identical underlying settings and mission information, so nothing you arrange within the terminal is wasted if you happen to later change to an built-in growth setting (IDE) panel.
With that achieved, the set up itself is the straightforward half. What truly determines whether or not Claude Code performs properly from right here is the set of three information most tutorials skip previous.
# The Three Recordsdata That Truly Run the Present
Claude Code reads configuration from two locations: your mission’s .claude/ listing (and a CLAUDE.md on the mission root), and a world ~/.claude/ listing that applies throughout each mission in your machine. Understanding what lives the place is the only largest lever on whether or not the software performs properly or drifts, in line with Anthropic’s personal documentation on the .claude listing construction.
- CLAUDE.md is mission reminiscence — directions Claude reads at the beginning of each session in that repository: structure notes, construct and take a look at instructions, code model guidelines, and anything that may in any other case want re-explaining each single time. Run
/initin a contemporary mission, and Claude Code will scan the codebase and generate a beginningCLAUDE.mdfor you, which you then refine with/reminiscence. Hold it lean. Anthropic’s steerage is to deal with it as a dwelling reference underneath roughly 2,500 tokens, and to push something lengthy or path-specific into.claude/guidelines/*.mdinformation as a substitute, which could be scoped to load solely when Claude touches matching information. - settings.json, dwelling at
.claude/settings.jsonfor project-level config or~/.claude/settings.jsonfor private defaults, is the place permissions, hooks, setting variables, and mannequin defaults truly dwell. That is the file most inexperienced persons by no means open, and it is immediately liable for two of the most typical complaints concerning the software: fixed permission interruptions and Claude reaching for a costlier mannequin than a job truly wants. - Auto reminiscence is the newer, quieter layer: Claude can write and browse its personal working notes throughout a session with out you managing a file immediately, toggled with the
autoMemoryEnabledsetting or theCLAUDE_CODE_DISABLE_AUTO_MEMORYsetting variable if you happen to’d somewhat hold reminiscence absolutely handbook and auditable by means ofCLAUDE.mdalone.
The sensible rule that ties these collectively, echoed throughout Anthropic’s documentation and impartial breakdowns of the config system alike, is that this: secure guidelines belong in CLAUDE.md, as a result of directions buried solely in dialog historical past get misplaced the second an extended session triggers automated compaction. If a rule must survive previous as we speak’s session, write it down.
# Setting Up Permissions and Hooks Earlier than Wanted
Claude Code runs in considered one of three permission modes, cycled with Shift+Tab:
- Default, which asks earlier than each doubtlessly dangerous software name.
- Auto-Settle for Edits, which lets file edits by means of with out prompting whereas nonetheless gating different instruments.
- Plan Mode, which is read-only — no edits, no shell instructions — till you approve a plan. Plan Mode is value defaulting to in your first classes in an unfamiliar codebase, because it forces Claude to suggest earlier than it acts.
Past the interactive modes, settings.json permits you to write precise permission guidelines, so you are not manually approving the identical protected command fifty occasions a session:
{
"permissions": {
"permit": [
"Bash(npm test:*)",
"Bash(npm run lint:*)",
"Read(**)"
],
"ask": [
"Bash(git push:*)"
],
"deny": [
"Bash(rm -rf /*)",
"Bash(sudo:*)",
"Read(.env)"
]
}
}
What this does: something matching permit runs with out a immediate, something matching deny is blocked outright no matter what else matches, and something left unlisted falls again to asking you immediately. That deny-first ordering issues: a deny rule at all times wins even when a broader permit rule would in any other case cowl it, which is what makes it protected to grant pretty broad learn and test-running entry with out additionally opening the door to harmful instructions.
Hooks go a step additional than permission guidelines, since a rule can solely permit or block a name, whereas a hook can truly run one thing in response to 1. A PostToolUse hook that auto-formats each file Claude edits is likely one of the mostly really useful beginning factors:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "npx prettier --write "$CLAUDE_TOOL_INPUT_FILE_PATH""
}
]
}
]
}
}
What this does: each time Claude writes or edits a file, this hook fires afterward and runs Prettier in opposition to precisely the file that modified, utilizing the trail Claude Code passes in by means of the $CLAUDE_TOOL_INPUT_FILE_PATH setting variable. You cease manually reformatting after each edit, and your model guidelines apply persistently whether or not Claude wrote the file otherwise you did.
A PreToolUse hook can go additional and really block a harmful command earlier than it runs, which is a stronger assure than a permission rule alone since it could possibly examine the precise command textual content somewhat than simply matching a sample:
#!/usr/bin/env python3
# .claude/hooks/block-dangerous-bash.py
import json, re, sys
DANGEROUS_PATTERNS = [
r'brms+.*-[a-z]*r[a-z]*f',
r'sudos+rm',
r'chmods+777',
r'gits+pushs+--force.*primary',
]
input_data = json.load(sys.stdin)
if input_data.get('tool_name') == 'Bash':
command = input_data.get('tool_input', {}).get('command', '')
for sample in DANGEROUS_PATTERNS:
if re.search(sample, command, re.IGNORECASE):
print("BLOCKED: matches a harmful command sample", file=sys.stderr)
sys.exit(2)
sys.exit(0)
What this does: Claude Code pipes the software name’s particulars to this script as JSON on stdin earlier than the command runs. If the bash software is about to execute one thing matching a recursive force-delete, a sudo rm, a world-writable chmod, or a compelled push to primary, the script prints a motive and exits with code 2, which Claude Code’s hook system treats as a tough block — stopping the command earlier than it ever runs. Register it in settings.json underneath PreToolUse with a Bash matcher, and this turns into a everlasting security internet somewhat than one thing it’s a must to keep in mind to verify for manually.
# The Instructions Price Studying First
Claude Code ships with greater than sixty built-in instructions as of this writing, and making an attempt to memorize all of them on day one is a waste of time. The desk beneath covers those that really change how a session performs, organized by what they’re for, pulled immediately from Claude Code’s official command reference.
| Command | Class | What It Does |
|---|---|---|
| /init | Setup | Scans your codebase and generates a beginning CLAUDE.md |
| /reminiscence | Setup | Opens CLAUDE.md for modifying immediately |
| /clear | Context | Begins a contemporary dialog whereas conserving mission reminiscence |
| /compact [focus] | Context | Summarizes dialog historical past to unencumber context; accepts directions on what to protect |
| /context | Context | Reveals present context window utilization |
| /plan | Planning | Toggles Plan Mode; Claude proposes earlier than it acts, nothing executes till you approve |
| /diff | Evaluate | Opens an interactive diff of each change made this session |
| /code-review [–fix] | Evaluate | Checks the present diff for correctness bugs; --fix applies the findings |
| /security-review | Evaluate | Checks the present diff particularly for safety vulnerabilities |
| /evaluate | Evaluate | Provides a read-only evaluate of a GitHub pull request |
| /resume [session] | Navigation | Resumes a earlier dialog by identify or ID |
| /department [name] (alias /fork) | Navigation | Forks the present dialog into a brand new session |
| /rewind | Navigation | Rolls code and/or dialog again to an earlier checkpoint |
| /mannequin | Value & Efficiency | Switches the energetic mannequin mid-session with out dropping context |
| /effort | Value & Efficiency | Units reasoning depth (low by means of max) to match job complexity |
| /value | Value & Efficiency | Reveals token utilization and spend for API-key customers |
| /brokers | Delegation | Manages subagents — view, create, or invoke specialised brokers |
| /permissions | Configuration | Manages permission guidelines interactively |
| /hooks | Configuration | Manages hooks interactively |
| /physician | Diagnostics | Checks your set up for configuration issues |
A helpful behavior for a newbie: construct fluency with /compact, /plan, and /diff first, since these three alone resolve nearly all of early frustration — classes that degrade from context bloat, edits that go additional than supposed, and never realizing precisely what modified. Every part else within the desk earns its place as soon as these three are muscle reminiscence.
# Constructing Your Personal /fact Command
This is a good word earlier than this part: /fact is not a command that ships with Claude Code. It would not seem within the official command reference, and it isn’t one thing I might verify throughout any present documentation or neighborhood information whereas researching this text. What’s genuinely helpful, although — and sure what prompted the thought — is a command that makes Claude verify its personal latest claims in opposition to the precise codebase earlier than you belief them and transfer on. That is an actual hole value closing, and it is an ideal instance of Claude Code’s customized command system, so this is the best way to construct it your self.
Customized instructions are outlined as abilities — a folder with a SKILL.md file. Create one at .claude/abilities/fact/SKILL.md:
---
description: Confirm Claude's most up-to-date claims and edits in opposition to the precise codebase
allowed-tools: Learn, Grep, Glob, Bash(git diff:*)
---
Re-examine the whole lot you simply informed me on this dialog in opposition to what
truly exists within the codebase proper now. Particularly:
1. For each file you declare to have edited, learn it once more and ensure the
change is definitely current and matches what you described.
2. For each declare about current code (a perform's conduct, a config
worth, an import, a dependency model), confirm it in opposition to the actual
file somewhat than your reminiscence of studying it earlier within the session.
3. Run `git diff` and examine the precise diff in opposition to what you described
altering.
4. Report again plainly: which claims checked out, which did not, and
precisely what the discrepancy was for something that failed. Don't
soften or hedge a discrepancy you discover, state it immediately.
What this does: the YAML frontmatter restricts this command to read-only instruments plus a scoped git diff, so working /fact can by no means itself modify something — which issues since a verification step that may additionally make adjustments is not a reliable verification step. The instruction physique is intentionally particular about what “confirm” means: re-reading precise information somewhat than trusting the mannequin’s personal prior description of them, and explicitly telling Claude to not soften a discrepancy if it finds one, since a self-check that is incentivized to sound reassuring is not truly checking something.
As soon as the file is saved, /fact turns into accessible in any session in that mission — the identical method some other customized command works — and it reveals up if you happen to kind / and begin filtering. Run it after Claude finishes a multi-step job, particularly one the place it touched a number of information or made claims about current code it hadn’t re-read lately, and earlier than you commit something primarily based on these claims. This is similar grounding precept behind self-correcting brokers usually: a verify is just value one thing if it is compelled to have a look at one thing outdoors its personal prior output, and pointing /fact on the precise information and the precise git diff is what makes it greater than a mannequin agreeing with itself.
# Utilizing Subagents and Parallel Work for Actual Pace Positive aspects
Every part to this point makes a single Claude Code session extra dependable. Subagents are what make it quicker on the sort of work that does not must occur sequentially. A subagent is a specialised occasion with its personal context window, its personal system immediate, and its personal software permissions, and Anthropic’s subagent documentation describes them as working remoted from the principle session, returning a abstract somewhat than dragging each intermediate file learn and power name again into your major dialog.
That isolation is the precise efficiency win. Giant codebase exploration, dependency audits, and test-writing are all verbose work that may in any other case eat closely into your primary session’s context finances. Delegate them to a subagent as a substitute, and solely the completed end result comes again.
# Inside a session, ask Claude to create a subagent
/brokers
Operating /brokers opens an interactive menu for creating, viewing, and managing subagents, or you’ll be able to outline one immediately as a file at .claude/brokers/ with its personal frontmatter for mannequin choice and power entry, comparable in construction to the ability file above. A typical beginning sample is a narrowly scoped code-reviewer or test-runner subagent with read-only entry, so it could possibly examine and report with out ever with the ability to make the change it is reviewing — the identical separation-of-concerns thought coated within the hooks part above, simply utilized to delegation as a substitute of permissions.

For genuinely parallel work — modifying a number of unrelated components of a codebase without delay with out one change blocking one other — /batch and --worktree classes let a number of Claude Code cases work in remoted git worktrees concurrently, every with its personal working listing to allow them to’t step on one another’s adjustments. That is a extra superior sample than a newbie setup strictly wants on day one, but it surely’s value realizing it exists as soon as single-session work stops being the bottleneck.
# A Starter CLAUDE.md and settings.json You Can Truly Use
Pulling the whole lot above collectively, this is an inexpensive start line for a brand new mission. Save this as CLAUDE.md at your mission root:
# Mission Context
## Stack
- [Your language/framework here, e.g. Node.js, TypeScript, React]
## Instructions
- Check: `npm take a look at`
- Lint: `npm run lint`
- Dev server: `npm run dev`
## Conventions
- [Your code style rules, naming conventions, folder structure]
## Earlier than ending any job
- Run the take a look at suite and ensure it passes
- Run `/fact` if the duty concerned modifying multiple file
And a beginning .claude/settings.json:
{
"permissions": {
"permit": ["Bash(npm test:*)", "Bash(npm run lint:*)", "Read(**)"],
"ask": ["Bash(git push:*)"],
"deny": ["Bash(rm -rf /*)", "Bash(sudo:*)", "Read(.env)"]
},
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{ "type": "command", "command": "python3 .claude/hooks/block-dangerous-bash.py" }]
}
],
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [{ "type": "command", "command": "npx prettier --write "$CLAUDE_TOOL_INPUT_FILE_PATH"" }]
}
]
}
}
That is the complete basis from this text in two information: smart permissions that do not interrupt protected, repeated instructions, a tough block on the genuinely harmful ones, automated formatting on each edit, and a mission reminiscence file that factors Claude at your precise take a look at and lint instructions as a substitute of guessing at them. Commit each to your repository (leaving something containing secrets and techniques out, and utilizing .claude/settings.native.json for private overrides that should not be shared), and each teammate who clones the mission begins from the identical high-performance baseline as a substitute of rebuilding it from scratch.
# Wrapping Up
The distinction between a newbie’s Claude Code setup and a high-performance one is not a secret function or a hidden command; it is whether or not you spent twenty minutes on CLAUDE.md, settings.json, and one or two hooks earlier than diving into actual work, or whether or not you are still working on regardless of the installer gave you by default three weeks in. Every part on this information — the reminiscence information, the permission guidelines, the hooks, the instructions value studying first — exists to take away friction you’d in any other case hit repeatedly and by no means repair. Set it up as soon as, commit it to the repository, and each session after that begins from a stronger baseline than the one earlier than it.
Shittu Olumide is a software program engineer and technical author keen about leveraging cutting-edge applied sciences to craft compelling narratives, with a eager eye for element and a knack for simplifying advanced ideas. You can even discover Shittu on Twitter.
