All articles

Engineering

Claude Code Part 2: How It Actually Works — Context, Skills, Agents, MCP and Prompt Caching

Go beyond the basics of Claude Code and explore how context, CLAUDE.md, Skills, subagents, MCP, hooks, and prompt caching work together to create smarter, more efficient AI-assisted software development workflows.

SolvixSystemsAI Engineering· Admin August 18, 2026 18 min read
Claude Code Part 2: How It Actually Works — Context, Skills, Agents, MCP and Prompt Caching

Claude Code Part 2: How It Actually Works — Context, Skills, Agents, MCP and Prompt Caching

In Part 1, we looked at what Claude Code is and why AI coding agents are becoming such an important part of modern software development.

But once you start using Claude Code on a real project, another question quickly comes up: How does it actually manage to work on a large codebase without everything becoming one huge prompt?

That's where things get much more interesting.

Claude Code is not just Claude sitting inside a terminal and generating code. It has tools, project instructions, context management, Skills, subagents, MCP integrations, hooks, permissions, and other capabilities that allow it to work more like an actual development agent.

In this second part, we'll go behind the scenes and look at the pieces that make Claude Code useful for real software projects.

Claude Code Is Really About the Workflow

When people first see Claude Code, the easiest assumption is that it is simply another AI that writes code.

That description is not completely wrong, but it misses the most important part.

The interesting thing about Claude Code is what happens after you give it a task.

Suppose you tell it:

"Users are getting an error when they try to reset their password. Find the problem, fix it, and make sure the existing tests still pass."

A normal code-generation tool might give you a possible fix.

Claude Code can approach the task differently. It can look through the project, find the authentication code, inspect the password-reset flow, check related files, look at tests, make a change, run commands, and then use the results to decide what to do next.

That repeated process is the part that makes it feel more like an agent than a traditional coding assistant.

Claude Code doesn't just generate an answer. It can investigate, act, observe the result, and continue working.

The Agentic Loop in Simple Terms

You don't need a complicated AI background to understand the basic idea behind an agentic coding workflow.

Think about how an experienced developer would normally solve a bug.

  1. First, they try to understand the problem.
  2. Then they look for the relevant code.
  3. They make a change.
  4. They run the application or tests.
  5. They look at what happened.
  6. They make another change if necessary.

Claude Code follows a similar general pattern.

  1. Understand the task
  2. Explore the project
  3. Choose the right tools
  4. Make changes
  5. Run and inspect the result
  6. Adjust if something is wrong

The important word here is loop.

The agent does not necessarily stop after making the first change. If a test fails, it can investigate that failure and continue.

That feedback loop is what makes agentic development much more interesting than simple code completion.

Tools Are What Give Claude Code Its Hands

A language model is very good at understanding and generating information, but it cannot do much inside a software project unless it has a way to interact with that project.

That's where tools come in.

Claude Code can use tools to work with the environment around it. Depending on the task and permissions, this can involve things such as:

  • Reading project files
  • Searching through the codebase
  • Editing files
  • Creating new files
  • Running terminal commands
  • Running tests
  • Working with Git
  • Investigating errors
  • Using connected external tools

This changes the developer experience quite a bit.

Instead of copying a file into an AI chat and asking, "What's wrong with this?", you can give the agent a higher-level goal and let it inspect the relevant parts of the project itself.

Of course, that doesn't mean you should give an AI unrestricted access to everything. Permissions and human review are still important, especially when working with production systems.

Context Is One of the Most Important Parts

If you've worked with AI coding tools for a while, you've probably experienced this problem:

At the beginning of a conversation, the AI seems to understand everything perfectly. After a very long conversation, however, things can become less focused.

That's where context becomes important.

Claude's context contains the information it needs while working on a task. This can include the conversation, instructions, files it has inspected, command output, and other information available to the session.

The more information you put into a session, the more context is consumed.

This is why throwing an entire huge codebase into every conversation isn't necessarily the best approach.

Good AI development is not only about giving better prompts. It's also about giving the AI the right context.

What Happens When a Claude Code Session Gets Large?

Long development sessions can accumulate a lot of information.

Imagine spending several hours asking Claude to investigate a project, implement a feature, fix tests, review the code, and then improve the implementation.

The conversation can become very large.

Claude Code has mechanisms for handling this, including automatic context compaction.

In simple terms, older parts of the conversation can be summarized so the session can continue without keeping every previous message in full detail.

Developers can also manage their context themselves.

  • /context can help inspect context usage.
  • /compact can be used when you want to summarize the current conversation.
  • /clear is useful when you're moving to a completely different task.

This may sound like a small feature, but it becomes important when you're using an AI agent for several hours on the same project.

CLAUDE.md: The File That Gives Claude Project Knowledge

One of the simplest ways to make Claude Code more useful is to give it persistent project instructions.

This is where CLAUDE.md becomes useful.

Instead of telling Claude the same things every time, you can put important project-specific information in this file.

For example:

  • How the project is structured
  • Which package manager the team uses
  • How tests should be run
  • Important coding conventions
  • Architecture decisions
  • Database rules
  • Deployment instructions
  • Things that should not be changed

Imagine you're working on a Next.js application and your team has a very specific development process.

You could have something like:

# Project Instructions

- Use pnpm for package management.
- Run the relevant tests after making changes.
- Follow the existing API patterns.
- Do not modify production environment variables.
- Reuse existing authentication utilities.
- Keep business logic out of UI components.

Now you don't need to repeat those rules in every conversation.

This is one of the things that makes Claude Code more practical for teams. The AI can be given a consistent understanding of how the project is supposed to work.

Don't Put Everything in CLAUDE.md

There is an important detail here.

It can be tempting to keep adding more and more information to CLAUDE.md.

Eventually you can end up with a massive instruction file containing deployment documentation, API specifications, coding rules, testing procedures, database documentation, and everything else about the company.

That isn't necessarily a good idea.

A better approach is to keep the core instructions focused and move specialized knowledge into the appropriate places.

For example:

  • CLAUDE.md for important project-wide instructions.
  • Rules for more specific project areas.
  • Skills for reusable workflows and specialized knowledge.
  • Subagents for specialized tasks.

This keeps the AI environment easier to maintain as the project grows.

Claude Code Skills: Reusable Knowledge Instead of Repeating Prompts

This is one of the features that becomes especially interesting for development teams.

Think about a task that your team performs repeatedly.

Maybe every release requires the same set of checks:

  1. Run tests.
  2. Check the build.
  3. Review environment variables.
  4. Check the migration status.
  5. Review the Git changes.
  6. Prepare the release.

You could explain this process to Claude every time.

Or you could turn that knowledge into a reusable Skill.

Skills allow teams to package instructions, reference material, and repeatable workflows so Claude can use them when they are relevant.

Some practical examples could include:

  • Deployment workflows
  • Code review procedures
  • Security reviews
  • Database migration workflows
  • Testing standards
  • API development guidelines
  • Release procedures

This is where AI development starts moving away from individual prompting and toward team-level AI workflows.

Subagents: Let Claude Delegate the Work

Another useful concept is the idea of subagents.

Let's say you're working on a large application and want to understand how authentication works.

You could ask the main Claude session to investigate everything. But that investigation might involve reading a lot of files and producing a lot of intermediate information.

A subagent can be useful for this kind of specialized task.

You can think of it as giving a smaller assignment to another developer:

"Investigate the authentication system and tell me how login, refresh tokens, permissions, and session handling work."

The subagent can perform the research in its own context and return the useful findings to the main session.

This can be helpful because the main conversation doesn't have to carry every piece of intermediate investigation.

For larger projects, this becomes a practical way of breaking complex work into smaller pieces.

MCP: Connecting Claude Code to the Outside World

So far, we've mostly talked about Claude working with your codebase.

But real businesses don't only have code.

They have databases, project management tools, internal APIs, documentation, communication platforms, cloud services, and many other systems.

This is where Model Context Protocol, or MCP, becomes useful.

MCP provides a standardized way to connect AI applications with external tools and data sources.

For example, a development team could potentially connect Claude Code to systems such as:

  • Databases
  • Internal APIs
  • Documentation systems
  • Project management platforms
  • Browser tools
  • Business applications
  • Other developer tools

This means the agent doesn't have to stop at the boundaries of your repository.

With the right setup and permissions, it can participate in workflows that involve the wider development environment.

For businesses, this is potentially a much bigger opportunity than simply generating code faster.

Hooks: Making Repetitive Actions Automatic

Another feature that can be useful in a serious development workflow is hooks.

The easiest way to understand hooks is to think of them as automatic actions that happen when certain events occur.

For example, a team might want to automatically run a check after Claude changes some files.

Hooks can be used for workflows such as:

  • Running formatting checks
  • Running tests
  • Performing validation
  • Triggering scripts
  • Sending notifications
  • Starting other automated workflows

This is useful because you don't have to rely entirely on Claude remembering to perform every repetitive step.

You can build parts of the workflow into the environment itself.

Prompt Caching: Why Repeated Work Can Be Faster

There's another concept that developers working with AI APIs should understand: prompt caching.

Claude Code often works with a lot of information that stays the same between requests.

For example, the beginning of a request might contain project instructions, tool definitions, and other relatively stable context.

It would be inefficient to process all of that from scratch every time.

Prompt caching allows reusable parts of the prompt to be cached so they can be reused across requests when the relevant prefix remains the same.

Stable information can be reused instead of being processed from scratch on every request.

For developers and businesses using AI heavily, this can matter because it can improve efficiency and reduce the cost of repeated processing.

The good news is that Claude Code handles much of this automatically. You don't normally need to build your own caching layer just to use Claude Code effectively.

Why Context and Caching Should Be Considered Together

Context management and prompt caching solve different problems, but they are closely related.

Context management is about making sure Claude has the right information without unnecessarily filling the session.

Caching is about reusing information that hasn't changed.

So, in a practical development workflow:

  • Keep important project instructions organized.
  • Don't keep unrelated conversations alive forever.
  • Use Skills for reusable specialized knowledge.
  • Use subagents when a task requires a lot of research.
  • Use compaction when a long session needs to continue.
  • Let stable context benefit from caching.

These aren't things most developers need to think about every minute, but understanding them helps explain why well-structured Claude Code projects tend to work better than projects where everything is thrown into one giant prompt.

Putting Everything Together

Now let's imagine you're running a software company with a large SaaS application.

You could structure your Claude Code environment something like this:

  1. CLAUDE.md contains the core architecture and development rules.
  2. Rules contain instructions specific to different parts of the project.
  3. Skills contain reusable workflows such as deployment and code review.
  4. Subagents handle specialized research or complex tasks.
  5. MCP connects the agent to approved external services.
  6. Hooks automate repetitive checks.
  7. Git keeps the work version-controlled.
  8. Tests verify that changes actually work.
  9. Human developers review important decisions and production changes.

At this point, you're no longer simply asking an AI to write code.

You've created an AI-assisted development environment.

And that's a much more interesting idea.

What This Looks Like in a Real Development Task

Let's say a business wants to add a customer subscription system to an existing SaaS platform.

Instead of asking:

"Build a subscription system."

A developer could give Claude Code a much more meaningful objective:

"Understand the existing billing architecture first. Find how users, organizations, and payments are currently modeled. Propose a subscription architecture that fits the existing codebase. Don't make changes yet."

Claude can then investigate the project.

Once the developer reviews the approach, they can continue:

"Implement the approved design. Add the required database changes, API endpoints, validation, and tests. Run the relevant test suite and report anything that still needs attention."

This workflow is much closer to how an experienced engineering team actually works:

  1. Understand.
  2. Plan.
  3. Review.
  4. Implement.
  5. Test.
  6. Review again.

The AI is doing a lot of the mechanical work, but the developer remains responsible for deciding whether the solution is actually the right one.

The Human Developer Still Matters

This is probably the most important point in the entire article.

The more capable AI coding agents become, the easier it is to assume that developers will eventually become unnecessary.

In production software, that's still the wrong way to look at it.

Someone needs to understand:

  • Why the product exists
  • What the business actually needs
  • Which architecture makes sense
  • What security risks exist
  • Which data should be protected
  • How the system should scale
  • What trade-offs are acceptable
  • Whether the implementation is actually correct

Claude Code can help with many of these tasks, but the responsibility for the final system should remain with the engineering team.

The strongest teams aren't necessarily the ones using the most AI.

They're the ones that know where AI provides leverage and where human judgment is still required.

What Developers Should Learn Next

If you're a developer moving into AI-assisted software development, learning how to write prompts is only a small part of the picture.

You should also understand:

  • How context windows work
  • How tool calling works
  • How agents make decisions
  • How to structure project instructions
  • How to build reusable Skills
  • How subagents can divide work
  • How MCP connects external systems
  • How permissions should be managed
  • How automated testing fits into agentic workflows
  • How to review AI-generated changes properly

These skills are becoming increasingly useful as software development moves toward more agentic workflows.

Final Thoughts

Claude Code becomes much easier to understand once you stop thinking about it as simply a tool that writes code.

The real value comes from the entire system around the model.

The agent can explore your project, use tools, follow project instructions, work with specialized Skills, delegate tasks to subagents, connect to external systems through MCP, automate parts of the workflow with hooks, and manage long sessions through context compaction and caching.

And yet, none of that removes the need for good engineering.

If anything, it makes good engineering practices even more important.

The future of software development isn't simply AI writing more code.



It's developers building better systems around AI so that the right work gets done faster, safely, and consistently.

That's where Claude Code becomes genuinely interesting.

Part 1 introduced the idea of AI coding agents.

Part 2 looked at the systems that make Claude Code work.

In the next part, we'll move from concepts to practice and explore how developers can structure a real Claude Code project, write effective project instructions, create reusable Skills, use subagents, and build a production-friendly AI development workflow.

Building a Software Product?

Whether you're starting a new SaaS product, modernizing an existing application, or looking for ways to introduce AI into your development workflow, the right architecture and engineering process matter.

Our software development team helps businesses design, build, modernize, and scale custom software using modern engineering practices and AI-assisted development workflows.

Talk to Our Development Team

Frequently Asked Questions

What is the Claude Code agentic loop?

It is the repeated process of understanding a task, gathering context, using tools, making changes, checking the result, and adjusting the approach when necessary.

What is CLAUDE.md?

CLAUDE.md is a project instruction file that can provide Claude with persistent information about the project's architecture, conventions, commands, and important development rules.

What are Claude Code Skills?

Skills are reusable instructions, knowledge, and workflows that Claude can use when a particular task requires them.

What are subagents?

Subagents are specialized agents that can work on tasks in separate contexts. They are particularly useful for research, specialized analysis, and breaking complex work into smaller pieces.

What is MCP?

MCP stands for Model Context Protocol. It provides a way for Claude Code and other AI applications to connect with external tools and data sources.

Why is context important in Claude Code?

Context determines the information Claude has available while working. Managing it effectively helps keep long development sessions focused and useful.

What is prompt caching?

Prompt caching allows reusable portions of requests to be processed more efficiently when the relevant context remains unchanged.

Can Claude Code replace software developers?

Claude Code can automate and accelerate many engineering tasks, but production software still requires human judgment around architecture, security, requirements, testing, infrastructure, and long-term maintenance.

Gemini_Generated_Image_yujs5uyujs5uyujs

Want to discuss your software project? Contact our team to discuss your requirements and development roadmap.

#Claude Code Part 2#Claude Code context#Claude Code Skills#Claude Code subagents#Claude Code MCP#AI coding agents#agentic coding#AI software development#prompt caching#Claude Code hooks

Have a project in mind?

Talk to the engineers who write these — plan your build with SolvixSystemsAI.

Book a Consultation