FirstPrompt
Anmelden
Mit Claude Code live gehenModul 2 · Dein erster Prompt
Lektion 5 von 6VorherigeNächste
2:25

Dieses Video gibt es vorerst auf Englisch. Die deutsche Fassung folgt bald.

@file und @directory

KostenlosVideo 2:25

Du liest als Gast – dein Fortschritt wird nur auf diesem Gerät gespeichert.

Kostenlos registrieren und sichern

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 appears with your files at the top. Type a couple of letters, like @ab, to narrow it, then use the arrow keys and press Tab or to pick one — you do not have to type the whole name, and you cannot misspell it.

5 Min. Lesezeit
Lektion 5 von 6

Modul 2 · Dein erster Prompt

0/6
  1. 2:46Anatomie eines PromptsVideo
  2. 2:44Genauigkeit als HebelVideo
  3. 2:41Kontextfenster und /clearVideo
  4. 2:21Slash-BefehleVideo
  5. 2:25@file und @directoryLäuft
  6. 2:05Modul 2 im RückblickVideo
  7. CheckpointQuiz + live stellen
Enter

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 also reference a folder inside your project, when you do not know which file in it holds the answer. If you had a pages/ folder, you would write:

look through @pages/ and tell me which files mention my name

Type @pa and the folder appears in the list, with a slash at the end. Your project folder itself needs no @: you are already inside it, so Claude can see everything here.

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 a whole @folder/ 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 a folder inside your project 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.

Übung

Probier diese Lektion in einem geführten Terminal aus.

Kostenlos registrieren und üben
NächsteModul 2 im Rückblick
Vorherige
Nächste
KurseMit Claude Code live gehen entdeckenPrompt-PacksBau deine eigene Website