Building Summary Reports
How to create full reports that combine data summaries, charts, and written analysis
Beyond single answers
So far, you've been asking Claude Code one question at a time. "What's the top product?" gives you a number. "Create a bar chart of monthly revenue" gives you a chart.
Single questions are great for quick lookups. But when your manager asks for "a summary of Q4 sales," they don't want a number or a lone chart. They want a document: key metrics at the top, trends called out, a chart or two, maybe a recommendation at the bottom.
Claude Code can build that entire document for you. Describe what the report should cover, who it's for, and what format you want. It pulls the numbers from your data, writes the narrative, generates charts, and saves everything as a file you can open and share.
Asking for a full report
Report prompts tend to be longer than what you've been writing so far. That's worth it, because more detail in your prompt means less back-and-forth fixing the result.
Here's what a report prompt looks like, using the same customer_orders.csv file from this module:
Write a one-page summary report of Q4 sales from customer_orders.csv. Include:
- Total revenue, number of orders, and average order value
- A comparison of October, November, and December
- The top 3 products by revenue
- A bar chart of monthly revenue
- A brief paragraph highlighting the key trend
Save it as q4_report.mdClaude Code reads the data, calculates the metrics, generates a chart, writes the narrative, and saves a Markdown file in your project folder.
You'll see something like:
I've created q4_report.md with the following sections:
- Executive summary with total Q4 revenue ($506,745), 2,847 orders, and
$177.92 average order value
- Monthly breakdown comparing October, November, and December
- Top 3 products table (Premium Widget, Standard Kit, Enterprise Pack)
- Bar chart saved as q4_revenue_chart.png and embedded in the report
- Trend analysis paragraph noting the 37% growth from October to December
The report is ready to open.Open the file to review it, the same way you'd check any document before sharing it.
Choosing an output format
Claude Code can create reports in several formats. Which one you pick depends on who's reading it and where.
Markdown (.md) is the default. It's a plain text file with headings, bold text, bullet points, and tables. You can open it in any text editor, and it's the easiest format to edit afterward.
HTML (.html) gives you a web page you open in your browser. The formatting looks more polished: styled headings, colors, proper tables. You can print it from your browser or save it as a PDF (File, then Print, then Save as PDF).
Word (.docx) works when you need a format everyone already knows. Claude Code can generate Word files, though the formatting is more basic than what you'd get building the same document yourself in Word.
To get a specific format, say so in your prompt:
Create the same report but save it as an HTML page I can open in my browserSave the report as a Word document called q4_summary.docxTip: For quick sharing, HTML is a good middle ground. It looks professional in a browser, and anyone can save it as a PDF using their browser's print function. No extra tools needed.
Telling Claude Code who the report is for
The same data can support very different reports depending on the audience. A report for the VP of Sales looks nothing like one for the operations team.
You shape the output by telling Claude Code who's going to read it:
Write a summary of Q4 sales from customer_orders.csv. This report is for the VP of Sales. Focus on year-over-year growth, regional performance, and the top revenue drivers. Keep it high-level. No more than one page.Compare that to:
Write a summary of Q4 sales from customer_orders.csv. This is for the operations team. Focus on order volume by month, fulfillment patterns, and any products with unusually high return rates. Include specific numbers.Same data, completely different output.
Claude Code adjusts the language, the metrics it picks out, and how much it explains based on your description of the reader. The most useful things to tell it: who the reader is ("This is for my CEO"), what they care about ("Focus on customer retention"), and how detailed to go ("Keep it to bullet points").
The weekly report workflow
Reports get really useful when you do them more than once.
If you generate a monthly sales report every four weeks, you don't want to retype the whole prompt each time. Here's a workflow that turns a one-time report into something repeatable.
The first time, build the report interactively. Work with Claude Code the way you have throughout this module: describe what you want, review the result, ask for changes, refine until it looks right. This is the conversation where you figure out the format.
The second time, reuse the prompt that worked. Save the final version of your instructions in a text file, a note, or your CLAUDE.md. Next month, start a fresh conversation and paste the same prompt with the new filename:
Write a one-page summary report of January sales from january_orders.csv. Include:
- Total revenue, number of orders, and average order value
- Week-over-week comparison
- Top 3 products by revenue
- Bar chart of weekly revenue
- Brief paragraph on the key trend
Save it as january_report.mdSame structure, new data.
If you find yourself doing this every month, you can go a step further and ask Claude Code to save the whole analysis as a reusable script:
Take the analysis you just did and save it as a Python script called generate_report.py that I can run again next month with a different data fileThat creates a script file in your project folder. Next month, you tell Claude Code:
Run generate_report.py on february_orders.csvYou don't need to understand what's inside the script. Point it at the new data and it produces the same report.
Module 4 covers automation in depth, so think of this as a preview.
Heads up: Reusable scripts work best when your data files have the same column names each time. If next month's file has different columns, the script may fail or produce wrong numbers. When in doubt, run the report interactively and let Claude Code adapt to the new file.
Combining charts and text in one file
When Claude Code creates an HTML report, it can embed charts directly in the page. You don't need to generate the chart separately and paste it in.
Create an HTML report of Q4 sales that includes a bar chart of monthly revenue and a pie chart of revenue by region, both embedded in the pageOpen the resulting file in your browser and you see the narrative, tables, and charts all together.
For Markdown reports, charts work a bit differently.
Claude Code saves chart images as separate files (like monthly_revenue.png) and adds references to them in the Markdown.
If you open the file in a tool that renders Markdown (like a code editor's preview mode), the charts appear inline.
Quick reference: report prompts
| What you want | What to type |
|---|---|
| A full report from your data | "Write a summary report of [topic] from [file]. Include [metrics], [chart], and [analysis]" |
| Tailored for an audience | "This report is for [role]. Focus on [what they care about]" |
| A specific format | "Save it as [.md / .html / .docx]" |
| Charts embedded in the report | "Include a [chart type] of [measure] in the report" |
| A reusable version | "Save the analysis as a Python script I can run again with new data" |
| HTML you can print as PDF | "Create an HTML report I can print to PDF from my browser" |
Next, you'll learn the most important skill in data analysis with Claude Code: recognizing when the numbers are wrong and knowing how to catch mistakes before they reach anyone else.