How to Stop Claude from Hallucinating Financial Data

The structural fix for AI hallucination in financial analysis

← Back to shibui.finance

When you ask Claude "what is Tesla's P/E ratio?", it generates a plausible number from its training data. Sometimes the number is close. Sometimes it is not. There is no way to tell from the response alone, because Claude presents both real and fabricated figures with the same confidence. This is the hallucination problem in financial analysis, and it applies to every major LLM.

The fix is structural, not behavioral. Better prompts do not give Claude access to data it does not have. Shibui Finance is a free MCP server that connects Claude to 64 years of US stock market data: 31M+ daily prices, quarterly financials, daily valuations, and 56 technical indicators for nearly 10,000 companies. Once connected, Claude writes SQL queries against a real database instead of generating numbers from memory.

What goes wrong without a data source

The failures follow predictable patterns. Research on LLM accuracy with financial filings found that even GPT-4 achieved only 79% accuracy when given full filing context and 9% without it. Stale data: Claude's training has a cutoff date. It cannot know that a company's P/E changed last quarter. Confident fabrication: for less-covered stocks, Claude generates ratios from distributional priors. A hallucinated P/E of 31.4 looks precise enough to act on. Wrong time period: Claude cannot distinguish current from historical. It may return 2024 Q3 revenue when you asked about the latest quarter, with no indication the number is outdated.

Derived metric errors: ratios like EV/EBITDA or FCF yield require multiple inputs. If any one input is hallucinated, the derived figure is wrong. False citations: some models now cite sources for financial figures, but the sources do not always contain the attributed numbers. The hallucination moves from the answer to the citation.

For mega-cap stocks with heavy press coverage, headline figures (revenue, market cap) are often close to correct in recent models. The problem is worst for mid-cap and small-cap companies, historical data, and any derived metric that combines multiple data points. That is most of what investors actually need.

What kinds of financial questions trigger hallucination

Not every financial question is equally risky. The hallucination rate depends on how specific the question is, how commonly the data appears in training corpora, and whether the answer requires combining multiple data points. Here is how different question types break down:

Question type Hallucination risk Why Shibui covers
Current stock price High Training cutoff means any "current" price is stale Yes (end-of-day)
Latest quarterly earnings (revenue, EPS) High Most recent quarter rarely in training data Yes
Valuation multiples (P/E, EV/EBITDA) Very high Derived from price + financials, both may be wrong Yes (daily history)
Technical indicators (RSI, MACD, Bollinger Bands) Very high Require exact daily price sequences Claude does not have Yes (56 indicators)
Historical comparisons ("revenue growth 2020-2024") Medium-high Older data may be in training, but Claude mixes periods Yes (back to 1962)
Cross-market screening ("P/E under 15 with 3yr FCF growth") Extreme Requires querying thousands of companies at once Yes (~10,000 stocks)
News interpretation, analyst opinions High Subjective, no single data source No

The pattern: anything that requires current, precise, or cross-company data is high risk. Single mega-cap revenue figures from past years are the safest, but even those can be off by a few percent. If you are backtesting a strategy or screening across the market, hallucinated inputs make the entire analysis unreliable.

Why prompts and workarounds do not fix this

The most common workaround is adding a disclaimer to the system prompt: "always state when you are unsure about data." Claude may add a caveat, but the underlying number is still generated from training weights. A confident disclaimer does not make a fabricated figure real.

Uploading a CSV or PDF works for one company at a time. You download a financial statement, attach it to the conversation, and Claude reads from the document. This is accurate but does not scale. You cannot upload financials for 10,000 companies. The document goes stale the day after you download it.

Web search lets Claude pull figures from financial websites. This works for spot-checking one number, but it cannot screen thousands of companies at once, cannot run temporal queries across multiple periods, and returns data in inconsistent formats. It is a workaround, not a data infrastructure.

None of these approaches give Claude a database. They patch the symptom without fixing the cause.

The fix: connect Claude to a real database

MCP (Model Context Protocol) lets Claude connect to external data sources. Shibui Finance is an MCP server that gives Claude read access to a pre-built financial database. Once connected, Claude writes SQL queries against real data instead of generating from training weights. Every number traces back to a daily-refreshed data source, not a language model. Setup takes about two minutes with the step-by-step connection guide.

On Shibui, you ask

"What is Tesla's current P/E ratio, and how has it changed over the past 5 years?"

Without Shibui, Claude generates a plausible P/E from training data. With Shibui, Claude queries the valuation table for Tesla's daily P/E history, returns the current value from yesterday's close, and shows the 5-year trajectory with actual dates. The difference is not the quality of the prompt. It is whether the model has access to real data.

Before and after

Simple lookup. Ask: "What is NVIDIA's P/E ratio?" Without a data source, Claude says "approximately 65" (may be months stale, may be fabricated). With Shibui, Claude queries the valuation table and returns yesterday's closing value with the exact date.

Screening. Ask: "Find stocks with P/E below 15 and positive free cash flow for 3 consecutive years." Without a data source, Claude lists companies it remembers from training, with no guarantee the criteria are currently true. With Shibui, Claude screens 9,900+ companies against actual quarterly financials and valuation data, checking each individual year.

Technical analysis. Ask: "Which stocks crossed below their 200-day moving average this week with RSI under 30?" Without a data source, Claude cannot answer. It has no price data after its training cutoff. With Shibui, Claude queries the technical indicators table, which is updated daily with 56 pre-calculated indicators including RSI, MACD, Bollinger Bands, and moving averages.

What this does not solve

Claude may still hallucinate about things outside the database: news events, management commentary, analyst opinions, macroeconomic interpretations. Shibui gives Claude financial data. It does not give Claude judgment.

The data is end-of-day, not real-time. Intraday prices and after-hours moves are not available. Coverage is US equities only (NYSE, NASDAQ). No international markets, options, crypto, or commodities. The data is not from Bloomberg or Refinitiv. It is good for screening and analysis but not institutional-grade for regulatory compliance.

If Claude writes a wrong SQL query, the numbers will be real but the logic may be flawed. Shibui solves the data problem, not the reasoning problem. See the data sources page for what is covered and the feature overview for the kinds of analysis Shibui supports.

This does not make Claude a financial advisor. It makes the numbers real. See how to fact-check a stock claim for a step-by-step walkthrough.

Verify it yourself

Do not take our word for it. Connect Shibui to Claude (it takes under two minutes and is free), then run this test:

  1. Ask Claude without Shibui: "What is Apple's current P/E ratio?"
  2. Ask the same question with Shibui connected.
  3. Compare the Shibui result to Apple's Yahoo Finance page or the SEC EDGAR filing.

When Claude answers from training data, the P/E ratio is typically months or years stale. When it answers from Shibui, the number matches the latest daily valuation in the database, refreshed every trading day.

Frequently asked questions

Does Claude make up stock market data?

Yes, when it has no data source connected. For example, Claude might estimate Tesla's P/E ratio at 65 when the actual value is above 300. The error is not random - Claude generates numbers that look plausible based on training data patterns, which makes them harder to catch. Connecting Claude to a verified database via MCP eliminates this: every number comes from a query, not a guess.

How does an MCP server prevent AI hallucination in finance?

An MCP server gives Claude access to a real database. Instead of generating a P/E ratio from training weights, Claude writes a SQL query against actual market data and returns the result. The numbers come from daily-refreshed data sources, not from the model's memory. Shibui Finance provides this for nearly 10,000 US equities across 64 years of history.

Is Shibui Finance data real-time?

No. Shibui data is refreshed daily after market close: end-of-day prices, quarterly financials, daily valuations. It is not real-time. For the most recently reported quarter's financials, the data is current. For intraday prices or after-hours moves, Shibui does not have that data.

Why is Claude bad at answering stock market questions?

Claude has no built-in connection to financial data. Its training has a cutoff date, so it cannot know last quarter's earnings. It has no price feed, so it cannot compute current P/E ratios. And it has no way to signal which numbers it is confident about versus which it invented. The fix is giving Claude a database to query, not asking it to try harder.

Can Claude give accurate stock data if I ask the right way?

No amount of prompt engineering gives Claude access to data it does not have. The fix takes 2 minutes: connect Shibui Finance (a free MCP server) to Claude. After that, Claude queries a real database instead of generating numbers from memory. Works on both the free and paid Claude plans, no API keys needed.

How do I prevent Claude from hallucinating numbers when analyzing finance news?

Claude cannot access current financial data from news articles or earnings reports. When you ask about a company's latest quarter, Claude generates numbers from training data that may be quarters or years out of date. Connect Shibui Finance via MCP to give Claude a database refreshed daily with prices, quarterly financials, and valuations for nearly 10,000 US companies.

Does ChatGPT hallucinate stock data too?

Yes. Every major LLM (Claude, ChatGPT, Gemini) generates plausible but unverified financial figures when it has no data connection. The problem is architectural, not model-specific: no LLM has a built-in financial data feed. MCP servers like Shibui Finance solve this by giving the model database access. Claude supports MCP natively; ChatGPT supports it via developer mode apps. See the ChatGPT version of this guide for ChatGPT-specific setup and details.

How accurate is Claude for financial analysis?

Without a data connection, Claude's financial figures are unreliable: sometimes close for mega-caps, often wrong for mid-caps, and always unverifiable. With Shibui Finance connected, accuracy depends on query logic, not model memory. The numbers come from a database, so they are as accurate as the underlying data source (daily-refreshed US equity data back to 1962).

Connect Shibui to Claude in 2 minutes

Shibui is free. Connect it to Claude and get financial data from a verified database instead of the model's training data.

Connect to Claude →