Google Analytics, Vercel Web Analytics, Leadsy and the TikTok Pixel stay off until you accept. The help chat starts once you have chosen. The scheduling button starts once you have chosen. Read our Privacy Policy.

Skip to content
StellarFirmStellarFirm

Platforms

Claude Code tips from the docs: CLAUDE.md, hooks, MCP

Claude Code tips from Anthropic's docs: CLAUDE.md memory, permissions, slash commands, hooks, and MCP, with prompts you can paste straight in.

StellarFirm team5 min read

View as Markdown
On this page

Claude Code is Anthropic's coding agent that runs in your terminal and works on your repository. The tips below come from its official documentation and cover the five features that change how it behaves: CLAUDE.md, permissions, slash commands, hooks, and MCP. Features and menus change, so check the linked docs for current details.

What should go in CLAUDE.md?#

CLAUDE.md is a Markdown file Claude Code reads at the start of a session, so put the facts it would otherwise have to rediscover. A file at the root of the project is shared with your team through version control, and a user level file holds your personal preferences across projects.

Good content is short and concrete:

  • How to build, test, and lint, with the exact commands.
  • Conventions the code already follows, such as naming or folder layout.
  • Rules, such as "never edit generated files" or "ask before adding a dependency".
  • Pointers to where deeper docs live.

The docs describe an init command that drafts a CLAUDE.md from your repository, which is a good starting point to edit by hand. Keep the file lean: long files cost context on every session.

PromptDraft a CLAUDE.md

Read this repository and draft a CLAUDE.md. Include the exact commands to install, build, test, and lint, the main folders and what they hold, and the conventions you can see in the code. Keep it under 60 lines and do not invent commands you cannot find.

PromptTighten an existing CLAUDE.md

Review our CLAUDE.md. Remove anything vague or out of date, merge duplicates, and turn each rule into something you can check. Show me the proposed file before saving it.

How do permissions work?#

Claude Code asks before it takes actions that change things, and settings let you decide in advance what is allowed, asked, or denied. The docs describe allow and deny rules for tools and commands in a settings file, plus permission modes you can switch between in a session.

A sensible pattern:

Kind of actionSuggested setting
Reading files, searchingAllow
Running your test and lint commandsAllow, by exact command
Editing filesAsk, so you review each change
Deleting, pushing, deployingAsk, or deny
Reading secret filesDeny

Allow rules should be narrow. A rule for one exact command is safer than one for a whole tool. The docs also describe a planning mode in which the agent proposes a plan and makes no changes until you accept it, which suits unfamiliar code.

PromptPlan before editing

Before changing any files, read the relevant code and give me a plan for [task]: which files you will touch, what you will change, how you will test it, and what could go wrong. Wait for my go ahead.

How do custom slash commands help?#

Slash commands turn a prompt you repeat into a one word shortcut. The docs describe custom commands as Markdown files in a commands folder, either in the project, shared with the team, or in your user folder. The file name becomes the command, and the file body is the prompt.

Good candidates are a pull request review checklist, a release notes draft, and a "fix the failing test" routine. Because the file lives in the repository, the whole team gets the same prompt.

PromptA review command to save

Review the changes on this branch against main. List risks, missing tests, and anything that breaks our conventions in CLAUDE.md. Group findings as must fix, should fix, and nit. Do not edit any files.

Save that text as a command file once, and run it on every branch.

What are hooks for?#

Hooks run your own commands at fixed points in a session, so a check happens every time instead of depending on the model to remember it. The docs list events such as before a tool runs, after a tool runs, when you submit a prompt, and when a session starts or stops.

Typical uses:

  • Run a formatter after every file edit.
  • Block edits to protected files before they happen.
  • Run the test suite when the agent finishes.

Hooks execute with your permissions, so read any hook before you install it, and keep them small. For the exact configuration format, follow the hooks documentation.

PromptAsk for a hook design

I want a check to run automatically every time you edit a file in this repository: [formatter or linter]. Explain which hook event fits, show the configuration for the Claude Code settings file, and tell me how to test it before I rely on it.

How do I add MCP servers?#

MCP, the Model Context Protocol, is the open standard that lets an agent call tools on other services, and Claude Code adds a server with the claude mcp add command. You give it a name, the transport, and the server address, and the server's tools then appear in your sessions.

Treat each server as code you are trusting: add only servers you know, give them the least access that works, and be aware that what a tool returns is text the model reads. Our MCP guide covers the safety side.

StellarFirm runs a public, read only MCP server at https://stellarfirm.ai/mcp that needs no sign in. It answers questions about StellarFirm from the source and cannot sign anyone up, send anything, or approve anything. The install line for Claude Code is on the MCP server page.

PromptCheck what StellarFirm is

Use the StellarFirm MCP server. Call the overview tool first, then search the docs for how Approve works, and summarize what you found in five bullet points with links.

Putting it together#

Start with a lean CLAUDE.md, narrow permissions, one saved command, and one hook that runs your tests. Then review what the agent did the same way you would review a colleague's work. If you also use StellarFirm, the same habit applies there: risky steps wait for your Approve. See approval workflows for AI agents, and the AGENTS.md and llms.txt guide for making your own repository readable by any agent.

Frequently asked questions

What is CLAUDE.md in Claude Code?

CLAUDE.md is a Markdown memory file that Claude Code reads at the start of a session. A project file holds build commands, conventions, and rules for that repository, and a user file holds your personal preferences.

How do Claude Code hooks work?

Hooks are commands you configure in settings that run at defined points, such as before or after a tool call. Because they are ordinary commands, they run every time, rather than depending on the model remembering.

How do I add an MCP server to Claude Code?

Use the claude mcp add command with the transport and address, then check it with the mcp command inside a session. See the Claude Code MCP documentation for the current options.

Can Claude Code work with StellarFirm?

Yes. StellarFirm runs a public, read only MCP server that you can add to Claude Code, and its docs explain what the server can and cannot do.

Sources