Before turning on the analysis tool feature preview, ensure Artifacts are enabled in your account.
The analysis tool is a feature preview that enables Claude to write and run JavaScript code within Claude.ai, providing real-time data analysis and insights. This article will guide you through enabling the feature, using it effectively, and leveraging its capabilities for various use cases.
Enabling or disabling the analysis tool
To enable the analysis tool feature preview:
Click on your initials in the lower left corner.
Select “Feature Preview” from the menu.
Locate the "Analysis tool" toggle and switch it on.
You can disable the feature at any time by following the same steps and turning the toggle off.
Using the analysis tool
Once enabled, you can start using the analysis tool in your conversations with Claude. The analysis tool has two primary use cases:
General computation and code execution
CSV data analysis and visualization
Here's how to use each:
General computation and code execution
You can ask Claude to perform calculations or run code for various tasks. For example:
"Can you calculate the distance between New York and San Francisco using the Haversine formula?"
"Calculate the compound interest on $10,000 invested at 6.5% APR compounded daily for 30 years, showing monthly totals."
"What are the Celsius temperatures for every Fahrenheit degree from 0-1000 in 0.1 degree increments?"
Claude can use the analysis tool to perform these calculations or run the necessary code, providing you with the results directly in your chat.
CSV data analysis and visualization
You can also use the analysis tool to analyze and visualize data from uploaded CSV files. Here's how:
Upload a CSV file that you want Claude to analyze.
Note: The file must fit within the conversation’s context window.
Prompt Claude to analyze the data, being as specific as possible in your request.
Craft effective prompts for the analysis tool
To get the most out of the analysis tool, consider these prompt examples for various analytical needs:
General Analysis:
"Please analyze this CSV file and provide an overview of its contents."
Statistical Analysis:
"Calculate the mean, median, and standard deviation for each numerical column in this dataset."
Time-based Analysis:
"This data represents monthly sales. Can you analyze the year-over-year growth rate?"
Comparative Analysis:
"How does the performance of Product A compare to Product B across all metrics?"
Predictive Analysis:
"Based on this historical data, can you forecast the likely values for the next 3 months?"
Segmentation Analysis:
"Can you segment the data into distinct groups based on customer purchasing behavior?"
Data Quality Analysis:
"Check for any missing or inconsistent data in this CSV."
Specific Metric Analysis:
"What's our average customer acquisition cost based on this data?"
Comprehensive Analysis:
"Provide a comprehensive analysis of our sales data, including trends over time, top-performing products, and any correlations between sales and other factors like marketing spend or seasonality."
Computational Requests:
"Can you calculate the compound interest on a $10,000 investment at 5% annual rate over 10 years?"
Viewing the analysis
After Claude responds with insights, you can click on "View analysis" to see the behind-the-scenes work. This reveals the exact code Claude executed and its output, providing full transparency into the analytical process. This feature is particularly useful for:
Verifying results
Understanding methodologies
Learning new data analysis techniques
Working with visualizations
Claude can also create Artifacts for visualizing your data, allowing you to interact with it, gather insights, or prompt for further analysis. Here's how you can make the most of this feature:
Request a Visualization Explicitly: To ensure that Claude provides a visualization, you should explicitly ask for one. You could say something like:
"Can you create a visualization of this data?"
"Please generate a chart or graph to represent these findings."
Specify the Type of Visualization: If you have a preference for the type of chart or graph, you can request it specifically:
"Could you create a bar chart showing the sales data by month?"
"I'd like to see a pie chart of the market share distribution."
"Can you visualize this time series data in a line graph?"
Provide Context for the Visualization: The more context you provide about what you're trying to understand or highlight, the better Claude can tailor the visualization:
"I'm trying to identify trends over time. Can you create a visualization that emphasizes this?"
"I want to compare performance across different categories. What's the best way to visualize this?"
Ask for Multiple Views: Sometimes, multiple visualizations can provide different insights:
"Can you create both a pie chart and a bar graph of this data? I'd like to see which is more informative."
"Please provide a few different ways to visualize this data so we can decide which is most effective."
Request Customization: You can ask for specific customizations to make the visualization more useful:
"Can you create a chart with a color scheme that highlights the top performers?"
"Is it possible to add data labels to the visualization?"
"Could you sort the data in descending order in the chart?"
Interact with the Visualization: Once Claude has created a visualization, you can interact with it further:
"Based on this chart, can you explain why there's a spike in July?"
"The bar for Product A seems much higher than the others. Can you provide more details about its performance?"
"This visualization is helpful, but could you modify it to focus on the top 5 categories only?"
Combine with Analysis: You can ask for a visualization along with analytical insights:
"Can you create a visualization of this data and highlight any significant patterns or anomalies you notice?"
"Please generate a chart of our quarterly sales and provide an analysis of the trends you observe."