Claude Code in Practice

BizatWeb
79 followers
33 Video Views·Dec 4, 2026
This course will teach you how to accelerate your development workflow by mastering Claude Code's modes and automation techniques to build, test, and deploy full-stack applications.
0:07 Setting up automatic editing and branching strategy
5:31 Planning and executing project initialization with Claude Code
14:05 Implementing frontend and backend development with iterative refinement
23:17 Test-driven development and automated Git workflows with persistent context
30:57 Full-stack feature implementation and code analysis with dependency mapping
37:40 Security best practices and responsible use of Claude Code
40:34 Troubleshooting common issues and managing execution risks
This video provides a comprehensive guide on using Claude Code to develop a health-tracking app called WellTrack. It details the strategic use of operational modes, context management, and project initialization to streamline the full-stack development lifecycle, from initial planning and test-driven implementation to security best practices and troubleshooting.
Since we've seen the default ask before edits mode and plan mode,
let's try edit automatically.
I can shift tab to switch into edit automatically,
and then I'll ask Claude,
can you please implement the next task from tasks?
We also want to add to this,
create new branches and pull requests for each task.
Since we have a Git repo now, we want
to make sure we use proper branching strategies to isolate our work.
In this mode, Claude can edit files for us automatically,
but it can't perform bash commands,
like creating files and directories or Git commands,
so we'll still need to approve those.
After this is completed, if we go to GitHub in the browser,
we can see the PR was created and close it.
If we check in on our progress in the task file,
we can see that Claude has only checked
off the first two subtasks from task 1.1,
so I should have been more specific in my
prompts.
At this point, you may also be wondering how we can verify
or test that the code is working
for what Claude Code has written so far.
One way is to ask Claude Code to write tests and make sure they pass.
To do this, I'm first going to make sure we're in plan mode
so we can see what Claude's plan would be for the tests.
Then we can enter the prompt,
Can you finish the rest of the 1.1 project initialization tasks?
And can you write unit
and integration tests for the code we've written so far?
It then prompts me to review the plan once it's finished.
After a quick review, the plan looks good.
Now I can switch to Ask mode and prompt Claude to execute that plan.
Claude then presents the changes that were created,
and we can see a branch and PR were automatically added.
So it remembered that it should create a branch
and PR for each task it completes.
So far, we've looked at strategically
using Claude code's different modes.
Plan, Ask, and Auto Edit.
To create the tasks from our requirements file,
to execute those tasks,
to implement Git workflows,
and to build unit and integration tests.
Next, let's automate more of these steps
by configuring Claude Code.
Claude Code can help you accelerate
your development time,
but knowing how to use Claude strategically
can make it even more productive.
Let's see how to do this by taking
a look at Claude Code's different modes.
We'll start with plan mode to plan development on a new app.
I already have Claude Code installed for the terminal,
so I can type claude in the terminal
and hit enter, and it will ask me for permission
to work with my files in this folder if I
confirm it's ready to get started in this directory.
If you need to install Claude Code, visit the Claude Code website
and see the installation instructions there.
You can also install it in VS Code by searching
for Claude in the extensions window.
I already have it installed,
so I have this orange starburst icon to start using Claude.
It works the same whether you're in the terminal or in VS Code.
We're going to use it in VS Code for now so that we can
also look at some of the files it's creating as we go.
Claude Code has different modes, Plan Mode,
Ask Mode, and Edit Automatically.
You can use Shift Tab to switch between modes,
and you can see that as I type Shift Tab,
the selected mode is specified below the text input box.
In Plan Mode, Claude Code can plan things by viewing the code base
but without making any edits.
Times when you would want to use Plan Mode are
planning new projects when you want to select architectures
and create tasks and timelines,
multi-step implementation
when your feature requires making edits to many files,
Code exploration when you want to research
the codebase thoroughly before changing anything,
and interactive development
when you want to iterate on the direction with Claude.
Here are some example prompts
that you could use plan mode for in an existing project.
Give me an overview of this codebase.
Explain the main architecture patterns used here.
What are the key data models?
And if you're looking for a specific feature or functionality,
you might prompt find the files
that handle user authentication
or trace the login process from front-end to database.
For our first practical example,
we're going to focus on planning a new project.
I'm a developer at a company called WeldTrack
and our client is our product design team.
They've handed over a requirements document
that explains the app we're going to build,
also called WellTrack. It's for people with chronic health conditions.
Users can log symptoms, moods,
medications, and daily habits,
and view trends to predict patterns.
We can see the requirements document has the overview.
And the tech stack required as React with Node.js
and Express and Postgres.
Then it also has listed the data models,
core features, screens, and API endpoints.
We've also been given some wireframes that show the design.
The dashboard will show a summary of the current day
and will allow the user to
quickly add symptoms or moods, which will then open a different screen.
And we can also see what the trends might look like.
Now to get started on the WellTrack app,
I'm going to ask Claude Code to help me plan it.
Can you create a list of tasks to implement
the technical requirements from requirements.md?
And I can add the at symbol to point to a specific file.
I also want to add that an intermediate developer would
be comfortable with.
The reason I added that is I want to be comfortable jumping
in at any point and understanding
or changing anything that Claude Code has created.
Also if the tasks are broken down into small chunks,
then we can have separate agents or
or developers working on separate tasks.
And even create tickets for these tasks.
Finally, I'll add, put the tasks in a markdown file.
Now we can hit enter and let Claude Code create a plan.
We can see Claude is thinking, it's showing its thinking animation,
and it's listing the files and directories and analyzing them,
even though there's nothing there yet.
Then Claude Code presents a plan
and asks if it should proceed writing to the file.
I select Yes and Auto Accept since I'm OK with it editing the file.
Now Claude has finished and has presented the results above,
but I'm just going to go
straight to view the Tasks file.
We can see an overview with the first task
as Project Initialization.
And we can see it has a box to check off each subtask within it.
If we scroll through all of the phases, we can see each phase
is thorough and has a timeline of two to three weeks,
ending with the beta launch at 12 weeks.
If we wanted any changes to the task plan,
we can make those now using plan mode,
or we can also manually edit the task markdown file.
It's just a file for you and Claude to reference.
So if we wanted to add or delete tasks, we can also do that manually.
But since they look good so far,
let's switch into Ask Before Edits mode, which is the default mode.
I'm going to enter Go Ahead and Complete Task 1 from the Tasks file.
This is the standard mode where Claude shows you a diff
and prompts for permission before making any file edits.
You can accept or reject each change individually,
which gives you fine-grained control.
Now we can see Claude working on the current task,
and then it proposes a change and asks for permission.
We can see it is asking to allow this bash command
to make directories for backend and frontend.
And we can select Yes to allow.
Now that we have our project started
and some planning documents created,
we should create a Git repository to version control our work.
We could do this manually,
but let's ask Claude Code to create a .gitignore for the
tech stack listed in requirements,
and initialize a get repository in this directory, and also set
the origin to the origin I just created
on GitHub. We can also ask to commit
and push the recent
changes. And Claude asks me to approve git add
and git commit commands. Then the commit is created.
Now we've laid the groundwork for our project
by using Claude's plan mode to create a roadmap
for tasks and used ask mode to complete our first task.
Now that we have Git workflows,
test writing instructions,
and documentation guidelines added to the Claude markdown file,
I feel more comfortable accelerating through
the front-end tasks from our tasks list file.
Let's ask Claude to complete tasks 2.1 through 2.5
in edit automatically mode.
I'm still going to be a little cautious here
and ask for each task one at a time so that
I can do a quick code review at each step
and merge in each feature branch.
Once that's done, this is what our front end looks like so far.
It's simple, but I think it looks great.
If we wanted to make changes to the layout, we could do that now.
But I'm ready to continue adding features to the frontend next.
Now we're ready to build the frontend
that users will actually interact with.
But before we move on to working on the frontend,
we should make sure that we have good documentation in place.
Let's start by adding documentation guidelines to the Claude file.
Our documentation goal is to have
a new developer be able to clone our repo
and get it running within 15 minutes.
And be able to find an endpoint's expected request
format without digging through the source code.
I'm going to paste in some guidelines to the bottom of the Claude file.
Since our project is medium size right now, we have listed
a readme for setup instructions and environment variables,
code comments for complex functions,
the why not the what,
and a simple API reference in Markdown in a docs folder.
Just endpoints, request formats, and response examples.
Now let's have Claude generate some documentation for us.
We'll prompt, generate API documentation
for all the auth endpoints we've created.
Follow the format in claude.md. Keep it simple and practical.
See how Claude followed our format?
Endpoint, method, auth requirement, request example, response example.
It's not fancy, but it's exactly what
a developer needs to use these endpoints.
Let's also update the README. We can prompt,
update the README with the current setup instructions,
include environment variables, database setup,
and how to run the dev server.
Keep it concise, just what someone needs to get started.
Now we can see in the readme that we have practical setup instructions.
And because this is in our Claude configuration file,
Claude will keep the format consistent as we add more features.
Now we've shown Claude how to document
our project for us, and Claude can now
follow consistent standards every time it generates code
or completes a task.
Documentation isn't just for other developers,
it's also for your future self and now it's for
Claude to use too. Since we previously configured
our Claude file with git workflows and testing
instructions, we went ahead
and completed the task from phase one for the backend.
But before we move on to the front end,
let's verify our backend is complete and working.
First I'll run our test suite with npm test.
All tests are passing. We've got coverage for
authentication, all our CRUD operations,
input validation, and error handling. But tests only
prove the code works in isolation.
Let's also see it working as a real API with Postman. In Postman
I've organized the requests into folders matching our features.
Let's start with the auth flow.
First, I'll register a new user.
We see 201 created, so Sarah's account now exists.
Notice we get her user info back as well.
Now let's log in with those credentials.
After login, we get an access token
to authenticate our other requests.
I'll copy this access token,
and Postman lets me save this to a variable,
so it's automatically included in future requests.
Now let's log some symptoms.
First, a health check, and we get 201 created.
Let's add another symptom for fatigue,
then we can retrieve Sarah's symptom logs.
We get back both logs sorted by date.
Notice each log has the symptom details populated.
We also have endpoints for medications and habits,
and we have an insights endpoint for trends.
Finally, let's look at the actual database
to see if this data is really being persisted.
We can do this in Prisma Studio.
Here's Sarah's account.
You can see her email, display name, and the hashed password.
We know that we never store plain text passwords.
Here are the symptom logs we created.
You can see the user ID linked back to Sarah,
also the symptom ID linking to the headache and fatigue symptoms,
the severity scores and any notes.
Prisma Studio also lets you explore relationships. If I click
this user ID it shows me Sarah's full record
and this is really helpful for debugging.
Now our backend is complete with user authentication,
symptom tracking, mood logging, medications, and habits.
This is all tested and all working and all persisted to the database.
As we saw earlier, Claude's context window has a fixed size limit,
roughly 200,000 tokens,
which translates to somewhere around 600 pages of text.
You can think of Claude's context window like a desk.
You can only fit so many documents on the desk at once.
If you pile on too many things,
like adding requests or files to your conversation,
some will fall off the edge.
The more files you load or requests you make,
the less room there is for more context.
And if you have a really long conversation,
older parts might get pushed out to make room for newer content.
As your project grows,
you'll eventually bump into Claude's context limits.
You can check how much of that context is in use
for a conversation by adding the slash context command.
I can show you now,
but since I've been using Claude Code in VS Code and it's still in beta,
the Claude bash commands don't work right now.
So I'll switch to the terminal in our project
directory, welltrack,
then enter the command Claude dash dash resume to resume the conversation
I was just using in VS Code. Great, now we can enter slash context
And we see the summary of our context usage.
We see the Claude Opus model,
then our current total context usage of 21k out of 200k available.
Then below, there are different categories for context.
System prompt and system tools
are system settings that we don't control.
Memory files are the Claude.md files.
You can have separate Claude markdown files
in your project's subdirectories if you want to.
Any other reference files like the tasks file,
Claude only reads those when specifically asked.
Messages contains your actual conversation history.
This is a tiny number here
because this is essentially a fresh conversation.
The autocompact buffer is an interesting one.
It's reserved headroom that acts as a trigger zone.
When your messages grow large enough to start eating into this buffer,
Claude Code automatically runs compaction,
which summarizes earlier conversations to free up space.
For example, here's what a context could look like
if your messages were taking up
120k tokens or 60% of the allowed space
and approaching the auto compact buffer.
Cloud Code detects this and summarizes the earlier conversation,
or automatically compacts it.
Then, after auto-compact,
the message's context is back down to 40k tokens.
Now that we know what context limits are,
what are some of the consequences of a large context?
More token usage.
Long Claude Code conversations use significantly more tokens
because the model re-reads the entire history, prompts, code, outputs,
with each new message to maintain context,
causing token usage to compound and quickly consume your budget.
Decrease quality or relevance.
So having a harder time putting ideas together,
losing track of earlier details as the conversation gets long,
repetitive behaviors or errors,
so making mistakes or providing sub-optimal solutions,
and slower response times.
So processing a large context window requires more computation which
can lead to longer wait times for responses.
Now that we understand context window limitations,
We can work with them.
We can structure our prompts to get the best results.
The first strategy we can use is to leverage our Claude markdown file.
Your Claude file is always loaded at the start of conversations.
Make sure you create one with the slash init command
for any existing codebases.
Then add any relevant information as you continue working with Claude,
like adding architecture notes.
The second strategy is to work in focus chunks.
Instead of asking Claude to refactor the entire backend, break it down.
You can prompt Claude to refactor the authentication module
to use the new error handling pattern.
Then, after that's complete, refactor the symptom logging module.
Smaller, focused tasks are more reliable than sprawling ones.
For strategy three, use explicit file inclusion.
When you know exactly which files are relevant,
tell Claude using the at symbol.
This focuses Claude on just those files,
leaving more context room for the actual work.
The fourth strategy is to use module-specific summaries.
If you're doing a lot of work in one area, consider creating a summary.
A prompt might look like,
create a summary of the authentication module.
What files are involved, how they connect, and what patterns they use.
Then you can reference these summaries
in future conversations to quickly get
Claude up to speed on that part of the code base.
Strategy five, start fresh chats.
Break large tasks into smaller conversation sessions
to avoid massive history bloat.
The goal is to work with the context window, not against it.
Focus prompts, good documentation, and strategic file references
will get you much further than trying to dump
your entire codebase into every conversation.
One of the most powerful patterns
with Claude code is test-driven iteration.
The idea is simple.
Claude writes code, writes tests, runs those tests,
and if something fails, Claude fixes
it and tries again.
This loop, write, test, fix, repeat,
is how you get reliable code from Claude.
Let's configure it in our Claude file.
I'm adding a testing requirements section.
There's a key rule in here that I wanna highlight.
Fix the code, not the tests, unless the tests are incorrect.
This is important.
When tests fail, there's a temptation
to just make the test pass by weakening it,
but that defeats the purpose.
We want Claude to fix the actual code to meet the test's expectations,
not water down our tests.
Let's see this in action.
We'll ask Claude to implement
the post API auth register endpoint from task 1.3 and make sure
all tests pass before marking it complete.
Let's pause here and look at the summary of changes so
far. Claude created utility functions validation
and auth route and finally created eight tests
and Claude verified 16 current tests passed.
After verifying the test passed,
Claude moved on to creating the commit and PR.
This testing iteration loop is the key
to getting reliable code from Claude.
Without it, you'd get code that looks right,
but might have subtle bugs.
With it, you get code that's actually tested and working.
The best part? You just have to ask once.
Make sure tests pass, and Claude handles the whole loop
automatically because we configured it in the Claude Markdown file.
Previously, we've used
Claude code's different modes to plan and execute tasks,
but you might have noticed something.
We had to keep telling Claude things.
Create a branch for this task. Remember to write tests.
What if Claude could remember these preferences automatically?
What if every time you started a conversation,
Claude already knew how your project was structured,
what conventions you follow, and what workflows you expect?
That's exactly what init and the Claude markdown file give you.
Let me show you what I mean.
I'm going to run the init command in our WellTrack project.
Claude starts working on scanning our project.
It's looking at our file structure, our requirements,
the package.json files, and checking configurations.
It's trying to understand what kind of project this is.
Now it asks for permission to create the claude.md markdown file,
and I can enter yes.
Here it is, a new file in our project root.
Let's take a look.
This is a markdown file that Claude generated based
on what it learned about our project.
It has the overview, our tech stack, common commands,
architecture API endpoints, and data model.
So what just happened?
Think of a NIT like onboarding a new developer to your team.
You give them a tour of the code base, show them where things are,
explain how the team works.
That's what a NIT does for Claude, but this is what some users miss.
This Claude file isn't just documentation,
it's not just for humans to read.
Claude reads this file at the start of every single conversation.
Let me explain how this works.
When you start a conversation with Claude code,
Claude has what's called a context window.
Think of it as Claude's working memory.
Everything Claude needs to know has to fit in this window.
Your conversation, the files you're working with,
and Claude's own responses.
This context window has a fixed size limit,
roughly 100,000 to 200,000 tokens,
depending on the model,
which translates to somewhere between 300 and 600 pages of text.
That sounds like a lot,
but it fills up fast when you're loading multiple source files
and having a long conversation.
Without running init to create the claude markdown file,
Claude starts every conversation with a blank slate.
It knows nothing about your project.
You'd have to explain your tech stack,
your file structure, and your conventions
for every single prompt.
And as your conversation gets long,
Claude might forget things you told it earlier.
But with the Claude file,
that context is loaded first before anything else.
It's anchored at the top of Claude's memory.
No matter how long your conversation gets,
Claude always has access to your project context.
This is where it gets really useful.
The Claude file that Nick created, it's just a starting point.
It's a regular Markdown file that you can edit on your own,
but the auto-generated content is based
on what Claude can infer from your files.
But you know things about your project
that aren't obvious from the code.
What coding conventions your team follows,
which patterns you want Claude to use,
what workflows you expect,
and even why you made certain architectural decisions.
So the real workflow is first run a knit
to generate the baseline, then open the
Claude Markdown file and add your own context.
Third, commit it to version control so your
whole team can use it.
Let me show you what this looks like in practice.
Here's our auto-generated Claude markdown.
It's useful, but it's generic. Let me add some
project-specific context.
Remember in Module 1 how we had to remind Claude of our git workflow
by telling it to create branches and pull requests for each task?
That worked, but we had to remember
to include those instructions every time.
Let's configure our Claude.md so Claude does this
automatically
I'm going to add a git workflow section to the bottom of the file.
It says when completing tasks to create
a new branch with the naming convention, make
atomic commits, and create a PR when the task is complete.
Finally, check off the task in a tasks markdown file.
Now let's see this in action.
I'll switch to Ask mode
and give Claude a task without mentioning anything about Git.
Claude starts working on the task plan and then once it's complete,
it asks for permission
to create a git branch.
I say yes and then it pushes the branch and finally creates the PR.
The title matches the task
and the description summarizes what was done.
This is ready for code review and we didn't have to ask for any of it.
This is the power of the Claude file configuration.
You define your workflow once and then Claude follows it every time.
No more forgetting to create branches,
no more inconsistent commit messages.
Your entire team can share the same Claude file
and get consistent behavior from it.
Now let's get to one of Claude Code's most powerful capabilities,
adding a full stack feature
Which means making coordinated changes across multiple files at once.
Since features don't live in single files,
adding a new API endpoint means updating routes,
controllers, maybe a service layer, and often the frontend too.
Let me show you how Claude handles this.
Let's add a new endpoint to our WellTrack app
that returns aggregated statistics for a user.
Things like their average mood score,
most frequent symptoms, and logging streaks.
Then, I also want a card on the dashboard to display these stats.
But I'm going to structure my prompt so I start with the backend first.
I already listed the new endpoint we want
and what it will return at the beginning of the prompt.
Now I'm going to list out the specific components we need.
A new route in the user's router, a new controller method,
a new service function with the aggregation logic,
typescript types for the response,
And initial data for moods and symptoms over the last 30 days.
We'll also ask Claude to follow
our existing patterns from the auth endpoints.
Watch what Claude does here.
It's planning to create the TypeScript types,
the service function with the actual database queries,
the route, and the unit test,
all coordinated to work together.
When it's finished, Claude shows the files it modified,
the endpoint, and the return data.
I'm not going to test this myself now,
instead I'm first going to wire this up to the front end.
My prompt will be add a your stats card to the dashboard that fetches
and displays the user
stats from our new endpoint.
Include a loading state while fetching, error handling if the request
fails, nice formatting for the statistics,
and use our existing patterns from other dashboard
components.
Claude then creates a hook and service for the API call
then creates the React component
stats card, and adds it to the dashboard.
It also handles all of the states, loading,
error, and success.
If we take a look at the front end, this looks great,
but I noticed some things that need refining.
This tile represents total logs by type.
Where S refers to symptoms, M moods, R medications,
and H habits, but I don't think anyone will be
able to guess that. I think Claude kind of missed the mark on this one.
So I'm going to ask Claude
to change this tile and instead copy what was done for top symptoms.
The prompt will be for the stats tile for total logs by type.
I don't think this is clear what the values for S, M, R, and H mean.
I think we should remove this tile
and instead copy what you did for top symptoms for 30 days
and add it below top symptoms 30 days.
For example, it would show the text total logs by type,
symptoms 19, moods 26, medications 24, habits 86.
Then Claude goes ahead and makes this change
and the stats card looks great.
It's always possible to adjust directions
with Claude code and make changes.
A few tips for full-stack features or multi-file editing.
Reference existing patterns with the at symbol.
Like, follow the pattern
in existingFile.ts helps Claude match your codebase's style
Be specific about what you need.
Listing out the components like route, controller, service, types,
Helps Claude create a complete solution
and always review and test the changes before
committing. Claude is good, but it can make mistakes.
One of the most valuable uses of
Claude code is doing file analysis
or understanding how code connects across files.
This is incredibly helpful when you're inheriting a code base,
doing a code review,
or just trying to understand how a feature works end-to-end.
Let me show you what I mean.
Let's say I have a new developer joining the team
and I want them to understand how our authentication flow works.
They could read through each file individually,
but that's tedious and they might miss connections.
Instead, I'll prompt Claude by saying
that I have a new developer joining the team
and then ask it to analyze
the authentication flow across all related files.
Then trace how a login request flows from the route handler through
to the database and back to the response.
Include all the files involved.
Also, I'll make sure this is in plan mode since we
don't want any changes to the code at this point.
When I hit enter, Claude starts analyzing all of the related files.
Once Claude finishes analyzing,
it asks if I wanted to create an auth flow document and I said yes.
Looking at what Claude just created,
it identified the relevant files and traced the data flow
through each step of the process, from Step 1,
Client Request, to Step 8, Response Formatting.
It also provided a visual flow diagram.
Now let's try a dependency analysis.
This is useful when you're planning a refactor
and need to know what might break.
I'll prompt that I'd also like to show
the new developer what components depend on the user model.
Show me the full dependency chain,
everything that imports or uses user directly or indirectly.
Claude maps out the entire dependency tree.
I can see that changing
the user model would affect these specific files.
This is the kind of analysis that prevents those
I changed one thing and broke 12 things.
This kind of analysis is perfect for several scenarios.
When you're jumping into a new code base,
ask Claude to explain the architecture and
how the major pieces connect.
When you're doing code reviews,
ask Claude to trace the impact of a change across the
system.
When you're debugging,
ask Claude to follow data through the system to find where things
go wrong.
The key is to ask for specific aspects rather than explain everything.
Focused questions get you focused, useful answers.
Before we wrap up, let's talk about security and responsible use.
Claude Code is a powerful tool that sees your code
and can execute commands.
That means you need to be thoughtful about what you share with it.
What not to share with Claude code.
First, API keys and secrets.
Never paste these into prompts
or commit them to code that Claude generates.
Use environment variables instead.
For example, instead of prompting,
can you help me test the Stripe integration,
the API key is, and paste the key in directly?
You can add to the prompt,
the API key is in my .m file as Stripe secret key.
Production database credentials.
Work with development or staging databases.
For example, instead of prompting,
connect to the database and check why orders aren't processing,
Use the host and then give Claude the actual URL
and login credentials to your actual production server.
You can instead add to the prompt,
use the database URL variable from my .env file.
It points to my local dev database.
If you need to troubleshoot production, export sanitized data first.
Third, customer personal data. Don't paste customer emails,
names, or other personally identifiable information
into prompts. You usually
don't need personal data to debug errors,
or you can use anonymized test data.
Fourth, proprietary algorithms.
If your company has trade secrets or proprietary logic that
shouldn't be exposed,
keep that out of your Claude conversations and out of your Claude
project directory. If you still want to use Claude
in a project that has proprietary algorithms,
you can create permission deny rules.
But, permission deny rules aren't currently guaranteed
to block all access paths.
In the .claude directory in the settings.json file,
you can list the sensitive files you
want to deny permission to.
You can also encode security reminders in your claude markdown file.
For example, you could have never hardcode credentials,
always use environment variables,
Sanitize all user inputs before database queries.
Use parameterized queries, never string concatenation for SQL.
Log errors without exposing sensitive data.
Claude will follow these rules when generating code.
As a best practice, you should review generated code before committing.
This is a good practice anyway, but especially important
for code that handles authentication, payments, or user data.
Finally, since Claude Code has
the powerful capability to execute bash commands,
that means you should pay attention when Claude proposes commands.
Here it's asking for permission to run kill on a process.
Since Claude's default ask mode requires approval for bash commands,
don't switch to auto execute for sensitive operations.
You should definitely be cautious
if Claude attempts commands with sudo,
anything that modifies system configurations,
or anything involving production systems.
However, here I tried to arrange a situation
for Claude to need to run sudo and it would not,
stating that it was a security risk.
So Claude code does have its own barriers in place.
Security is about habits, build good ones,
use environment variables, review generated code,
and keep secrets out of prompts.
Then you'll stay safe while getting all of the productivity
benefits of Claude Code.
Claude across all of their work.
Ask and commit. Even with the best setup,
you'll encounter issues.
Let's cover the most common problems and how to solve them
So you're not stuck when they happen.
Issue 1. Authentication errors.
You might see messages like API key invalid or connection failures.
First, verify your configuration by looking at slash config.
This shows your current setup.
If the API key looks wrong or missing, you can try to fix it from here.
Or you can try to re-authenticate by running the slash command login.
Follow the prompts to log in again.
Most authentication issues are just expired or misconfigured keys.
Issue 2. If you're making lots of requests,
your usage may be temporarily limited.
Depending upon your payment type, you may see Claude slow
down significantly or return usage or rate limit errors.
If you run slash usage,
you can look at your current session usage and your weekly usage.
This is your overall quota across time,
how much you can use Claude across all conversations.
For pro or max plans,
the session has a five-hour rolling window with a cap.
When you hit the cap,
you're locked out entirely until the timer resets.
For session limits, this can mean waiting a couple of hours to reset.
There are also weekly caps,
which obviously take longer to reset if you have to wait for
the end of the week.
Rate limits are different.
These are brief pauses for API key users
that use too many tokens per minute.
If you're hitting your usage limits, here are some possible solutions.
First, use plan mode for exploration.
Planning typically uses fewer API calls than editing,
so do your thinking in plan mode
before switching to execution.
Second, start a new conversation.
Long, Claude conversations use significantly more tokens
because the model re-reads the
entire history with each new message
to maintain context,
which causes token usage to compound and quickly consume your budget.
Third, break large tasks into smaller chunks.
Instead of processing 50 files at once,
Do 10 at a time.
Issue 3, Truncated Output.
Sometimes Claude's response gets cut off mid-code.
This usually means the response was too long for a single message.
The fix is simple.
Prompt, please continue from where you left off.
Claude will pick up exactly where it stopped.
To prevent this, ask for code in smaller pieces.
Instead of implement all the endpoints, try implement the get
and post endpoints for symptoms, and then ask for the rest.
Issue 4, Context Loss.
This is when Claude seems to forget something
from earlier in the conversation.
Let's say you're working on a file, then you switch topics for a bit,
and then when you return, you prompt,
Let's continue working on the password reset function.
Claude seems to have forgotten the file contents.
Maybe it responds with,
Is the password reset function in the frontend or backend?
This happens because the file was pushed out
of context to make room for newer conversations.
This fix is easy, just reference the file again.
Your prompt could be, looking at, then at the specific file.
Let's continue working on the password reset function.
Claude will reload the file and you can continue.
Issue 5, Claude gets stuck in a loop.
Sometimes Claude tries the same failing approach repeatedly.
Let's say you prompt, there's an error
with the regex validation, can you fix it?
You see the same error, Claude tries a fix,
same error again, another similar fix, and on and on.
When this happens, you need to break the loop with new direction.
Let's take a different approach.
Instead of trying to fix the regex validation,
let's use Zod's built-in email validator instead.
Giving Claude a concrete alternative
path will usually help it find its way.
The main thing is don't panic when issues arise,
most problems have simple solutions.
Authentication issues? Re-authenticate.
Usage limits? Check your subscription.
Truncation? Ask Claude to continue.
Context loss? Reference specific files with the at symbol.
Stuck in loops? Provide an alternative direction.
