Tools and Commands
The tools that sit alongside Claude Code — editor integrations, MCP servers for files, GitHub, browsers, databases and Slack, and a full Git workflow.
Chapter 2 | Tools to use alongside Claude Code Written for: developers who want to use Claude Code professionally — every level
Editor Integration — connecting to a code editor
Claude Code runs most smoothly paired with a good code editor. Each editor installs and signs in differently, so this chapter goes through them one at a time in detail.
| VS Code (Visual Studio Code) |
|---|
VS Code is the most popular editor in the world, it is free, and it supports Claude Code very well through several routes.
Method 1 — Through the integrated terminal (nothing extra to install)
| 1 | Download and install VS Code Go to code.visualstudio.com and download the build for your operating system |
|---|
| 2 | Open the project folder File → Open Folder, or drag a folder onto the VS Code window |
|---|
| 3 | Open a terminal Press Ctrl+` (backtick) or View → Terminal, and you get a terminal already sitting in the project folder |
|---|
| 4 | Run Claude Code Type claude in the terminal, press Enter, and start giving instructions |
|---|
# Open a terminal in VS Code and run
claude
# Or use one-shot mode
claude -p "explain the file @src/app.ts for me"
Method 2 — Install the Claude extension (recommended)
The extension puts Claude in the VS Code sidebar, so you use it without switching to the terminal.
Installing and signing in
Press Ctrl+Shift+X to open the Extensions Marketplace
Search for "Claude" or "Anthropic" and pick the Claude extension (by Anthropic)
Press Install and wait for it to finish
VS Code shows a sign-in popup → click “Sign in with Claude.ai”
A browser opens; log in with your Anthropic account and press Authorize
Back in VS Code you will see the Claude icon in the left sidebar
💡 Sign in with an API key instead of an account
If you would rather not sign in with an account, open Settings (Ctrl+,), search for “Claude API Key” and enter the key directly. Suited to use inside an organisation
Method 3 — Install the Continue extension (supports several models)
Continue is a popular extension that supports Claude and other models, with a fuller feature set.
Search for “Continue” in the Marketplace and install it
Press Ctrl+Shift+P and type “Continue: Open Config” to open config.json
Add Claude as a provider like this:
{
"models": [
{
"title": "Claude Sonnet 4",
"provider": "anthropic",
"model": "sonnet",
"apiKey": "sk-ant-api03-xxxxxxxxxx"
}
],
"tabAutocompleteModel": {
"title": "Claude Haiku",
"provider": "anthropic",
"model": "haiku"
}
}
Save the file, then press Ctrl+L to open a chat with Claude in the sidebar
💡 Shortcuts you will use often in Continue
Ctrl+L = open chat | Ctrl+Shift+L = send the selected code to Claude | Ctrl+I = inline-edit the code at the cursor
| Cursor — AI-First Editor |
|---|
Cursor is a code editor forked from VS Code and designed specifically for AI. Claude is embedded in the UI from the start, with no extension to install.
Installing Cursor
| 1 | Download Cursor Go to cursor.com → Download for [your operating system]. The file is around 200MB |
|---|
| 2 | Install and open it Install it like any other app. On first launch it asks whether you want to import your settings from VS Code |
|---|
| 3 | Sign in and set up Claude Cursor has Claude built in, but to use your own API key go to Settings → Models |
|---|
Making Cursor use your own Claude API key
By default Cursor uses its own credits, but if you want to use a personal API key (cheaper and more flexible):
Open Cursor → Settings (Ctrl+Shift+J) → Models
Scroll down to Claude under “API Keys”
Switch on “Use your own API key” and enter your Anthropic API key
Pick the model you want as the default
# Set it in the project's .env (this works with Cursor Composer too)
ANTHROPIC_API_KEY=sk-ant-api03-xxxxxxxxxx
Cursor’s main features
| Feature | Shortcut | What it does |
|---|---|---|
| Chat | Ctrl+L | Opens a panel for talking to Claude while you write code |
| Composer | Ctrl+I | Has Claude edit several files across the project at once |
| Inline Edit | Ctrl+K | Edits the highlighted code directly with Claude |
| Codebase Chat | Ctrl+Shift+L | Asks Claude about the whole project codebase |
| Tab Complete | Tab | Accepts an AI suggestion as you type |
💡 Cursor Rules — the equivalent of CLAUDE.md
Create a .cursorrules file at the project root and put the project context in it, such as tech stack and conventions. Cursor reads it every time, exactly as with CLAUDE.md
| JetBrains IDEs (IntelliJ, PyCharm, WebStorm, GoLand…) |
|---|
JetBrains makes professional-grade IDEs for individual languages, and Claude installs the same way in all of them.
Which IDE goes with which language
| IDE | Main language | Who should use it |
|---|---|---|
| IntelliJ IDEA | Java, Kotlin | Java/Android developers |
| PyCharm | Python | Python, data science, ML/AI |
| WebStorm | JavaScript, TypeScript | Frontend and Node.js developers |
| GoLand | Go | Go developers |
| PhpStorm | PHP | PHP developers |
| RubyMine | Ruby | Ruby on Rails developers |
| CLion | C, C++ | Systems and embedded developers |
Installing the Claude plugin on JetBrains
| 1 | Open the plugin marketplace Go to Settings (Ctrl+Alt+S) → Plugins → Marketplace |
|---|
| 2 | Find and install the plugin Search for “Claude” or “Anthropic” and press Install on the one from Anthropic |
|---|
| 3 | Restart the IDE Press Restart IDE so the plugin takes effect |
|---|
| 4 | Sign in / enter an API key Go to Settings → Tools → Claude and enter an API key, or press “Login with Claude.ai” |
|---|
# Or set the API key through an environment variable
# macOS/Linux: add to ~/.zshrc
export ANTHROPIC_API_KEY="sk-ant-api03-xxxx"
# Windows PowerShell
$env:ANTHROPIC_API_KEY = "sk-ant-api03-xxxx"
Using Claude inside JetBrains
Alt+C → opens the Claude chat panel on the right
Right-click highlighted code → Claude → Ask Claude / Explain / Refactor
Alt+Shift+C → inline-edits the selected code
Open the Claude tool window and you can drag files from Project Explorer into the chat
💡 Use the AI Assistant alongside Claude
JetBrains has an AI Assistant of its own and you can run both together — the AI Assistant handles IDE-specific work such as refactoring and renaming, while Claude handles logic and architecture
| Neovim — for people who live in the terminal |
|---|
Neovim is a text editor that runs in the terminal, suited to developers who prefer a keyboard-driven workflow.
Installing the Claude.nvim plugin
-- Add to ~/.config/nvim/lua/plugins/claude.lua
-- Using lazy.nvim as the plugin manager
return {
"pasky/claude.vim",
config = function()
vim.g.claude_api_key = os.getenv("ANTHROPIC_API_KEY")
vim.g.claude_model = "sonnet"
end
}
-- Or use avante.nvim, which has a fuller feature set
return {
"yetone/avante.nvim",
opts = {
provider = "claude",
claude = {
model = "sonnet",
api_key_name = "ANTHROPIC_API_KEY"
}
}
}
💡 Recommended: use the Claude Code CLI instead
For Neovim users the advice is to run the Claude Code CLI in a separate terminal (a tmux split) rather than installing a plugin, because the CLI is the better experience and it updates more often
MCP (Model Context Protocol) — the complete guide
MCP is an open standard Anthropic created that lets Claude connect to external tools and services. Think of it as a “plugin” system that extends what Claude can do without limit.
How MCP is structured
MCP is client-server: Claude Code is the client, and an MCP server is the intermediary that talks to the external service.
Correction (updated 2026-09) The previous edition of this guide said MCP is configured in
~/.claude/settings.json, which is wrong. The current official documentation has no MCP configuration insettings.jsonat all. What is correct is that there are three scopes
| Scope | Stored where | Use it when |
|---|---|---|
local (the default) | ~/.claude.json, under that project’s path | For this project only, private to you |
project | .mcp.json at the project root | To share with the team — commit it to the repo |
user | ~/.claude.json | For every project on your machine |
The recommended approach is the claude mcp add command, which writes the file for you so you never edit JSON by hand.
# stdio server (note the -- separator before the command to run)
claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
-- npx -y airtable-mcp-server
# remote server over HTTP
claude mcp add --transport http notion https://mcp.notion.com/mcp
# store it at project scope to share with the team
claude mcp add --transport http shared-server --scope project https://example.com/mcp
-s or --scope takes local, project or user; -t or --transport takes http, sse or stdio; and -H or --header supplies a header for authentication.
The
ssetransport is deprecated. The official documentation says to use an HTTP server instead wherever one is available
You can write .mcp.json yourself if you prefer. The shape is this
{
"mcpServers": {
"shared-server": {
"type": "http",
"url": "https://example.com/mcp"
},
"database-tools": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@bytebase/dbhub"],
"env": {
"DB_URL": "${DB_URL:-postgresql://localhost/mydb}"
}
}
}
}
Every remaining example in this section still works with the same mcpServers shape. Just move it into .mcp.json, or use claude mcp add, rather than editing settings.json
// The basic shape of an mcpServers block
{
"mcpServers": {
"server-name": {
"command": "the command that runs the server",
"args": ["argument1", "argument2"],
"env": {
"API_KEY": "the environment variable value"
}
}
}
}
| MCP Filesystem — read and write local files |
|---|
Gives Claude access to files outside the working directory. Suited to searching and editing files across projects.
// ~/.claude/settings.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/john/Projects",
"/Users/john/Documents/notes"
]
}
}
}
Examples
> find every file with the .env extension in /Users/john/Projects
> read the README of every project in /Projects and summarise them
> compare package.json between ProjectA and ProjectB
⚠️ Be careful with access rights
Name only the folders you want Claude to reach. Do not hand over / or the whole of /home, or Claude sees every file on the machine
| MCP GitHub — managing repositories on GitHub |
|---|
Lets Claude read issues, pull requests, code and Actions on GitHub directly.
Installation steps
Go to github.com → Settings → Developer settings → Personal access tokens → Tokens (classic)
Press Generate new token and choose the scopes: repo, read:org, read:user
Copy the token you get
Add it to .mcp.json (or use claude mcp add, per the scopes section above):
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}
Examples
> show every issue still open in the repo myorg/myproject
> summarise what pull request #42 changes
> find issues about "authentication" and propose fixes
> look at the latest GitHub Actions workflow and find where it failed
| MCP Browser — searching and opening web pages |
|---|
Lets Claude open websites, fill in forms, click buttons and pull data from the web in real time, through Playwright.
# Install Playwright first
npx playwright install chromium
// settings.json
{
"mcpServers": {
"browser": {
"command": "npx",
"args": ["@playwright/mcp"]
}
}
}
Examples
> open https://npmjs.com/package/react and tell me the latest version
> search Google for "Next.js 15 new features" and summarise the results
> open docs.anthropic.com and find how to use the Tool Use API
> check whether mycompany.com loads normally
| MCP Database — connecting to a database |
|---|
Lets Claude query a database directly. PostgreSQL, MySQL and SQLite are supported.
PostgreSQL
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://user:password@localhost:5432/mydb"
]
}
}
}
SQLite
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sqlite",
"--db-path", "/path/to/database.db"
]
}
}
}
Examples
> show the schema of every table in the database
> find users whose last login was 30 days ago
> analyse the performance of this query and suggest how to optimise it
> write a migration script adding a "deleted_at" column to the users table
⚠️ Always use a read-only user
For a production database, have Claude connect with a user that holds SELECT rights only. It prevents accidental changes to the data
| MCP Slack — reading and sending Slack messages |
|---|
// Create a Slack app at api.slack.com → Your Apps
// Add the scopes: channels:read, chat:write, files:read
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {
"SLACK_BOT_TOKEN": "xoxb-xxxxxxxxxxxx",
"SLACK_TEAM_ID": "T0XXXXXXXXX"
}
}
}
}
Examples
> summarise the messages in #general over the past two days
> find messages mentioning "deployment issue" in #engineering
> post a message to #releases saying the deploy is finished
| MCP Brave Search — privacy-friendly internet search |
|---|
// Sign up for an API key at brave.com/search/api
{
"mcpServers": {
"brave-search": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-brave-search"],
"env": {
"BRAVE_API_KEY": "BSA-xxxxxxxxxxxxxxxxxx"
}
}
}
}
Managing MCP: a summary
# See which MCP servers are connected
/mcp
# Restart an MCP server (after editing settings.json)
/mcp restart
# View MCP logs (for debugging when something goes wrong)
/mcp logs filesystem
💡 Run several MCP servers at once
You can add several MCP servers to settings.json together. Claude picks the appropriate tool by itself, so you do not have to name one every time
Git with Claude Code — the complete guide
Git is a skill every developer needs. Using Claude Code alongside it makes managing code, writing commit messages and reviewing changes far faster and more accurate than before.
The Git basics you need
| Repository (Repo) | A project folder Git looks after, with a hidden .git folder inside |
|---|---|
| Commit | A snapshot of the code at a moment in time, identified by a hash |
| Branch | A line of commit history, used to develop a feature without touching main |
| Staging Area | Where files wait before a commit (git add puts them there) |
| Remote | A repository on a server such as GitHub or GitLab, used for push and pull |
| HEAD | Your current position in the history, normally the latest commit |
| Working Tree | The files in the current folder that have not been committed |
The recommended workflow: Claude Code + Git
A standard workflow with Claude helping at every step:
| 1 | Starting a new feature: create a branch Always create a new branch for each feature; never work on main directly |
|---|
# Create a new branch and switch to it
git checkout -b feature/user-authentication
# Or use the newer command
git switch -c feature/user-authentication
# Give the branch a meaningful name, for example
# feature/xxx = a new feature
# fix/xxx = a bug fix
# refactor/xxx = restructuring code
# docs/xxx = documentation updates
| 2 | Write code with Claude Use Claude Code to help write and edit the code |
|---|
# Start Claude Code
claude
# Give Claude an instruction
> build JWT authentication middleware for Express.js
with refresh tokens and revocation as well
| 3 | Look at the changes before committing Check the changed code is right before you record it |
|---|
# See which files changed
git status
# See the detail of the changes (the diff)
git diff
# Have Claude analyse the changes
git diff | claude -p "review this change — are there any problems"
| 4 | Add files to the staging area Pick the files you want in the commit |
|---|
# Add every file
git add .
# Add only certain files
git add src/middleware/auth.js src/utils/jwt.js
# Add parts of a file at a time (interactive)
git add -p src/app.js
| 5 | Write the commit message with Claude Have Claude write a good commit message from the diff |
|---|
# The recommended way: let Claude write the commit message
git diff --staged | claude -p "write a commit message in
Conventional Commits format for this change"
# An example of the output Claude will write for you
# feat(auth): add JWT authentication middleware
#
# - Implement access token (15min) and refresh token (7d)
# - Add token revocation via Redis blacklist
# - Include rate limiting (10 requests/min)
| 6 | Commit the code Record the commit with the message Claude wrote |
|---|
# Commit with the message inline
git commit -m "feat(auth): add JWT authentication middleware"
# Commit and open an editor to write a detailed message
git commit
# Commit every tracked file and record it (skipping git add)
git commit -am "fix: correct token expiry calculation"
| 7 | Push to the remote Send the code up to GitHub/GitLab |
|---|
# Push a new branch for the first time
git push -u origin feature/user-authentication
# Every push after that (the remote is remembered)
git push
Git techniques you will use regularly with Claude
1. Code review before merging
Have Claude review everything in the branch before you open a pull request
# Review everything that differs from main
git diff main...feature/my-feature | claude -p \
"review this code as a senior developer would, checking
security, performance, edge cases and code quality"
# Review only the changed file
git diff main -- src/api/auth.js | claude -p "review this auth section"
2. Writing a PR description automatically
# Build a PR description from the commit history
git log main..HEAD --oneline | \
claude -p "write a pull request description from these commits,
including Summary, Changes, Testing steps and Screenshots needed"
3. Resolving merge conflicts with Claude
When a merge produces a conflict, Claude can resolve it for you.
# Suppose a merge produces a conflict
git merge main
# Auto-merging src/utils/auth.js
# CONFLICT (content): Merge conflict in src/utils/auth.js
# Have Claude resolve the conflict
cat src/utils/auth.js | claude -p \
"resolve this merge conflict correctly,
keeping the logic from both branches"
# Or ask inside a Claude Code session
> resolve the merge conflict in @src/utils/auth.js,
keeping the features from both main and the current branch
4. Git bisect to find the cause of a bug
Git bisect finds the commit that caused a bug by binary search, and Claude can help analyse the result.
# Start the bisect
git bisect start
git bisect bad # the current commit has the bug
git bisect good v1.0.0 # a commit known to be good
# Git checks out the middle commit; test it and report the result
git bisect good # if this commit does not have the bug
git bisect bad # if this commit has the bug
# Repeat until the culprit turns up, then have Claude analyse it
git show <bad-commit-hash> | claude -p "explain how this commit causes the bug"
# End the bisect
git bisect reset
5. Stash — parking work temporarily
When you have to switch branch suddenly but the work is not finished, stash it first.
# Park the current work temporarily
git stash push -m "auth middleware work, not finished"
# Switch branch to deal with something urgent
git switch hotfix/payment-bug
# ... fix the bug, commit, push ...
# Come back and carry on
git switch feature/user-authentication
git stash pop
# See the stashes you have
git stash list
6. Interactive rebase — tidying up commits
Use it before pushing to leave a commit history that is clean and easy to read.
# Edit the last 5 commits
git rebase -i HEAD~5
# Commands you will use often in the editor:
# pick = keep this commit
# reword = keep it but change the message
# squash = merge it into the previous commit
# drop = remove the commit
# Example: combine 3 commits into 1
# pick abc1234 feat: start auth
# squash def5678 feat: add refresh token
# squash ghi9012 feat: add revocation
# Have Claude write the squash message
git log --oneline HEAD~3..HEAD | \
claude -p "write a commit message for these combined commits"
⚠️ Never rebase a branch you have already pushed
Rebasing changes commit hashes, so the history no longer matches the remote and your team has a problem. Rebase only commits you have not pushed
7. Git hook + Claude (automation)
Set up a Git hook so Claude reviews the code automatically before every commit.
# Create the file .git/hooks/pre-commit
#!/bin/bash
# Pull the diff of what is about to be committed
DIFF=$(git diff --staged)
# If anything changed, have Claude review it
if [ -n "$DIFF" ]; then
echo "🤖 Claude is reviewing the code..."
REVIEW=$(echo "$DIFF" | claude -p \
"review this code; if there is a critical problem, say so and exit 1")
echo "$REVIEW"
fi
# Make the file executable
chmod +x .git/hooks/pre-commit
8. Conventional Commits — the commit message standard
The commit message standard used widely in professional projects.
| Type | When to use it | Example |
|---|---|---|
| feat | Adding a new feature | feat(auth): add OAuth2 login |
| fix | Fixing a bug | fix(api): correct status code on 404 |
| refactor | Restructuring code | refactor(db): optimize query builder |
| docs | Updating documentation | docs(readme): add installation steps |
| test | Adding or fixing tests | test(auth): add JWT expiry test cases |
| chore | Other maintenance work | chore(deps): bump react to 19.0.0 |
| perf | Improving performance | perf(search): add Redis caching |
| style | Fixing formatting without changing logic | style: fix indentation in utils |
| ci | Changing CI/CD config | ci: add staging deploy workflow |
# Have Claude write a Conventional Commit message
git diff --staged | claude -p \
"write a commit message in Conventional Commits format
(feat/fix/refactor/docs/test/chore/perf/style/ci)
with a scope and a body explaining the detail"
Emergency Git commands you need to know
| git restore | Discards the changes in a file, back to the latest commit |
|---|---|
| git restore —staged | Takes a file out of the staging area (undoes git add) |
| git commit —amend | Edits the latest commit (message or content) before pushing |
| git reset —soft HEAD~1 | Undoes one commit but keeps the code in staging |
| git reset —hard HEAD~1 | Undoes one commit and throws the code away (dangerous!) |
| git reflog | Shows every action in the history, even deleted ones; use it to recover |
| git cherry-pick | Brings a single commit onto the current branch |
| git revert | Creates a new commit that undoes an old one (safer than reset) |
💡 Use Claude in an emergency
If you have made a mess in Git and do not know how to fix it, run git status and git log —oneline -10, send the output to Claude and describe what happened. Claude will suggest the safest way out
Glossary for this chapter
| Extension | An add-on for a code editor that adds extra capability |
|---|---|
| Plugin | An add-on for an IDE; JetBrains calls them plugins |
| MCP Server | A program that takes instructions from Claude and works with an external service |
| Personal Access Token | A secret code for reaching the GitHub API in place of a password |
| Repository | A project Git manages, holding the whole commit history |
| Branch | A line of commit history, used to develop a feature without touching main |
| Merge | Combining one branch into another |
| Rebase | Moving commits to start from a new base, which leaves a clean history |
| Stash | Parking unfinished work temporarily so you can switch branch |
| Staging Area | Where files wait before a commit (git add puts them there) |
| Pull Request (PR) | A request to merge code from one branch into another, with review |
| Conventional Commits | A commit message standard that keeps history readable and changelogs auto-generatable |
| Git Hook | A script that runs automatically on a Git action, such as pre-commit or post-push |
| Conflict | The clash when two branches change the same line; it has to be resolved by hand |