8/10/2025

How to Actually Manage Context When You're Deep in a HUGE Coding Project with Claude

Hey there. So, you're working on a massive project, I'm talking thousands & thousands of lines of code, & you're using Claude to help you out. Pretty cool, right? It feels like you have a super-smart junior dev on your team who never gets tired. But then you hit a wall. Claude starts getting… forgetful. It suggests things that make no sense, breaks patterns you established hours ago, or just seems completely lost.
Sound familiar?
Honestly, the problem isn't Claude. It's context. Or, more accurately, a lack of it. I've been down this road, spending weeks on a 7,000-line project with Claude, & I've learned a TON. It turns out that the single most important thing for getting good results from an AI coding assistant is giving it the right information at the right time.
This isn't just about cramming a bunch of files into a prompt. It’s a whole new way of thinking about your development workflow. So, let's break down how to manage context like a pro, so you can stop fighting the tool & start building amazing things.

The Golden Rule: Context is EVERYTHING

Think about it. When you bring a new human developer onto a project, you don't just throw them at a random file & say "go." You'd give them the design doc, explain the architecture, point them to the right libraries, & tell them about the team's coding conventions.
Claude is no different. It’s a powerful tool, but it can’t read your mind. It only knows what you tell it. The core principle is simple: Claude performs SIGNIFICANTLY better when it has relevant context.
This sounds obvious, but its implications are huge. It changes how you structure your project, how you write documentation, & even how you talk to the AI. Every time Claude makes a mistake, ask yourself: "What piece of context was missing that could have prevented this?"

Setting the Stage: Your Pre-Coding Ritual

Good context management starts before you write a single line of code. Getting this part right will save you countless headaches down the line.

Start with a Design Doc (Seriously)

I know, I know. For many of us, design docs are an afterthought, something you rush to finish after the code is done. But here's the thing: in the age of AI coding, the design doc is your new best friend. It’s not just for humans anymore; it’s for your AI assistant, too.
Writing a high-level design doc first forces you to clarify your own thinking. More importantly, it gives Claude the same starting point as you. It's a way to align your vision with the AI's understanding from day one.
Your design doc doesn't need to be a 50-page formal specification. A simple Markdown file is perfect. Here's what I usually include:
  • High-Level Goals: What are you trying to build? What problem does it solve?
  • Key Features: A bulleted list of the main functionalities.
  • Constraints & Requirements: Are there specific platforms, performance targets, or limitations to consider?
  • Tech Stack Choices: What languages, frameworks, & major libraries are you planning to use? Explain why you chose them. For example, "We're using React with TypeScript for the frontend to ensure type safety & component reusability."
  • Architectural Overview: A brief sketch of the main components & how they'll interact. Think "frontend communicates with backend via a REST API."
This document becomes the foundational context for your entire project.

The Magic of
1 CLAUDE.md

Anthropic created a pretty cool feature for their Claude Code tool: a special file called
1 CLAUDE.md
. When you start a conversation in a directory with this file, Claude automatically pulls its contents into the context. This is HUGE.
Think of it as a living cheat sheet for your project. It’s the perfect place to put all the little details that are easy to forget but crucial for consistency. Here's a great checklist for your
1 CLAUDE.md
:
  • Core Files & Utilities: A list of the most important files & what they do (e.g.,
    1 src/utils/auth.js
    • handles all user authentication logic).
  • Common Commands: How do you run the project? How do you run tests? Put the exact commands here (
    1 npm run dev
    ,
    1 pytest -v
    ).
  • Coding Style Guidelines: Tabs or spaces? CamelCase or snake_case? Are there specific linting rules?
  • Repository Etiquette: How should branches be named (
    1 feature/new-thing
    )? Do you merge or rebase?
  • Setup Instructions: A quick guide for getting the developer environment running.
This isn't a "set it & forget it" document. As your project evolves, you need to keep it updated. I once spent an hour fighting with Claude because it kept suggesting an old logging library. I finally realized my
1 CLAUDE.md
still referenced it. I updated one line in the file, & boom, Claude was back on track. The cool part is, you can even ask Claude to help maintain it: "Please update
1 CLAUDE.md
to note that we now use library X for logging."

Structuring Your Project for AI Collaboration

How you organize your files can make a massive difference in how easily Claude can understand your project.

Embrace the Monorepo

If your project has multiple parts, like a frontend & a backend, resist the urge to split them into separate repositories. A monorepo—where both components live in the same root directory—is a game-changer for working with AI.
When Claude can see both the frontend & backend code, it can make much smarter suggestions. It understands the full picture. It can trace how an API endpoint in your backend code is consumed by your frontend, ensuring they stay in sync. Trying to get that level of coherence when working on two separate projects is a nightmare of copying & pasting files back & forth.

Modularity is Your Best Friend

This isn't new advice, but it's more important than ever. Break your code into small, single-responsibility files & functions. A 1,000-line file is hard for a human to parse, & it's just as hard for an AI.
Small, modular files make it much easier to provide specific, relevant context. Instead of feeding Claude a massive file, you can give it just the three or four small modules it actually needs to work on a specific feature. This leads to more accurate results, uses fewer tokens (which can save you money), & is just good coding practice anyway.
This also applies to your customer-facing knowledge base. Imagine trying to build a support system. If all your help articles are in one giant document, it's messy. But if they're broken down into clear, specific topics, it's much more manageable. That's actually how a tool like Arsturn works best. When you build a no-code AI chatbot with Arsturn, you train it on your own data. The more organized & modular that data is—like a clean set of FAQs & help docs—the better the chatbot will be at providing instant, accurate answers to your website visitors 24/7. The same principle of clean, modular information applies to both coding with an AI & building a great customer service chatbot.

The Art of the Prompt: Your Day-to-Day Workflow

Okay, your project is set up. Now, how do you actually work with Claude on a daily basis without losing your mind?

Keep Your Chats Short & Focused

This is a big one. Do not let any individual chat with Claude get too long. Think of each chat thread as a short, focused task. If a conversation goes on for too long, with lots of code changes & revisions, Claude WILL get confused. It loses track of the "state" of your code.
Here’s a better workflow:
  1. Start a new chat for a specific task (e.g., "Implement the user login form").
  2. Provide the necessary context: "Here are the files
    1 auth.js
    ,
    1 api.js
    , and
    1 LoginForm.jsx
    . I need to build a login form that calls the
    1 /login
    endpoint defined in
    1 api.js
    ."
  3. Iterate with Claude until the feature is working.
  4. Once the code is in your local files, start a new chat for the next task.
This frequent resetting prevents context drift & ensures Claude is always working with the latest version of your code.

Don't Just Tell, Show

When you're adding a new feature that's similar to an existing one, don't just describe it. Show Claude an example.
For instance: "I want to create a new API endpoint for updating user profiles. It should follow the same pattern as our existing endpoint for creating users. Here's the code for the
1 createUser
endpoint in
1 userController.js
."
This helps Claude maintain a consistent style & structure across your codebase. It stops the AI from "drifting" & introducing new, inconsistent patterns.

The "Read, Plan, Implement" Workflow

For more complex tasks, don't just ask Claude to "fix the bug." Guide it through a more structured process. This is a common workflow for agentic coding tools like Claude Code.
  1. Read: Tell Claude to read the relevant files first. "Read the files that handle logging & user authentication. Don't write any code yet, just tell me what you find."
  2. Plan: Ask Claude to create a step-by-step plan. "Okay, now make a plan for how to add detailed logging to the authentication flow." This lets you review the AI's approach before it starts writing code, catching potential misunderstandings early.
  3. Implement: Once you approve the plan, give it the green light. "That plan looks good. Now, implement the solution in code."
This methodical approach gives you more control & leads to MUCH better outcomes on complex problems.

Advanced Techniques & Tools

When you're ready to level up, there are some more advanced ways to manage context.

Using Multiple Claudes

Here’s a simple but powerful idea: use two different Claude instances (or two separate chat windows). One Claude is the "writer," & the other is the "reviewer" or "tester."
  • Claude #1: Writes the initial code for a feature.
  • Claude #2: You give it the code from the first Claude & ask it to review it. "Review this code for bugs, style issues, or potential edge cases."
  • Claude #3 (or back to #1): You take the feedback from the reviewer & ask it to edit the original code.
This simulates a pair-programming environment & can help catch errors you might have missed. It works because each instance has a separate, clean context focused on a single task.

Claude Code & The Command Line

For power users, Anthropic's Claude Code is a command-line tool that gives you a more "native" way to integrate the AI into your workflow. It’s designed to be low-level & flexible, letting you script & customize how it works.
With Claude Code, you can do things like:
*Pipe data directly into Claude:
1 cat error.log | claude "What's the most common error in this log file?"
This is great for analyzing large text files.
  • Create custom slash commands: You can create your own commands to automate repetitive tasks. For example, you could create a
    1 /project:fix-github-issue
    command that reads a GitHub issue, finds the relevant files, implements a fix, runs tests, & creates a pull request.
  • Use it inside your IDE: Tools like VS Code or Cursor let you integrate the terminal directly, so you can see your files & interact with Claude Code in the same window.

The "Claude Projects" Feature

Claude also has a "Projects" feature in its web UI. This lets you create a dedicated space for a project where you can add background info & upload files. However, many users find it a bit manual compared to other tools. You often have to copy & paste important context from your chats into the project's background info section to keep it "remembered." While it can be helpful, for large, dynamic coding projects, the
1 CLAUDE.md
& short-chat-thread strategies often prove more effective in the long run.

Final Thoughts: You're the Architect

Here’s the thing: working with an AI like Claude on a big project is a skill. You're not just a coder anymore; you're a context architect. You're the one responsible for creating & maintaining a shared understanding between you & your AI partner.
Treat your project's context as a first-class citizen. Nurture it. Keep it clean & up-to-date. The more effort you put into providing clear, accessible context, the better your results will be. It's the difference between having a confused intern who constantly needs hand-holding & having a brilliant co-pilot who helps you build better software, faster.
And this principle extends beyond just code. Whether you're building software or building a business, clear communication & accessible knowledge are key. It’s why businesses use tools like Arsturn to build custom AI chatbots. By training a chatbot on their specific business data, they create a source of instant, reliable context for their customers. This helps businesses build meaningful connections with their audience through personalized chatbots that can answer questions, generate leads, & improve the overall customer experience. It’s the same idea: good data in, great results out.
So yeah, start thinking like a context architect. Write that design doc. Meticulously maintain your
1 CLAUDE.md
. Keep your chats focused. Your future self (and your sanity) will thank you for it.
Hope this was helpful! Let me know what you think.

Copyright © Arsturn 2025