firstprompt
Sign in
All courses

curriculum

0 / 40 · 0%
  • Anatomy of a prompt7m
  • The specificity lever6m
  • Context windows and /clear5m
  • Slash commands5m
  • @file and @directory5m
  • Module 2 recap3m
  • Checkpointquiz + ship
0/40

You're reading as a guest — progress saves to this device only.

Dashboard/Module 2/Lesson 5
FreeYour first prompt

@file and @directory

5 min read·Lesson 5 of Your first prompt

Listen instead

@file and @directory

1:47 · spoken companion to this lesson

0:001:47

Claude finds files on its own most of the time. Naming one with @ makes it certain — it pulls that file's real contents into the conversation before answering, instead of going looking.

Point at a file

Make a second file so there is something to be ambiguous about. In Claude:

make a file called about.md with a few paragraphs about what I'm learning

Now you have index.html and about.md in the folder. Ask a question about one of them specifically:

explain what @about.md says, in one sentence

As you type @, a list of your files appears. Use the arrow keys and press Tab or Enter to pick one — you do not have to type the whole name, and you cannot misspell it.

Where it really earns its place

@ is at its best when you want one thing to follow the pattern of another:

using @index.html as the pattern, make a second page called projects.html with the same styling

Claude can see the first file, so the new page matches. Without @ it would have to guess what your page looks like, and the two would drift apart.

Point at a folder

You can reference a whole folder when you do not know which file holds the answer:

practice

Try this lesson in a guided terminal.

Next

Module 2 recap

look through @my-first-project/ and tell me which files mention my name

Useful when you are exploring. Costly when you are not — which brings us to the catch.

Every @ costs context

Whatever you pull in occupies the context window you learned about two lessons ago. A folder full of files can fill it fast, and a full window makes Claude slower and more easily distracted.

So:

  • Reference the one or two files that matter, not everything.
  • Prefer @about.md over @my-first-project/ when you already know where to look.

Think of @ as handing someone a document in a meeting. One relevant page focuses the room. Emptying the filing cabinet onto the table does the opposite.

When you do not need it at all

If you have only asked about one file all session, you do not need @ every time — Claude already has it. Reach for @ when you are switching files, comparing two of them, or being precise after a misunderstanding.

Try it now

compare @index.html and @about.md — is anything said differently between them?

Two files, both loaded, one question that would be impossible to answer without them.

What you just learned

  • @filename loads a file's real contents into the conversation.
  • Typing @ opens a file picker, so you cannot misspell a name.
  • @folder/ works too, for when you do not know where to look.
  • Every @ consumes context. Reference what matters, not everything.

Next: a short recap, then you start changing real code.

Next

Study Progress

0

0 / 40

lessons

In this module

Your first prompt

  1. 1Anatomy of a prompt7m
  2. 2The specificity lever6m
  3. 3Context windows and /clear5m
  4. 4Slash commands5m
  5. 5@file and @directory5m
  6. 6Module 2 recap3m
Take the checkpoint