Mascot Logo
ai-agents-tutorial

Part 1 · Lesson 5 of 16

Working with Real Files in Claude Code

Point the agent at notes, a Word doc, a CSV.

10 min

Step 1 of 5 · Why point to specific files?

Every time you ask Claude Code to do something, it needs the right context to answer accurately. But context costs tokens — money and speed. If you let the agent hunt through a giant folder of thousands of files, every answer is slower and more expensive.

The fix is to hand Claude the exact files that matter. The cleanest way to do that is an @ file mention, which pulls one specific file into the conversation.

Step 2 of 5 · Create a sample note file

Let's create a text file to test this out. In your terminal, make sure you're still in agent-playground, then run:

echo "Claude Code is an agentic tool. It helps automate coding tasks, run terminal commands, and maintain codebases." > intro.txt

This creates a file called intro.txt containing a short description of Claude Code.

Step 3 of 5 · Start Claude and mention your file with @

Launch Claude Code in your playground folder:

claude

Once the prompt is ready, type @ and the file name. As you type @, Claude Code shows a file picker so you can pick the exact file:

@intro.txt

The @ mention tells Claude to read that specific file into the conversation — no guessing, and no scanning the whole folder.

Step 4 of 5 · Ask for a summary

Now ask Claude to work with the file you mentioned. In the same prompt, write:

Summarize @intro.txt in a single sentence.

Claude reads the file and answers. Because you pointed at the file explicitly, it doesn't waste tokens guessing which file you meant.

When you're done, type /exit (alias /quit) to close the session.

Step 5 of 5 · Checkpoint & Recap

Recap

  • Context optimization: pointing at specific files saves tokens and speeds the agent up.
  • @filename: mentions a file so Claude reads exactly that file into context (a picker appears as you type @).
  • Mention multiple files in one prompt; use --add-dir to add another folder to the session.
  • /exit (alias /quit): safely closes the session.