Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Using Claude Code  ›  Lesson

Context and @ Mentions

Context 12 minClaude knows only what is in its context window, so a good prompt points at the right files with @ mentions, states expected versus actual behaviour, and names a check.

Context and @ Mentions

Claude does not remember yesterday's session unless you resume it, and it cannot see what is in your head. Everything it knows about the current task sits in one place: the context window. Good results come from putting the right things there, and leaving the rest out.

The rule

Claude knows only what is in context, so put the right things there.

The context window is the session's working memory. It holds Claude Code's own instructions, your CLAUDE.md, the conversation, and every file read and command output so far. It is large but finite. As it fills up, Claude Code summarises older parts to make room, and fine detail can be lost. More is not better, either: irrelevant material dilutes the parts that matter. And a new session starts almost empty — just the instructions plus whatever you give it — which is why facts you need every time belong in CLAUDE.md.

Ways to put things in:

  • @ mentions. Type @ followed by a path to pull a file into the conversation; autocomplete helps you find it. @pricing.py is quicker and more precise than "the pricing file".
  • Paste error messages, stack traces or screenshots.
  • Say where to look: a function name, a test name, a web address.

Ways to manage it:

  • /context shows what is taking up space.
  • /clear wipes the conversation for a fresh, unrelated task.
  • /compact summarises the conversation so far — you can add a note on what to keep — so you can carry on with more room.

The shortcut

A clear prompt answers three things: where, what, and how you'll know. Where: the files, via @. What: expected versus actual, with a real example. How you'll know: the check.

In @pricing.py, weekly-plan customers are charged the one-day price.
Expected: 7 days at ₹100 with 10% off is ₹630; we charge ₹700.
test_weekly_plan in @tests/test_pricing.py covers this case.
Don't change the tests. Run pytest when you're done.
From vague to clearStep 1 of 5
  1. Vague

    "fix pricing" — Claude must search, guess what is wrong, and may fix the wrong thing.

The trap is mentioning whole folders "just in case". It floods the context, costs tokens, and buries the one file that matters.

Drills

Answer fast — trust the rule.

quick drill

What does writing @tests/test_pricing.py in your prompt do?

quick drill

The pricing fix is done, and your next task, delivery routes, is unrelated. What is the best move?

quick drill

Which prompt gives Claude the best context?

quick drill

You are in the middle of a long task and Claude has started losing track of earlier decisions. What helps most?

Remember

  • Claude knows only what is in context; @ puts the right file there.
  • Shortcut: where, what, and how you'll know.
  • Trap: flooding context with folders "just in case", or dragging an old task into a new one instead of using /clear.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainFrom vague to clear

Rewrite the vague prompt 'the pause thing is broken, fix it' into a clear prompt for Claude Code on the tiffin app, and explain what each part adds to Claude's context.