How do I use Claude Code for development? Complete guide from installation to sub-agents

Complete guide to Claude Code: installation via npm, rates from $20, configuration CLAUDE.md, context and memory management, Plan Mode and Thinking Mode, creating sub-agents for code review. Practical examples on a real project.

 0
How do I use Claude Code for development? Complete guide from installation to sub-agents
how much does Claude Code cost and what tariff to choose

How do I use Claude Code for development? Complete guide from installation to sub-agents

Hi, and today we will dive into the Claude Code AI coding tool. Let's talk about how to set it up, what subagents are, how to create them, how to create your own teams, and in general, how to work with them so that it is useful even on large projects and can perform complex tasks.

And we'll start with you. So, let's talk about how to install Claude Code and how much it all costs.

 

How much does Claude Code cost and what pricing plan should I choose?

Just want to remove the objection for those who are looking for some free solutions, Claude Code is paid, it will cost $ 20, respectively, if you want a free solution, it will not work, it does not even have a trial version. Let's talk about prices before proceeding to installation and configuration. To use Claude Code, there are two options – via the API and via pricing plans.

Using it via the API is hellishly expensive, so I don't recommend ever using it, as you'll quickly run out of money. But the Claude Code subscription is already quite a working one. In the simplest version, the PRO version, which costs 20 bucks when paid monthly, you get limited use of Claude Code, which is already used in all 4.5 models, so you get the best model for writing code.

And at the same time, at 5 o'clock you are limited to 10 to 40 promts, but by promts you mean a whole working flow in which Claude Code will implement your features. As far as this is enough, if you code all day and expect to use the code all day, then no, this is not enough. And if you use code for specific tasks, in order to solve a problem while you are working on another one, then in principle this is more than enough.

After a 5-hour cycle, everything will restart again and you can go again from 10 to 40 promts. If you want to use it all the time, then Max 5 for 100 bucks gives you, respectively, infinite Sonnet and 2-hour Opus, but in principle Sonnet solves all the solutions perfectly at the moment, so this tariff is enough to sit all day and code or write using AI. If you need something completely advanced and permanent Opus, complex tasks, then for 200 bucks, well, I think it's overkill.

Even in my example, of course, I don't write code all day, but I need to implement features for some services and I want to delegate this to someone and then check it out.A $ 20 subscription is enough for me, I've been using it for several weeks and in general more than enough. Therefore, it costs 20 bucks, but if you want it for the summer period, then $ 17. And now let's go directly to installing and working with Claude Code.

 

How do I install Claude Code? Terminal and VS Code

So, let's start with the installation and talk about where we can use Claude Code. It is installed like any npm package, using npm install-g, I already have it installed, and then the claude command becomes available to you terminally. When you first start it, it will ask you to log in to your account, open the browser, and after that you can use it, respectively, where you have it subscription. The second option is Visual Studio Code, you can install the corresponding extension, it is located in Extension.

How do I open it? You can press either, as we can see in the keyboard shortcut, Command-Esc, which will open Claude Code in a new tab. In fact, this is such a small UI interface that simulates the same interface that is present in the terminal, and you can already perform all the necessary actions in it. It is important to note that if you are used to having autocompletion, for example, when entering some characters, Claude Code is about developing with agents, and therefore there will be no autocompletion here, you can use any other extensions that provide it.

So, one way or another, either you will have it all installed in Visual Studio Code or in any other VS Code-like editor, or you will have a terminal open. We will use this in the terminal, because I usually use it together with a bundle with Vim. So now let's go directly to working with the code.

 

What is it CLAUDE.md and why do you need the /init command?

So, let's move on to initializing our work with the code. Of course, the claude command must be executed in the project folder. The first time it starts, it asks you for permission, and if you can work with this project, you need to tell it "Yes".

And now it will show the input line accordingly, where we can enter commands with you, directly what we want from it. In addition to the usual text commands, we have a set of slash commands, through which we will look at some of them. The first important command we need is /init.

/init-a command that allows you to immediately initialize the description of your project in CLAUDE.md. CLAUDE.md — this is the reserved name of the MD file that will describe the architecture of your applications. At /init, Claude will analyze the entire structure, review the code, and create a small documentation.

If your project already has some documentation, such as ours, architectural rules, modules, and so on, you can additionally tell it in /init that take the rules into account and then refer to docs/architecture-rules. After that, Enter initialization will start with an additional argument. In general, any command that you use, it will perform this action by itself, plus you can give it additional arguments.

Just like in /init, I can pass information that I have some documentation to work with. Here he will ask me for permission to execute the command, and while in this closed mode, you can say either yes for each command, or yes for this project, respectively. Well, let's let us do yes for this project, we will allow reading.

After that, it will start collecting all the documentation and create a new one. CLAUDE.md, if it doesn't have one, or if it already has one, then it updates it and then analyzes what we have. According to the result of execution, we create, respectively, a file CLAUDE.md.

What is stored in CLAUDE.md?

By the way, when executing, we can first see the time that it does this, as well as the number of tokens that it eats, because our 10 or 40 promts there will actually depend on the context with which Claude will work. The more economical you use the context, and we'll talk about this later, the more requests you'll miss, even if you use a certain basic pricing plan.

So, he created it, asks for permission to create this file, yes, we need to allow him to create files for the current session, if there is a new session, we will need to allow him again. And now he has created a file with us CLAUDE.md which we can look at.

In CLAUDE.md Basically, it stores documentation that will be used with each Claude call, so everything described here is an additional context that was used with each request. If CLAUDE.md if it is very large, then, accordingly, a lot of context will be used.

What is usually found in CLAUDE.md? These are, respectively, the command to run, the database, the quality testing code, the architecture, the Secure S Pattern, the module structure, key modules, what they are responsible for, aliases, API contracts, how to do it, how not to do it, examples, entry classes, converters, respectively, logic in controllers, integration, security, validation, API points, and code style. In general, this is more than enough, you can modify this file yourself. In addition, you can add facts, and we'll talk about the facts a little further.

 

Settings, Permissions, and Model Selection

After initializing the project with CLAUDE.md now you can start working directly with the project. I also want to focus on settings and permissions. Earlier, we gave you permission to read the directory.

All these permissions are in the /permissions command, and you can see, respectively, the read command, and you can manually add, for example, new rules for write and path. The rules are described in the documentation, but in this case you get information about what is available. At the same time, there are what is allowed, what needs to be asked, what is forbidden, and rules for a specific workspace.

These rules are again edited if you suddenly see that something is no longer needed and can be deleted from here. The second thing that is important is settings. The config has an additional autocompact to more compactly display output, show tips, respectively, checkpoint, code, more detailed output is, verbose output, theme, including notifications, output style, and model.

Here you can set up the model that you will work with, either Sonnet or Haiku. In this case, since we have a paid plan, it has quite a good Sonnet, you can use it all the time, if you are not limited to the current use. If you need simple tasks, you can switch to Sonnet. You can also do this using the /model command and, accordingly, after the model, specify the specific model that will currently be used in this session.

So if you suddenly run out of tokens, you can try changing the model. Opus is not displayed here, because in this case you need to upgrade to the maximum rate, which costs $ 100. So, we have sorted out the settings for you.

By the way, you can exit Claude Code by pressing Ctrl-C twice. 

How do I add facts to the Claude Code memory?

And let's start writing code directly with you and see what we can do exactly in Claude Code. How do we now add something to the memory that we want it to observe?

Of course, we can edit our CLAUDE.md file, or use the # shortcut, which we want to tell you that when updating contracts, you must always raise the version in package.json contracts. This is a fact. The fact will be saved either in Project Memory or in User Memory.

Project Memory vs User Memory

The difference between them is as follows. User Memory applies to all projects that you will work with in Claude Code. If you provided this information in one project, it will be used in all other projects.

If in Project Memory, it is updated in CLAUDE.md, which is located directly in the project. You can edit all your memory by going to .claude.md and in this case, configure this for all projects.

When updating contracts, raise the version in package. json. It is added internally so that you can refer to it in the future. Accordingly, the grid and add some memory.

 

Working Modes: Thinking Mode, Accept All, and Plan Mode

Claude Code also has several modes of operation. And let's look at the first switch. This is a TAB that turns on or off deep thinking mode. Accordingly, the deep thinking mode will allow you to solve problems better, but it costs more tokens.

In practice, I usually use the normal mode. I don't need Thinking Mode. The second way to switch is via Shift+TAB.

Shift+TAB first enables us to respectively Accept All Edits, meaning it will automatically accept whatever it does. And Plan Mode.

How does Plan Mode work in practice?

Plan Mode shows us the plan first and only then implements it. Let's first try to implement a small task in Plan Mode.

You need to add new attributes to the Agent. Ability to view images, True-False, and ability to view files, True-False. Well, because these are additional costs and it is necessary that on some agents this is important, some are not.

Press Enter. So, we have Plan Mode enabled. It won't do anything except schedule. Accordingly, it is now studying the current structure, looking at Prisma, looking at the entire result, and issuing an implementation plan that we can agree with, or even correct. Plan Mode is good when you really have a difficult task. And you need to make a detailed plan and coordinate it with you before you directly rush into the code and implement it.

Of course, even with normal work, they will always analyze, make a plan and implement it, but here they will show you the plan, and here you can discuss with them whether it is worth doing or not, and how expensive it will be at the moment. Great, he has the full picture, and he asks a few clarifying questions even to understand the plan.

So, how to designate by default? Accordingly, it suggests how to add, respectively, both True by default, both False by default. I suggest that both should default to False. Great.

Do I need to pass these fields to Agent Create Event and Agent Update Event? Yes, of course, they are needed. What are the names of these fields in the database? Let's call them Can, because they are not Is, but CanViewImage, CanViewFiles. I agree.

And now, accordingly, Submit Answers. Thanks to clarifying questions, they will be able to get feedback from you on how best to do this, so that you don't ask them to redo it later. So Plan Mode is good for really difficult tasks, and you need to discuss this with him.

Final plan and its implementation

So, he has the necessary information, and now he gives us the final plan. Let's see what happens next. So, an update to the Prisma schema it offers. Good. Updating the contract and raising the version, because you told them to raise the version. Updating Entities.

Yes, updating the converter, of course. Adding field initialization, processing field updates. Awesome Both validation and testing. Well, run the migration, check the TypeScript compilation. Okay

We can now either AutoAccept or Manually Approve Edit, respectively. So let's click Yes. After that, it will switch to edit mode. It will first create a To-Do-List.

By the way, for each change, it shows a piece of what was changed, shows what is a plus sign, what is a minus sign, so that you can accept this change, understand it and, if anything, correct it in the future. So, we got the result.

Code review of the result: always check and commit

But I will never tire of repeating that the result, in fact, does not mean the correct decision. Yes, he launched it, checked that we had a problem, but still, as a developer, you need to conduct a code review. For example, you can use git status to get a list of changes.

This is NeoVim, an AstroVim build that has all this functionality. So, what have we changed? The Create and Update commands have changed their schema, which is true. The agent schema has changed accordingly, that's right. In Packages, it raised the version as we asked. Added two new fields to Prisma.

Now we have added this part to the agent handler, respectively. Here, too, everything is absolutely correct. It is clear that it found, in principle, all the places that required displaying Can View Images and other parts, and now it is displayed correctly. Excellent.

We have implemented the implementation and checked that it is correct. And my recommendation, after any change that satisfies you has been made, always commit. This will allow you to then iteratively easily restore all the changes that you had and made by AI. Because the further you ask them to do complex tasks, the more likely they will have a result that is not so correct, and therefore you will have to go back to the previous commits at some point. So always check what it does and commit.

Despite the fact that AI technologies are already firmly embedded in our lives, you still need to know in detail how the technology works, what the syntax of the language is, how to work with it, and how to properly architecturally approach application design.

How does the context work in Claude Code and why do you need to monitor it?

We continue. Now let's talk about the context within the session. When you ask to make some changes, it puts all the necessary project data in the context, its changes and the context gradually increases.

To view the context, you can call the /context command, which displays information about the current use of the context. Here you will see how many tokens the system prompt has taken, how many system tools, memory files, and messages that accumulate during your current session and communication, as well as free space, respectively. What happens when your context ends? Claude under the hood will do the so-called autocompact.

It will take and make a summary from your current context, reducing it to a small summary of what we did there, added this function, this function, this, and as a result, we got some information. Accordingly, your free context will be released again, and you will be able to use it. Here it is important to note that if your context already reaches a certain size, for example, you have almost all the cells filled, then you will have autocompact triggered in the next prompt.

These are problems when, for example, this is the middle of a new commit. You want to implement some big new feature, but you realize that your context is already loaded. If you do this, it will make an autocompact, but it will do so at a time when it is, for example, in the middle of a feature, and this may affect the quality.

/compact command: manually compressing the context

So if you want your current context to shrink, there is a separate command called /compact. It compresses our summary accordingly in the context, and accordingly we can execute it as /compact or /compact with instructions. Compact now takes the entire conversation, makes it a compact summary of what was done, also spends a certain number of tokens, and we can see how the context changes after I make Compact.

My recommendation is that if you are running out of context, it is better to monitor it. By the way, you can even ask Claude to display the current remaining context at each commit, as far as it is free. If, accordingly, there is not enough of it left, where 90-94% is occupied, then it is better to manually make Compact before moving on to the next big task. This way you will improve the quality of the final result that will be issued, because it will have more free memory, its tokens that it can use, and, accordingly, it can already work with it without problems.

So, he made Compact, in this case, let's now check the context, and we will see that now we have our entire context compressed to small, respectively, parts of memory. We have a lot of free time, 64%, and we can make complex changes. The second important aspect is the context.

When should I use /clear, /reset, and /new?

If you understand that you want to implement a new feature that is completely unrelated to previous changes, then you can do /clear or /reset or /new, which completely frees up our entire context. This is good when, for example, you have worked with one feature, everything, now you need to solve another bug that is not related to the previous one, clear it, this will save you tokens, which, accordingly, you can use, and this will allow you to work more efficiently with the new task. It will not be overflowing with the old context that is no longer needed, so manually make compact if it is not enough, check how much context you have, and also start new sessions each time if you are working on a different task.

 

How do I monitor my token usage? The /cost and /usage commands

To monitor the cost, there are two commands - /cost and /usage. /cost is useful if you use an API request, but in my case it says that I'm on a Pro Subscription, so everything is enabled. But /usage can be useful in order to understand how much you have left.

Now I have in the current session, which will be busy at 3 PM, well, respectively, after 2 hours, I used only 35%, I still have 65% left to use. Also, as it turned out, there are restrictions for the week, despite the fact that you have a current session, there are still restrictions for the week, which are also somehow limited. Well, Opus, if you have it, then it is.

This is located in a separate Usage tab, so monitor, again, in practice, the simplest models, of course, will not be enough for you to code without interruption, so it is important to manage the context and clear it in a timely manner.

 

How do I transfer complex promptas via files?

Now what to do if you have a very large promptand it's not super convenient to write it here, edit it, and so on. You can create a new file somewhere, for example, in the docs folder. Let's say we want prompt-image-description.

This is what we want promptin order for us to implement Description. Now you can safely write here that you need to call the Describe Image function from gRPC when receiving an image from a user via any channel and save the description data in a field in the database. Messages in, for example, Image Description.

This description is returned from gRPC. If you have sent multiple images, save a description of several of them there. Also, when sending a message, add this description to the user's Message with the prefix "User attached an image".

Well, accordingly, here you can already edit, add it, whatever you want. Accordingly, we have made the promptth that we need. Now we can also do this via @, as we usually specify docs and, accordingly, prompt. Prompt after you use the file — here it is, image-description. Great. After that, we actually passed on what we needed to do.

Therefore, if you have a complex task where you first need to think about how to describe the task, how to make an architecture, I recommend that you still implement it through separate promptfiles. You can delete them at the end, but you don't need to store them. It is important that as a result, they understood the task and moved on to its implementation.

 

What are sub-agents and why is this a unique feature of Claude Code?

How it will perform, let's see further, how we can now use sub-agents after that. So, he implemented it for us, not directly super-perfect, there are places where you can improve the code, but let's see how sub-agents can help us improve the code. A sub-agent is an additional feature of Claude Code that neither Cursor nor anyone else has.

This is an opportunity to create your own mini-agents that focus on a single feature. Their big advantage is that they have their own separate context, so we don't get into the problem of clogging up the context, and they are focused on one specific function, so they make it better. In order to work with agents, we need to go to /agents, and we can create a new agent using Create New Agent.

Creating an agent for code review

Agents can also be either project-based or personal, and then they will apply to all projects. Let's make a project agent and, accordingly, generate it using Claude. This is recommended, and it describes it more precisely.

In fact, the agent will be automatically assigned tasks if it matches our agent's goal. Let's say we create an agent with you, an agent that conducts code reviews of changes made and issues recommendations for improvement, taking into account the security, quality of the code, and its style. Well, in general, Enter.

You could just write something like, an agent that makes code reviews, but if we want something specific from it, now Claude will make a description of this agent, and we can use this agent, either explicitly specifying or specifying something in the prompt that striggers it. In this case, this agent that makes the code review will trigger the code review accordingly. In addition, we can hang it on teams.

We'll talk about the teams a bit further. After he finishes, we will, accordingly, get the opportunity to use it, and he will also offer us to choose its color.

Configuring torsos and models for the agent

So, the agent is ready. Now we can allow it to use certain tools. In this case, I let him do whatever he wants.

Although, in fact, we can remove Edit, because we don't need it to edit anything. It can execute Lint, probably yes, but Edit is probably not needed. Continue.

Now we can choose the model accordingly. Again, you can inherit from the main one, you can use Sonnet, so let's use Sonnet. Select its Preview, let it be Purple.

Great. And now we see, in fact, its description. This is a code reviewer. It is created in daddy .claude/agents. Accordingly, agents are nothing more than markdown files describing what they do. A list of tori that can. Model. Its description. By the way, this is the code that is written in Modify, the system prompt.

Enter. Save it. Now we have our first own agent, a code reviewer.

 

How does the sub-agent conduct code reviews in practice?

Now let's ask him to do it, make a code review of the changes. Now it analyzes what needs to be done. And if he understands that here it is necessary to invite the agent that we created to do this, then the agent will be used.

In agents, we can explicitly pass, write, which next agent will need to pass these changes. Now he will choose for some time, respectively, the Plan Mode he uses. And, accordingly, will pass it to this agent. Let's see how he works it out. In this case, he had to explicitly specify that he should use the reviewer's code for this purpose. When a sub-agent is initialized, it reflects its own color.

And, accordingly, it will now execute all the instructions specified in the sub-agent. Sometimes the trigger works automatically to attract an agent, respectively, or you can explicitly specify its name, respectively. In this case, the code reviewer will now look at all the changes and give you what happened, what changed, and how much you can improve our code.

Code Review result: critical bugs and improvements

So, he did a code review. Let's look at the result. Accordingly, critical errors. Naming convention, image-description, use-snake-case. We use it everywhere in Prisma, scheme, contracts, and so on.

Then SQL image-processing, respectively, images are processed one by one. In a loop, this is inefficient, you can use Promise. all for parallelism, the correct solution. Hard-coded values, gbt-mini model, hard-coded, must be made configurable, yes.

Missing error-context, error-logging doesn't include which URL failed, respectively, ok. No rate-limiting, rate-limiting should be added, I agree. Important improvements, code-duplication, code duplication, missing-url-validation, and type-safety-issues, respectively, are positive aspects.

After that, he offers to solve them immediately, you can add something to it, and I also need to do this, for example, he did not use the pattern in one place, which can be improved. Here you can tell him, OK, I agree, do points 2, 3, 4, 5 and some other things, and get a solution already. Therefore, sub-agents are well specialized for a specific task, and if they are properly configured, you can get quite effective work with your project. We can also automate agent calls or any other commands using custom slash commands.

 

 

Sources

Anthropic-Claude Code, official documentation: https://docs.anthropic.com/claude-code

Anthropic-Claude Code Sub-Agents, creating and configuring user agents.

Anthropic — Claude 4.5 Sonnet / Opus, model specifications and pricing plans.

Visual Studio Code Marketplace — Claude Code Extension.

INFOQRAF Founder & Digital Strategist at Infoqraf | Empowering Your Tech Journey ​Body Text: "Hi, I’m the creator of Infoqraf, a platform dedicated to simplifying the complex world of technology through data-driven insights and visual storytelling. With a passion for Artificial Intelligence, digital productivity, and emerging tech trends, I started this project to help users navigate the rapidly evolving digital landscape. ​At Infoqraf, my mission is to transform 'dry' technical data into actionable knowledge. Whether it’s finding the best AI tools to automate your workflow or providing step-by-step guides to solve digital challenges, I focus on delivering content that is both high-quality and easy to digest. ​With years of experience exploring the intersection of software and efficiency, I am committed to bringing you the most accurate, up-to-date, and 'infographic-style' tech reviews. Let’s build a smarter, more productive digital future together."