Grokking Claude for Beginners
Vote

0% completed

​

Files, Images, and Web Search

Part 1: Images

Part 2: Documents

Part 3: Data

Part 4: Web Search and Citations

Part 5: Research

Try It Yourself

Key Takeaways

A test fails on Maya's computer. She takes a screenshot of the failed test, pastes it into a chat, and types four words:

Why does this fail?

The screenshot ends with the line KeyError: 'shipping_zone'. As an example, Claude's reply says that the code reads the key shipping_zone from a dictionary that does not contain it.

The picture was almost the whole request. This lesson explains what Claude reads from an image, a document, and a data file, and how it searches the web.

Part 1: Images

A screenshot gives Claude the exact text on your screen. Maya did not retype the error, so she could not leave out a line or mistype a name. When a reply quotes text from an image, compare the quotation with the image.

Claude also reads pictures that contain little text, such as a photo of a whiteboard or a chart. It accepts images in the JPEG, PNG, GIF, and WebP formats.

Adding a file to a chat is called uploading it. There are three ways to upload an image or any other file:

  • Click the "+" button in the message box and choose "Add files or photos".
  • Drag the file into the chat.
  • Paste it, as Maya did.

Names and positions in the app can change, so look for the function if a label is different.

Part 2: Documents

Claude accepts documents of several types, including PDF, Word (DOCX), plain text, CSV, Excel (XLSX), HTML, and JSON. What it reads depends on the type:

  • A PDF of ordinary length. Claude reads the text and the visual content of the pages, so a chart or a diagram on a page is read.
  • A very long PDF. Claude reads the text only.
  • Other document types. Claude reads the text only, so a picture inside a Word file is not read.

This difference matters when your question depends on a picture inside a document. If a Word file contains such a picture, save the file as a PDF, or upload a screenshot of the picture.

The diagram below shows three kinds of file and what Claude reads from each. The next part explains the third kind, a data file.

Three kinds of file that you can add to a chat, and what Claude reads from each one
Three kinds of file that you can add to a chat, and what Claude reads from each one

Look at the right column. Claude reads the whole picture of an image and the text of a document, and from a PDF of ordinary length also the visual content. It runs code on a data file.

Part 3: Data

Maya has a file named checkout_requests.csv. It has 5,000 rows, one for each request to the checkout service, and four columns: timestamp, endpoint, status, and duration_ms. She needs the ten slowest requests, so she uploads the file and asks:

Find the ten requests with the largest duration_ms. Show them in a table.

Claude does not answer by reading 5,000 rows as text and estimating. It writes a short Python program, runs the program on the uploaded file, and reports the result. The program sorts every row, so the ten values are exact. In this example, eight of the ten slowest requests are requests to /checkout/tax, so Maya now has one endpoint to examine.

Reading the rows as text gives an estimate, and running Python code on the file gives an exact result
Reading the rows as text gives an estimate, and running Python code on the file gives an exact result

Notice that both paths start from the same file. Only the lower path uses every one of the 5,000 rows.

This ability depends on a setting named "Code execution and file creation". The newer settings layout shows it as "Create and edit files", under Settings > Capabilities. It is on by default and available on every plan. Claude uses the same ability to calculate over a spreadsheet and to draw charts.

Part 4: Web Search and Citations

Some questions need facts that are not in your files, and some of those facts are newer than the model's knowledge cutoff. For these questions, Claude can search the live web while it writes a reply. This feature is called web search.

Suppose Maya asks which version of pytest is the latest. Version numbers change after a model is trained, so the reliable answer is on the web.

A reply that used web search includes links to its sources. A link of this kind is called a citation. Anthropic advises users to review the cited sources, because the original pages may contain context that the summary lacks.

In the older layout of the app, you turn web search on from the "+" button, then "Web search". In the newer layout there is no switch, and Claude searches when it helps. In both layouts, check that the reply contains citations.

Part 5: Research

Maya also has a larger question: how can a payment request be made safe to send twice? A good answer compares several sources, so one search is not enough.

For a question like this, the app has a feature that runs many searches, each one using the results of the earlier ones. The feature is named Research. You start it from the "+" button, then "Research".

Research takes a few minutes, returns a longer report with citations, and needs a paid plan. As an example, Maya's report describes the common method: the idempotency key, a unique value for one payment that a repeated request sends again. Web search fits a simple factual question, and Research fits a question that needs many sources.

Try It Yourself

Do this task in Claude at claude.ai. A free account is enough.

  1. Choose a CSV file or a spreadsheet of your own that has at least one column of numbers and no private data.
  2. Upload it to a new chat and send this request, with your column name in place of the brackets:
Find the five largest values in the column [column name]. Show the full row for each value.
  1. Open the file in a spreadsheet program and sort it by the same column, from largest to smallest.
  2. Compare two of Claude's five values with the top rows of your sorted file.

The result is good if both values are the same in Claude's answer and in your sorted file.

Key Takeaways

  • An image can be most of a request. Claude reads a screenshot, a photo, or a chart, so you do not need to retype what is on your screen.
  • What Claude reads from a document depends on its type. From a PDF of ordinary length it reads the text and the visual content, and from other documents it reads the text only.
  • For a data file, Claude runs code. The numbers come from a program that processes every row, not from an estimate.
  • Web search and Research add information from the live web. Both give citations, so open the sources of the facts you plan to use.

The next lesson, Projects, Memory, and Instructions, explains how to keep files and instructions available for every chat about one subject.

Reading Progress

0%


Vote for new content

On This Page

Part 1: Images

Part 2: Documents

Part 3: Data

Part 4: Web Search and Citations

Part 5: Research

Try It Yourself

Key Takeaways