Skip to content

AIExplore

How to Work with Files and Documents in Claude

Upload and work with files in Claude: PDFs, spreadsheets, code files, and images — with prompts for extraction, comparison, and multi-file tasks.

Claude can work with uploaded files including PDFs, text documents, spreadsheets, code files, and images. This makes it practical for tasks like extracting data from a report, comparing two documents, or analyzing a codebase without pasting everything into the chat.

Supported file types

  • PDF documents — contracts, reports, research papers
  • Text files — .txt, .md, .csv, .json
  • Code files — .py, .ts, .js, .sql, and most common languages
  • Images — screenshots, diagrams, photos for visual analysis
  • Spreadsheets — .csv files for data extraction and analysis

Uploading and referencing files

Upload files directly in the conversation or add them to a Project knowledge base for persistent access. When asking about a file, be specific about what you want Claude to do with it.

Bad

Look at this PDF.

Better

From the uploaded PDF, extract:
1. The total contract value
2. Payment milestones and dates
3. Termination clause conditions

For each item, quote the relevant section.

Best

From the uploaded contract PDF, extract the following into a structured table:

| Item | Value | Clause/Page Reference |
|------|-------|----------------------|
| Total contract value | | |
| Payment milestones | | |
| Termination notice period | | |
| Liability cap | | |
| Data handling on termination | | |

Rules:
- Quote the relevant clause for each item
- If an item is not covered in the contract, write "Not addressed"
- Do not infer terms that are not explicitly stated

Multi-file tasks

When working with multiple files, label them clearly in your prompt so Claude knows which file you are referring to.

I have uploaded two files:
- File 1: Q1 sales report (sales-q1.csv)
- File 2: Q2 sales report (sales-q2.csv)

Compare quarterly performance:
1. Total revenue change (Q1 vs Q2, absolute and percentage)
2. Top 3 products by revenue in each quarter
3. Any products that appeared in Q1 but not Q2 (or vice versa)

Output: comparison table with both quarters side by side.

Working with code files

I uploaded three TypeScript files from our API layer.
Before making any changes:
1. Explain the data flow from route handler to database
2. Identify any error handling gaps
3. List the shared types and where they are defined

Then propose improvements, grouped by priority.

Image analysis

Upload screenshots, diagrams, or photos and ask Claude to describe, extract text from, or analyze them.

I uploaded a screenshot of our analytics dashboard.
1. List every metric visible on the dashboard
2. Identify any metrics that show a significant change (up or down)
3. Describe the overall layout and navigation elements visible

Common file handling mistakes

  • Uploading a file without saying what you want done with it
  • Uploading a scan of a handwritten document — OCR quality varies
  • Not labeling multiple files clearly in your prompt
  • Assuming Claude remembers a file from a previous conversation — re-upload or use a Project

Related reading: /blog/how-to-analyze-documents-with-claude for detailed document analysis, /blog/how-to-use-claude-projects for persistent file access, and /blog/getting-more-accurate-answers-from-claude for source-grounded accuracy.

Related articles