# Overclaud Learn > Practical guides to Claude Code (Anthropic's CLI): skills, hooks, memory and agent workflows, by Taner Hassan. Overclaud also sells a ready-made Claude Code harness ($69 one-time). ## Guides - [Claude Code git worktrees: run parallel sessions without collisions](https://overclaud.dev/learn/claude-code-git-worktrees/): Start each session with claude --worktree . Claude Code creates a separate checkout under .claude/worktrees// on its own branch, so parallel sessions edit different copies of the files and only meet when you merge their branches. - [Claude Code headless mode: run claude -p from scripts and cron](https://overclaud.dev/learn/claude-code-headless-mode/): Add -p to any claude command and it runs once, prints the answer and exits. Add --output-format json for a result object with session ID and cost, or --json-schema to get validated data in structured_output. Nobody can approve prompts in a script, so allow the tools the job needs with --allowedTools or --permission-mode. - [Claude Code plan mode: how to turn it on and when it's worth it](https://overclaud.dev/learn/claude-code-plan-mode/): Plan mode is a permission mode in which Claude reads your code and writes a plan but can't edit files until you approve it. Turn it on with Shift+Tab, a /plan prompt, or claude --permission-mode plan. Use it for changes that touch several files or that are hard to undo, and skip it for small, obvious fixes. - [Claude Code MCP servers: how to add one and which scope to pick](https://overclaud.dev/learn/claude-code-mcp-servers/): Run claude mcp add with --transport http for a remote server, or put the server's start command after -- for a local one. Local scope is the default and keeps the server private to one project. Use --scope project to share it through a committed .mcp.json, or --scope user to have it in every project. - [Claude Code permissions: stop the prompts without giving up control](https://overclaud.dev/learn/claude-code-permissions/): Pre-approve the commands you trust with allow rules, force a prompt for risky ones with ask rules, and block the rest with deny rules, all under "permissions" in a settings file. Deny beats ask, and ask beats allow. For fewer prompts overall, use auto mode, and keep bypassPermissions for isolated containers and VMs. - [Claude Code subagents: when to hand work to a fresh context](https://overclaud.dev/learn/claude-code-subagents/): A subagent is a separate Claude instance with its own context window, system prompt and tool list. Claude hands it a task, it works alone and sends back a summary. Use one when a job would flood your conversation with output you won't read again, or when you want a worker with restricted tools. - [Claude Code hooks: guardrails that run every single time](https://overclaud.dev/learn/claude-code-hooks/): Hooks are shell commands that Claude Code runs at set points, such as before or after a tool call. They're configured in settings.json, receive the event as JSON on stdin, and exiting with code 2 blocks the action and tells Claude why. Unlike instructions in CLAUDE.md, they run every time. - [Claude Code skills: what they are and how to write your first one](https://overclaud.dev/learn/claude-code-skills/): A skill is a folder containing a SKILL.md file. Claude Code reads every skill's short description on each turn and loads the full instructions only when a task matches, or when you run it yourself as /skill-name. Put personal skills in ~/.claude/skills/ and project skills in .claude/skills/. - [Give Claude Code a memory that lasts between sessions](https://overclaud.dev/learn/claude-code-memory/): Claude Code starts each session fresh, apart from what it loads from memory files. CLAUDE.md files (user, project and local) are read at the start of every session, can import other files with @path, and can be split into path-scoped rules. Auto memory adds notes Claude writes itself, indexed in a MEMORY.md file. ## Cheat sheet ### Hooks Commands Claude Code runs at fixed moments. Configured under "hooks" in settings.json. Source: https://code.claude.com/docs/en/hooks Events you'll use most: - `SessionStart`: A session starts or resumes - `UserPromptSubmit`: You send a prompt, before Claude reads it - `PreToolUse`: Before a tool runs. Can block it or change its input - `PostToolUse`: After a tool succeeds - `PostToolUseFailure`: After a tool fails - `PermissionRequest`: A tool needs a permission decision - `Notification`: Claude Code sends a notification - `Stop`: Claude finishes responding - `SubagentStop`: A subagent finishes - `PreCompact`: Before the conversation is compacted - `InstructionsLoaded`: A CLAUDE.md or rules file is loaded - `SessionEnd`: The session ends Exit codes: - `0`: Carry on. Valid JSON on stdout is read as instructions - `2`: Block the action. stderr is sent back as the reason - `Any other`: Non-blocking error. The action continues with a notice Where hooks live: - `~/.claude/settings.json`: You, every project - `.claude/settings.json`: The project, shared in git - `.claude/settings.local.json`: You, this project only ### Memory Files Claude Code loads at the start of every session, broadest first. Source: https://code.claude.com/docs/en/memory Memory files: - `~/.claude/CLAUDE.md`: Your preferences in every project - `./CLAUDE.md or ./.claude/CLAUDE.md`: The project, shared with the team - `./CLAUDE.local.md`: Private notes for this project - `/CLAUDE.md`: Loads when Claude works in that folder - `.claude/rules/*.md`: Split rules; add paths: to scope them to files - `~/.claude/projects//memory/MEMORY.md`: Auto memory index: first 200 lines load each session Syntax: - `@path/to/file.md`: Imports another file, up to 4 levels deep - ``@path` in backticks`: Mentions a path without importing it - `paths: src/**/*.ts`: In a rule's frontmatter: only load for matching files ### Skills A folder with a SKILL.md. Descriptions load every turn; the body loads when used. Source: https://code.claude.com/docs/en/skills Where skills live: - `~/.claude/skills//SKILL.md`: You, every project - `.claude/skills//SKILL.md`: Everyone in this repository - `/skills//SKILL.md`: Run as /plugin-name:skill-name Frontmatter: - `description`: What it does and when to use it. Claude matches on this - `name`: Optional. Defaults to the folder name - `when_to_use`: Optional extra trigger guidance - `disable-model-invocation`: true: only you can start it, with /name - `allowed-tools`: Tools it may use without asking, while it runs - `arguments`: Named arguments for use in the body - `paths`: Globs that limit when it can activate Inside a skill: - `$ARGUMENTS`: Everything typed after /name - `$0, $1 …`: Positional arguments - `${CLAUDE_SKILL_DIR}`: The skill's own folder, for bundled files - `!`command``: Runs a shell command first and inserts its output ### Commands Built-in slash commands worth knowing by heart. Source: https://code.claude.com/docs Slash commands: - `/init`: Writes a starting CLAUDE.md from your code - `/memory`: Opens memory files; turns auto memory on or off - `/context`: Shows what's loaded into context, including memory files - `/compact`: Summarises the conversation to free up context - `/clear`: Starts a fresh conversation - `/`: Runs a skill by hand, with optional arguments