Claude Code Fundamentals
DAILY WORKFLOWS
Keep this flow in mind when using Claude Code:
Explore > Plan > Code > CommitAnthropic recommends this workflow as this prevents ‘course correcting’ down the track.
It’s recommended that you use ‘plan mode’ during the first two phases so Claude can do research and gather context.
Plan mode also prevents Claude from editing files keeping changes from happening before the plan is reviewed.
To enter ‘plan mode’, press shift + tab to cycle through the different modes:
THE CONTEXT WINDOW
The context window is Claude’s working memory.
When it reads files, messages and commands it is all stored in its memory (the context window).
Essentially this is basically what Claude remembers about your conversation.
The important thing about the context window is that it can fill up. Every tool call, every message, every file it reads, every added MCP server takes up space in the finite context window.
When Claude reaches its context window limit, it automatically compacts your conversation to clear up space. It does this by summarising important details and removing what it deems unnecessary.
However it may remove some important details from the context window.
To view the current context window, use this command:
/contextTIPS
You can run either of these commands to minimise the context window filling up unnecessarily:
Restore the code and/or conversation to a previous point:
/rewindAsk a quick side question without interrupting the main conversation:
/btwSUBAGENTS
Claude can delegate tasks to subagents that break them down and run component tasks in parallel.
If you were to ask a basic question, the main agent may need to explore all the files to find the answer, therefore filling up the context window too early.
This is where we can use subagents. Subagent operates in their own isolated context window and, depending on your subagent’s memory settings, is discarded once the answer is found, summarised, and then passed onto the main agent.
You can create your own agent by using the below command:
/agentsYou can then select “Create new agent” and then define its scope from there.
THE CLAUDE.MD FILE
Claude Code reads the CLAUDE.md file at the start of every session.
This is so it can get immediate context and lowers the chance of asking you the same questions it asked last session.
This file is where you can put shared conventions (code style, commit format) and project context.
Example:
# My Project
Uses Python and Flask
Run tests with: `pytest`
Please write clear comments in the codeThe file is located in the root project directory and you can edit it manually. Alternatively you can use the /init command to write the CLAUDE.md file for you based on scan of the codebase’s structure and conventions:
/initYou can also direct Claude on what document to read up on for more information:
## README.md
Please read if you need more info: @README.mdIMPORTANT: What has been mentioned above is called the Project-level CLAUDE.md file. This is the file that is shared and applied by those involved in the project.
Get Lumenyx’s stories in your inbox
Join Medium for free to get updates from this writer.
There is another CLAUDE.md file which is known as the User-level CLAUDE.md file. This is where you would put your own personal stylistic preferences. This file is located at:
~/.claude/CLAUDE.mdSKILLS
A skill is used when you want Claude to consistently follow a specific, repeatable process every time.
“A common real-world example is a PDF-filling skill — a company sets up a skill so that whenever someone needs to fill out a standard form (like an invoice or expense report template), Claude automatically follows the same steps to populate the fields correctly and export it as a finished PDF, without the person needing to re-explain the process each time.”
Personal skills are typically stored in this file:
~/.claude/skills/<skill-name>/SKILL.mdEach separate skill has its own folder. For example:
- PR review is stored in ~/.claude/skills/pr-review/SKILL.md
- PDF-filling-skill is stored in ~/.claude/skills/pdf-filling/SKILL.md
Project skills are typically stored in this folder:
<project-folder>/.claude/skills/<skill-name>/SKILL.mdFormat:
---
name: my-skill-name (always lowercase)
description: What this skill does and when to use it
---
Instructions go here — the steps, conventions, or
knowledge Claude should apply when this skill is used.Example:
---
name: commit-messages
description: Use when writing git commit messages for this project
---
Write commit messages in this format:
`<type>: <short summary>`
Types: feat, fix, docs, refactor, test, chore
Rules:
- Keep summary under 50 characters
- Use imperative mood ("add" not "added")
- No period at the end
Example:
feat: add user login validationTHE DIFFERENCE BETWEEN SKILL.MD AND CLAUDE.MD
CLAUDE.md is loaded into every conversation and is used to influence Claude at every stage.
SKILL.md is loaded on-demand when something matches your request. It also only keeps the name and description in the context window, therefore saving a bit of space since the instructions aren’t loaded.
When you need something to be followed all the time, write it in the CLAUDE.md file.
When you need a specific, repeatable task or process to be followed, use the SKILL.md file.
MCP SERVERS
“Model Context Protocol is an open standard that lets Claude Code connect to external tools and data sources. When you ask a question, Claude will automatically understand when it should use those tools to better understand your query.”
Claude and other agentic AI use tools which give them the ability to complete complex tasks.
Let’s say that your team uses Jira for Issue tracking.
You can add a Jira MCP server so that Claude Code can pull in ticket details directly.
If you need Claude to check the CI status of a PR, you can add a Github MCP server.
ADDING AN MCP SERVER
There are two main types of MCP servers:
- HTTP servers — Used for remote services. Hosted by the service provider.
- STDIO servers — Used for local processes that run on your machine.
You can add MCP servers with this command:
claude mcp add --transport < http| stdio> < SERVER-NAME > < SERVER-URL >You can mange MCP servers with this command:
/mcpSCOPING MCP SERVERS
You can choose where the configuration for MCP Servers is stored, depending on who you want to share it with:
- Local (default) — The server configuration is private to you and is only active in the current project. It is stored in
~/.claude.json - User — The config is private but applies across every project that you work on. It is also stored in
~/.claude.json - Project — Shared with anyone that clones the repository. They will get the same servers automatically. Stored in
PROJECT/.mcp.json
MCP SERVERS AND THE CONTEXT WINDOW
MCP servers add tool definitions to your context window regardless of if you’re using them or not.
If you have a lot of servers configured, this can use up more of your context window.
Use the /mcp command to see what’s connected and disable anything that you’re not using.
HOOKS
A hook is a command that Claude Code runs automatically at specific points in its lifecycle (like before or after a tool call).
It’s configured in settings.json.
Unlike asking Claude to do something in a CLAUDE.md file (which can sometimes be missed), a hook is deterministic, so it runs every single time with no exceptions.
The available events are:
- PreToolUse — runs before a tool call
- PostToolUse — runs after a tool call completes
- UserPromptSubmit — runs when you submit a prompt, before Claude processes it
- Stop — runs when Claude finishes responding
- Notification — runs when Claude sends a notification
Below is an example of PostToolUse where a script is run every time a specific tool has finished running:
“If everything needs to happen without fail, don’t put it in a prompt, put it in a hook.”










