[0:00]Anthropic just updated their cloud code documentation with official best practices, and Boris, the creator of Cloud Code, recently shared his personal workflow and how the Cloud Code team uses Cloud Code every day.
[0:18]Best practices for context management, plan mode, verification strategies, compound engineering, Claude MD power tips, the interview technique, parallel sessions, sub agents, skills, and a whole lot more straight from the makers of Claude Code. Let me break this down into concrete tips you can apply to your workflows today.
[0:46]Hey, Alex here from Grit AI Studio. Today, we're going through Anthropic's official best practices for Claude Code, enhanced with what Boris and the rest of the Claude Code team actually does day-to-day. I figured we'll do a no fluff video, just straightforward. Here's what Anthropic says, here's what Boris says, and here's what the team does, and here's how you can apply it to yourself. If you're new to Claude Code, you should probably check out our getting started guide first. Be warned, this video is going to be jam packed with tips, so fasten your seat belts, we'll also add a cheat sheet for you to download in the comments below. Okay, let's go.
[1:28]Context is king, but also a scarce resource we really need to treat with care. Anthropic says this explicitly: Most best practices are based on one constraint: Claude's context window fills up fast, and performance degrades as it fills.
[1:47]This is the core insight. Everything else flows from here. Your context window holds everything, conversation history, file contents, command outputs, Claude MD, loaded skills, and system instructions. When it fills up, Claude starts forgetting earlier instructions, makes more mistakes. According to Anthropic, this is the most important resource to manage. So, how do you apply this? Check context regularly with slash context. Clear between unrelated tasks, and use sub agents for deep exploration. Manual summarization beats auto compact. Boris takes this even further. He runs five to ten parallel sessions. Plan with one, review with another. Clear between tasks. Instead of cramming everything into one long session, he keeps each focused on a single task. When context gets polluted, start fresh in another session. As Boris puts it, think of AI as capacity we can schedule, not a single conversational tool. Pro tip from Boris: Use three to five Git work trees or multiple Git checkouts to run parallel sessions on different branches simultaneously. This lets you explore multiple approaches or work on unrelated features without context collision. Also, track your context. Use slash status line to customize your status bar to always show context usage. This keeps the constraint visible so you never forget to manage it.
[3:16]Always make a plan. Anthropic recommends separating research and planning from implementation. Here's their exact workflow. Phase one, explore in plan mode. Enter plan mode with shift tab tab. Claude reads files, answers questions, but cannot make changes. Safe exploration. Phase two, plan. Claude produces a detailed implementation plan, you review it, ask questions, refine, iterate. Phase three, implement. Exit plan mode and start implementing. Now, Claude codes, it has context from exploration, it follows the plan you approved. A great plan means much better code output. And then phase four, commit. Anthropic adds one important caveat: Plan mode is useful, but also adds overhead. For tasks where the scope is clear and the fix is small, like fixing a typo, adding a log line, or renaming a variable, just ask Claude to do it directly. If you could describe the diff in one sentence, you can probably skip the planning. Boris has one strict rule here. Start every complex task in plan mode, no exceptions. And he takes this a step further. Plan first in plan mode, iterate with Claude until the plan is solid, then switch to auto accept with shift tab. His words, Claude typically executes in one shot, after a good plan. The planning prevents mid course corrections that waste time and context. Give Claude a way to verify its work. Anthropic says this is the single highest leverage thing you can do. Claude can check its own work. Without verification criteria, you become the only feedback loop. Every mistake requires your attention. Here are three verification strategies from the docs. One, include test cases. Two, visual verification. Three, root cause fixing. Personally, I use the Claude and Chrome extension for UI verification. It opens a browser, tests the UI, iterates until it works. But the core principle works everywhere. Give Claude something to verify against. Boris calls verification probably the most important thing to get great results. He uses the Chrome extension daily for UI testing. Claude iterates until it looks right and functions correctly. For him, verification isn't optional. Nothing ships without it. You don't trust, you instrument. The go fix pattern. Claude fixes most bugs by itself. When something breaks, don't over explain, just say go fix it.
[6:09]Trust the verification loop that you've set up. As we always say, context is king, but it's a precious resource. Anthropic provides specific before and after examples of how you can provide specific context to your prompts. Let me show you the pattern: scoping the task. Pointing to sources. Referencing patterns. Describing symptoms. The more precise your instructions, the fewer corrections you'll need. Anthropic lists several ways to give Claude context. You can reference files directly with at references. You can paste images by copy pasting or dragging and dropping into the prompt. You can give URLs for documentation and API references. And you can also pipe data in. You can tell Claude to pull context itself using Bash commands, MCP tools, or by reading files. Here are some advanced techniques to level up your prompting according to the Claude Code team. Specs reduce corrections. Write detailed specs and reduce ambiguity before handing work off. The more specific you are, the better the output. This ties directly into the interview technique, which we'll cover later. Use voice dictation. You speak three times faster than you type, and your prompts get way more detailed as a result. On Mac OS, hit the function key twice to activate. More detail is generally better output. But also remember, quality over quantity. Make Claude your reviewer. Say something like grill me on these changes and don't make a PR until I pass your test. Or prove me this works, and have Claude diff between the main and your feature branch.
[8:06]Our most valuable tool for consistent results and making Claude compound over time is Claude MD. We've done several videos on this topic already. Anthropic provides a clear table of what to include and exclude. Generally, you should include Bash commands that Claude can't guess, code style rules that differ from defaults, testing instructions and preferred test runners. Include repository etiquette, branch naming, PR conventions and so on. Architectural decisions specific to your project. And also include common gotchas or non obvious behavior in your project. And then generally exclude anything Claude can figure out by reading code. Standard language conventions Claude already knows, or detailed API documentation. You should link to the docs instead. Information that changes frequently generally stays out of Claude MD. Long explanations or tutorials do not belong in the Claude MD file. And there's no need for file by file description of the code base. Here's a critical insight from the docs. If Claude keeps doing something you don't want despite having a rule against it, the file is probably too long and the rule is getting lost.
[9:24]Keep your Claude MD file under 500 lines and prune ruthlessly. Boris and his team takes this seriously. The entire team contributes to the Claude MD file multiple times weekly. When Claude makes a mistake, they document it here. During code review, they tag Claude to update guidelines automatically. They make use of the GitHub app with the slash install GitHub action and they treat Claude MD as a living document that compounds value over time. Boris's golden rule which I wholeheartedly agree with, after every correction, end your prompt with update your Claude MD so you don't make that mistake again. This turns every mistake into a permanent improvement. Always think compound engineering.
[10:13]While Claude MD loads every session, skills load on demand. Create skills in your Claude skills folder for domain knowledge or repeatable workflows that don't need to be in every conversation. Boris recommends creating your own skills and committing them to Git, reuse across every project. Any pattern you repeat becomes a portable skill. The team even builds learning focused skills, like a space repetition skill, where you explain your understanding and Claude asks follow ups to fill gaps, and then stores the result. Skills are a super power will cover in depth in a separate episode. In brief, in the context of Cloud Code, you can think of two types of skills. One, auto invoked domain knowledge. Claude applies these when working in relevant areas. Two, workflow skills that you invoke with the slash command, repeatable multi step workflows. Run fix issue one two three four and Claude executes the whole workflow. Today, skills and slash commands are sort of the same thing, and you can use disable model invocation equals true for workflows that you want to trigger manually.
[12:52]Okay, use sub agents for investigation. Anthropic explicitly recommends this pattern. Since context is your fundamental constraint, sub agents are one of the most powerful tools available. So here's what happens. The sub agent explores in its own context window, reads dozens of files, and reports back a summary. Your main context stays clean. You can also use sub agents for verification after Claude implements something. Boris uses specialized sub agents for specific roles. Code simplifier for cleanup, verify app for end to end testing, build validator to ensure build pass, and code architect for design decisions. Think of them as team members with distinct responsibilities. Simply append use sub agents to any request where you want Claude to throw more compute at the problem. Or use slash commands to trigger sub agents that you've defined in your project. Offload individual tasks to sub agents to keep your main agent's context window clean and focused. With the newly introduced ask user question tool in Cloud Code, we all of a sudden got a really powerful technique that you should definitely adopt in your workflows. We call it the interview technique. This is brilliant, especially when you work on larger features. Have Claude interview you first. Start with a minimal prompt and ask Claude to interview you using the ask user question tool. Claude asks about things you might not have considered. Technical implementation, UI UX, edge cases, trade offs. And you can use this for so much more than coding. Once the spec is complete, start a fresh session to execute it. Clean context focused entirely on implementation. Let's talk about some common failure patterns to avoid. Anthropic calls these out explicitly. Here's what to watch for. The kitchen sync session. You start with one task, ask something unrelated, go back to the first task. Now context fills with irrelevant information. The fix is simple, use slash clear between unrelated tasks or fork. Correcting over and over. Claude does something wrong, you correct it, still wrong, correct again. Context is polluted with failed approaches. The fix. After two failed corrections, use slash clear and write a better initial prompt incorporating what you learned. A lot of the Claude Code team members also call out that they will enter plan mode again if Claude starts derailing or starts getting stuck. The over specified Claude MD. Too long, Claude ignores half of it because important rules get lost in the noise. The fix, ruthlessly prune. If Claude already does something correctly without the instruction, delete it or convert it to a hook. The trust then verify gap. Claude produces a plausible looking code that doesn't handle edge cases. Now, here the fix is to always provide verification. If you can't verify it, don't ship it. The infinite exploration. You ask Claude to investigate without scoping it. Claude reads hundreds of files, filling the context. The fix is of course to scope investigations narrowly or use sub agents. And here's a reality check from Boris. He admits he throws away 10 to 20% of Claude code sessions that go nowhere. And that's okay. Not every session succeeds. Parallel sessions, hedge against dead ends. Quick abandonments beats the sunk cost fallacy. The 80% that work more than compensate. The team points out that after a mediocre fix, you can say, knowing everything you know now, scrap this and implement the elegant solution. Claude often finds better approaches once it understands the problem space.
[17:08]Here are some quick tips from the docs on managing sessions. Course correct early. Hit escape to stop Claude mid action. Double tap escape or use slash rewind to open the rewind menu where you can restore previous state. You can also tell Claude undo that and Claude will revert its changes. And remember slash clear, reset context between unrelated tasks. Manage context aggressively. Use slash clear frequently between tasks and run compact with instructions for controlled compaction. I like to ask Claude to just put it in a markdown file and then reset with clear and then start over with that context file as your input. Okay, let's do some final rapid fire tips from the official docs and Boris's workflow. One, install CLI tools like GitHub, AWS, GCloud. Claude can use them for external services without rate limits. Two, the slash init command analyzes your code base to detect build systems, test framework, and code patterns. Use it. Three, add emphasis like important or you must in your Claude MD file to improve adherence to critical rules. Four, Claude MD can import files with at references. Keep the main file clean, details in separate files. Five, child directories can have their own Claude MD file. Claude loads them on demand when working in those directories. Number six, sessions are ephemeral. Claude doesn't learn preferences over time. Put persistent knowledge in your Claude MD file. And a special one from Boris, seven, always use Opus 4.5 or the latest model. Yes, it costs more per token, but Boris optimizes for cost per reliable change. The correction tax of weaker models hallucinations costs more than the model itself. And by now, you're probably on the max plan already, and if not, you should definitely consider it. By the way, Anthropic is not paying me anything to say this. Eight, any workflow you do multiple times a day should be a slash command or skill. Create your own skills and commit them to Git, reuse across projects. Any pattern you repeat becomes a portable skill. Number nine, use post tool use hooks for automatic formatting.
[19:49]After write or edit, run your form matter. That catches the last 10% without approval prompts. Number 10, never use dangerously skip permissions in production. Use slash permissions to pre approve specific safe commands instead. And also check out sandboxing with slash sandbox for OS level isolation. Sandbox defines upfront boundaries rather than bypassing all checks. This reduces interruptions while keeping you in control. And finally, make sure you don't get lazy. Keep learning with Claude. Enable the explanatory or learning output styles in slash config to have Claude explain the why behind its changes. Have Claude generate a visual HTML presentation explaining unfamiliar code. It makes surprisingly good slides. Ask Claude to draw ASCII diagrams of new protocols and code bases to help you understand them. Build a space repetition learning skill. You explain your understanding, Claude asks follow ups to fill gaps, stores the results.
[20:58]Now, one last thing from Anthropic's guide. These patterns and best practices aren't laws. Sometimes you should let context accumulate because you're deep in a complex problem. Sometimes skipping the plan is right because the task is exploratory. And sometimes a vague prompt is exactly what you need to see how Claude interprets the problem. Pay attention to what works for you. Over time, you'll develop intuition no guide can capture. The core message from Anthropic and Boris, context window is your most important resource. Give Claude verification criteria, test screenshots, expected outputs. Explore, plan, implement, commit. Be specific in prompts, reference files and patterns, and keep Claude MD focused and pruned. Use sub agents to preserve main context. Clear between tasks, restart after failed corrections. And remember the interview technique for complex features. Specifically from Boris's workflow, run multiple parallel sessions, not just one. Make Claude MD a team effort, updated constantly. Automate inner loops with slash commands and hooks. Accept that 10 to 20% of sessions fail. That's normal. And verification is non negotiable. These aren't my personal opinions. This is from the team that built Cloud Code and the person who created it. Apply them in your workflow. That was a lot, but I hope you picked up some useful tips and tricks. As always, I would really appreciate it if you hit that like button and subscribe for more Cloud Code videos. Thanks a lot for watching, and I'll see you in the next one.



