How to use Claude Code
Last updated: June 2026
Claude Code is a terminal-based AI coding agent made by Anthropic. You run it in your project directory, and it reads your code, runs commands, and makes changes based on your instructions. That's the short version.
The longer version is that getting value out of it depends heavily on how you configure it. Out of the box, it works. With proper setup, it works a lot better.
Install it
npm install -g @anthropic-ai/claude-codeYou'll need Node.js 18+ and an Anthropic API key. If you're on a Mac, make sure your terminal has Full Disk Access enabled in System Settings, or Claude Code won't be able to read certain files.
Run it in your project
cd your-project && claudeClaude Code starts a conversation in your terminal. It can read your files, run shell commands, search your codebase, and make edits. You talk to it like you'd talk to a junior developer who's fast but needs clear instructions.
Set up agents.md
This is where most people leave value on the table. An agents.md (or CLAUDE.md) file in your project root tells Claude Code how to behave in every session. It's like a README for your AI agent.
Put your project's coding standards here. Commit message format. Which testing framework you use. Whether you prefer functional or class-based components. Anything that's true for every session belongs in agents.md.
Not sure what goes in agents.md vs a skill file? Use ClaudeOrNot to find out.
Add skill files for specific workflows
Skill files are loaded on demand. You create them for specific tasks: debugging memory leaks, writing database migrations, running security audits. Claude Code pulls in the relevant skill when you ask for that task.
The advantage is context. Your agents.md doesn't balloon with instructions for every possible task. Claude Code loads what it needs, when it needs it.
Common mistakes
- •Putting everything in agents.md. It's tempting to dump your whole style guide there. Don't. Claude Code reads this every session, and more tokens = more cost + slower responses. Keep it lean.
- •Not writing tests first. If you tell Claude Code "add feature X" without tests, it'll write code that looks right. Then you'll spend an hour debugging edge cases it missed.
- •Trusting it with production credentials. It will write them into your code if you let it.
What Claude Code is actually good at
Boilerplate. Test scaffolding. Refactoring mechanical stuff. Writing docs from code. Converting between formats. Anything where the pattern is clear and the risk of subtle bugs is low.
It's less reliable for architecture decisions, security-sensitive code, and anything where "it compiles" doesn't mean "it's correct." You still need to read what it writes.
Figure out where your instructions go
Should your agent behavior be in agents.md or a skill file? Describe it and get an instant answer.
Try ClaudeOrNot →