AI & Agents

Claude Best Practices: Context Setup, Prompting, and Workflow Tips

Anthropic reports that building a layered context system with identity and voice files improves Claude output quality more than switching between models. Yet most users still rely on blank-slate prompting. This guide consolidates the official Anthropic best practices for Cowork and Code with practical patterns for CLAUDE.md sizing, skill chunking, permission mode selection, and outcome-oriented prompting that produce consistently better results.

Fast.io Editorial Team 10 min read
AI workspace showing structured context and document analysis

Why Context Setup Outperforms Model Selection

A Growth Unhinged survey found that 32% of GTM operators now use Cowork as their primary Claude product, matching Chat and Code within weeks of its GA launch. That rapid adoption makes the quality gap between prepared and unprepared users visible fast. Teams that invest 10 minutes in context setup get meaningfully better results than teams that jump straight to prompting, regardless of which Claude plan they use.

The difference comes down to how Claude's context window works. Every conversation loads your instructions, file contents, and tool outputs into a fixed-size window. Performance degrades as that window fills with irrelevant content. Anthropic's official best practices guide puts it directly: "Most best practices are based on one constraint: Claude's context window fills up fast, and performance degrades as it fills."

That means the highest-leverage improvement is not writing better prompts. It is giving Claude the right persistent context so it starts every session already knowing your code style, project conventions, and workflow rules. The rest of this guide covers how to build that context layer, structure your prompts around it, and choose the right supervision level for different tasks.

Neural network visualization representing AI context processing

Seven Best Practices for Claude Cowork and Code

These patterns come from Anthropic's published guidance and from practitioners who have shipped production work with Claude. Each one addresses a specific failure mode that causes wasted tokens, incorrect output, or unnecessary manual review.

1. Write a Concise CLAUDE.md File

CLAUDE.md is a special file that Claude reads at the start of every conversation. Include build commands Claude cannot guess, code style rules that differ from defaults, testing instructions, and architectural decisions specific to your project. Run /init to generate a starter file, then trim ruthlessly.

The key discipline is keeping it short. For each line, ask whether removing it would cause Claude to make mistakes. If not, cut it. Anthropic's docs warn that "bloated CLAUDE.md files cause Claude to ignore your actual instructions." A 30-line file that Claude follows consistently beats a 200-line file where critical rules get buried.

What to include:

  • Bash commands Claude cannot infer from the codebase
  • Code style rules that differ from language defaults
  • Preferred test runners and testing patterns
  • Repository conventions like branch naming and PR format
  • Common gotchas or non-obvious project behaviors

What to exclude:

  • Standard language conventions Claude already knows
  • Detailed API documentation (link to docs instead)
  • Information that changes frequently
  • Self-evident practices like "write clean code"

If Claude keeps ignoring a rule despite it being in CLAUDE.md, the file is probably too long and the rule is getting lost in noise. If Claude keeps asking questions already answered there, the phrasing might be ambiguous.

2. Build a Layered Context System

Cowork supports context at multiple scopes. Global Instructions apply across every session. Project-level instructions apply within a specific project workspace. Folder-level instructions apply when Claude operates inside a particular directory.

For Cowork, start with three files in your working directory: an identity file explaining who you are and what you do, a voice profile capturing how you write, and an anti-pattern file listing words and structures Claude should never use in your output. Load these through Global Instructions in Settings.

For Code, place CLAUDE.md files at different levels. A ~/.claude/CLAUDE.md applies to all sessions. A project-root CLAUDE.md gets checked into git and shared with your team. A CLAUDE.local.md holds personal preferences you do not want to share. Child directory files get pulled in on demand when Claude reads files in those directories.

This layered approach means Claude picks up the right context for the right scope without you loading everything into every session.

3. Use Skills Instead of One Omnibus Instruction File

Skills are markdown files in .claude/skills/ that extend Claude's knowledge with domain-specific information. Claude loads them on demand when relevant, rather than reading them on every session start.

Multiple separate skills produce better results than one large instruction file because each skill adds context only when needed. A skill for API conventions loads when you are working on API code. A skill for database migrations loads when you touch migration files. Neither consumes context tokens during unrelated work.

Skills can also define repeatable workflows. Create a fix-issue skill that walks through reading the GitHub issue, searching the codebase, implementing changes, running tests, and creating a PR. Invoke it with /fix-issue 1234 instead of typing the full workflow each time.

Set disable-model-invocation: true on skills with side effects so they only run when you explicitly call them.

4. Prompt for Outcomes, Not Procedures

Cowork works best with outcome-oriented descriptions rather than step-by-step instructions. Instead of telling Claude which buttons to click or which commands to run in sequence, describe what you want to exist when the task is done.

Weak prompt: "Open the spreadsheet, copy column B, paste it into a new sheet, format it as a table, add headers."

Strong prompt: "Create a clean summary table from the Q2 data in revenue.xlsx. Include month, revenue, and growth rate. Format it for a board presentation."

The strong version tells Claude the deliverable and the audience. Claude figures out the implementation steps, often finding a more efficient path than the one you would have prescribed. This matters because Cowork runs in an agentic loop. It reads files, runs commands, and iterates. Constraining its steps reduces its ability to course-correct.

For Claude Code, the same principle applies. "Write a validateEmail function that passes these test cases, then run the tests" outperforms "create a file called validator.ts, import the regex library, write a function that..." because the first version lets Claude verify its own work.

5. Choose the Right Permission Mode

Claude offers different supervision levels, and picking the right one for each task type saves both time and risk.

Ask before acting pauses for approval on every action. Use this when you are working with sensitive files, trying a new integration, or running Claude on unfamiliar code. The interruptions are worth it when the cost of a mistake is high.

Auto mode uses a classifier to review commands and block only risky ones like scope escalation or unknown infrastructure changes. Use this for routine work where you trust the general direction but do not want to click through every file read and write. Anthropic notes that after the tenth approval, "you're not really reviewing anymore, you're just clicking through."

Permission allowlists let you pre-approve specific safe commands like npm run lint or git commit. These reduce prompts for tools you use every session.

For Cowork specifically, start with "Ask before acting" on new projects and switch to broader permissions once you have seen Claude handle your files correctly across several sessions.

AI agent organizing files and workflows in a shared workspace
Fastio features

Give Your Claude Outputs a Persistent Home

Stop losing files between chat sessions. Fast.io gives both Claude agents and your team a shared workspace with built-in search and MCP access. Starts with a 14-day free trial.

Managing Context and Sessions

6. Clear Context Between Tasks

The single most common failure pattern is the kitchen sink session. You start with one task, ask Claude something unrelated, then go back to the original work. By that point the context window is full of irrelevant file contents and conversation history that degrades performance.

Run /clear between unrelated tasks. This resets the context window completely and gives Claude a clean starting point. During long sessions, Claude automatically compacts conversation history when you approach context limits, preserving important code and decisions while freeing space.

For more control, run /compact with specific instructions like /compact Focus on the API changes. This tells Claude what matters most when it summarizes the conversation. You can also use /rewind to restore a previous checkpoint if Claude goes off track, without losing the code changes you want to keep.

Another context-saving pattern is using subagents for investigation. When Claude researches a codebase it reads many files, and each one consumes your context window. Subagents run in separate context windows and report back summaries. Tell Claude to "use subagents to investigate how our auth system handles token refresh" and the exploration happens in an isolated context that does not clutter your main conversation.

After two failed corrections in the same session, clear context and start fresh. A clean session with a better prompt almost always outperforms a long session with accumulated corrections.

7. Schedule Recurring Work

Both Cowork and Code support scheduled tasks that run automatically. This is where the "best practices" framing shifts from "how to get better output" to "how to get output without being present."

In Cowork, schedule tasks to run before your workday starts. Daily briefings that summarize Slack threads and email, budget pacing dashboards that pull from ad platforms, weekly report reconciliation. The five criteria for good scheduled tasks: multiple inputs, file output, recurring nature, clear quality standards, and tedious middle steps.

For Claude Code, use cron-style scheduling or hooks that trigger on specific events. A pre-commit hook that runs linting, a stop hook that blocks the turn from ending until tests pass, or a post-edit hook that formats code. Unlike CLAUDE.md instructions which are advisory, hooks are deterministic.

The scheduling capabilities work well with persistent file storage. When Claude generates a report or processes documents on a schedule, those files need to live somewhere accessible to both the agent and the humans who consume the output. Local filesystem works for personal use. For team workflows where multiple people need the results, a shared workspace like Fast.io gives both agents and humans access to the same files without manual syncing.

Making Claude Interview You Before Starting

One technique from Anthropic's best practices stands out for larger projects: having Claude interview you before it starts working. Instead of writing a detailed brief upfront, give Claude a minimal description and ask it to interview you about the hard parts.

A prompt like "I want to build a customer onboarding flow. Interview me in detail. Ask about technical implementation, edge cases, and tradeoffs. Keep interviewing until we've covered everything, then write a complete spec" surfaces requirements you would not have thought to include in a brief.

Claude asks about things like error handling for edge cases, what happens when a user drops off mid-flow, whether you need analytics tracking, and how the new flow interacts with existing authentication. These are exactly the questions a senior engineer would ask before starting, and answering them upfront prevents rework later.

Once the spec is complete, start a fresh session to execute it. The new session has clean context focused entirely on implementation, and you have a written reference document. This separation matters because the interview session fills the context window with exploratory conversation, while the implementation session needs space for code, file reads, and command output.

This pattern scales beyond code. In Cowork, interview-driven workflows work for content creation ("interview me about the audience, goals, and constraints before writing"), data analysis ("ask me what questions this data should answer before building the dashboard"), and process documentation ("interview me about how this workflow actually runs before writing the SOP").

The interview technique pairs naturally with persistent storage. When Claude produces specs, reports, or processed files, teams need those outputs accessible beyond the session that created them. Fast.io workspaces let agents write deliverables directly to shared storage via MCP, so a spec document or processed dataset is immediately available to team members without manual file transfers. Fast.io plans include shared storage and MCP access, and every org starts with a 14-day free trial.

What to Stop Doing with Claude

Recognizing failure patterns saves as much time as learning best practices. These are the most common mistakes from Anthropic's documentation and practitioner experience.

Stop correcting endlessly in one session. If you have corrected Claude twice on the same issue, the context is cluttered with failed approaches. Clear and start fresh with a more specific prompt that incorporates what you learned. The sunk cost of the existing session is not worth the degraded performance.

Stop over-specifying your CLAUDE.md. If it reads like a comprehensive style guide, Claude will ignore half of it. Keep it to things Claude gets wrong without the instruction. Everything else is noise that dilutes the rules you actually need followed.

Stop trusting without verification. Claude produces plausible-looking implementations that miss edge cases. Always provide a verification mechanism: tests, build scripts, screenshots, or a second-opinion subagent review. If you cannot verify the output, do not ship it. Anthropic recommends having Claude show evidence rather than asserting success.

Stop using infinite exploration prompts. Asking Claude to "investigate" something without scoping it leads to hundreds of file reads that fill the context window. Scope investigations narrowly or delegate them to subagents.

Stop skipping the pre-flight question. Before diving into any substantial task, include this prompt element from Anthropic's blog: "Before we begin, repeat my ask back to me so we're aligned, then ask me as many clarifying questions as you have." This single habit catches misunderstandings before they waste an entire session.

For teams generating regular output with Claude, whether reports, analyses, or processed documents, a persistent workspace prevents the recurring problem of files scattered across local machines and chat sessions. Fast.io's Intelligence Mode auto-indexes uploaded files for semantic search and RAG, so previous Claude outputs become searchable context for future work without manual organization.

Audit log showing tracked workflow activities

Frequently Asked Questions

How do I get better results from Claude?

Build a persistent context system before you prompt. Create a CLAUDE.md file with your project conventions, code style rules, and workflow instructions. Use layered context: global instructions for universal preferences, project-level files for repository-specific rules, and skills for domain knowledge that loads on demand. Prompt for outcomes rather than step-by-step procedures, and always give Claude a way to verify its own work through tests, build commands, or screenshots.

What are the best Claude Cowork settings?

Start with 'Ask before acting' permission mode while you learn how Cowork handles your files, then switch to auto mode for routine tasks once you trust the pattern. Set up Global Instructions with your identity, voice profile, and anti-pattern list. Create dedicated project workspaces rather than working from standalone sessions, since projects retain memory across sessions. Schedule recurring tasks to run before your workday begins.

How should I structure Claude context files?

Keep CLAUDE.md short and focused on things Claude gets wrong without the instruction. Include build commands, code style rules that differ from defaults, testing preferences, and common gotchas. Exclude standard conventions Claude already knows, detailed documentation (link instead), and self-evident practices. Use skills in .claude/skills/ for domain-specific knowledge that only applies to certain tasks, so it loads on demand instead of consuming context on every session.

What is the best way to prompt Claude Cowork?

Describe outcomes, not procedures. Tell Claude what you want to exist when the task is done, who will see it, and what quality looks like. Include the pre-flight prompt: 'Before we begin, repeat my ask back to me so we're aligned, then ask me as many clarifying questions as you have.' For larger projects, have Claude interview you about requirements before it starts working, then begin a fresh session to execute the resulting spec.

How often should I clear Claude's context?

Clear between every unrelated task with /clear. If you have corrected Claude twice on the same issue, clear and start fresh with a better prompt. During long single-task sessions, use /compact with specific instructions about what to preserve. Watch for signs of context degradation: Claude forgetting earlier instructions, repeating questions you already answered, or producing lower-quality output than earlier in the session.

What is the difference between CLAUDE.md and skills?

CLAUDE.md loads on every session start and should contain universal project rules. Skills are markdown files in .claude/skills/ that load on demand when Claude determines they are relevant, or when you invoke them directly with a slash command. Use CLAUDE.md for things that apply to every task in the project. Use skills for domain-specific knowledge, repeatable workflows, or instructions that only apply to certain types of work.

Related Resources

Fastio features

Give Your Claude Outputs a Persistent Home

Stop losing files between chat sessions. Fast.io gives both Claude agents and your team a shared workspace with built-in search and MCP access. Starts with a 14-day free trial.