Context & Memory in Claude Code
Claude Code in VS Code has no persistent memory between separate sessions. Understanding what Claude can and can't see in each conversation determines whether you get accurate, relevant answers.
Within one chat session, Claude remembers everything you've discussed. When you start a new session (or use /clear), the slate is wiped. You must re-attach context files each time for anything Claude needs to know.
What Claude Can See in VS Code
Files You @ Mention
Type @filename in the chat to attach any file in your workspace. Claude reads the full content. Attach multiple files in one message — Claude handles all of them simultaneously.
The Current Editor Tab
Claude Code can see the file currently open in your editor without you needing to @ it explicitly, particularly when asking about "this file" or running inline edits via Ctrl+K.
CLAUDE.md Automatically
Place a CLAUDE.md file at the root of your project. Claude Code reads it automatically at the start of every session — use it for standing instructions, brand voice, code conventions, and project background.
Terminal Output
When Claude runs a command in the integrated terminal, it reads the output automatically. If a test fails, Claude sees the error and can propose a fix without you copy-pasting anything.
Managing Context Across a Workday
| Situation | What to do | Command |
|---|---|---|
| Starting a new, unrelated task | Clear the conversation so old context doesn't bleed into the new task | /clear |
| Session is getting slow or confused | Summarise history into a compact handoff, freeing up context space | /compact |
| Need Claude to know the project background | Add it to CLAUDE.md — loads automatically every session | Edit CLAUDE.md |
| Working across multiple files | @ mention each file — or @ the whole folder for broad tasks | @folder/ |
| Long document Claude needs to reference repeatedly | Attach it at the start of the session and keep it in the conversation thread | @ it first |
ThreadCo CLAUDE.md — Persistent Context Example
# ThreadCo Project Context
## About ThreadCo
Sustainable UK T-shirt brand. 3 staff, 2,000 products, 500 customer emails/week.
Founder: Maya. Primary concern: customer support response time and product copy quality.
## Current Projects
- ShopMate: AI customer support tool (in progress)
- Catalogue refresh: rewriting product descriptions for 2,000 SKUs
## Key Files
- /docs/brand-voice.md — tone and forbidden words
- /docs/returns-policy.md — customer-facing returns rules
- /docs/sizing-guide.md — size chart used in all customer replies
## Coding Standards
TypeScript. Tests required for all new functions. No inline styles.
## Do Not
- Suggest paid third-party services without noting the cost
- Write customer-facing copy with exclamation marks