Claude can now execute code and write programs in addition to discussing code
Anthropic has introduced a new feature for its Claude chatbot, enabling it to write and execute JavaScript code. The company launched an “analysis tool” that allows Claude to provide what Anthropic describes as “mathematically precise and reproducible answers.” Currently in preview, the tool helps Claude perform calculations and analyze data from files like spreadsheets and PDFs, presenting the results as interactive visualizations.
Anthropic likens this tool to a “built-in code sandbox,” where Claude can handle complex mathematical tasks, data analysis, and explore various ideas systematically. Instead of just offering abstract insights, Claude can now thoroughly process data—cleaning, exploring, and analyzing it step-by-step to ensure accurate outcomes.
Examples of potential use cases include a product manager uploading sales data for country-specific analysis or an engineer providing financial data to generate a dashboard highlighting important trends.
Image Credits: Anthropic
While Claude was previously capable of tackling these tasks, its lack of mathematical verification often made its answers less reliable. This new feature improves accuracy by allowing the bot to verify its results.
Google and OpenAI offer similar capabilities in their models. Google’s Gemini models use “Code Execution” to run Python code, while OpenAI’s models have a feature called Advanced Data Analysis that can also write and execute code.
Anthropic’s new analysis tool is now available to all Claude users on the web as of Thursday. Turn on this feature here.