I Used Claude Code to Get a Second Opinion on My MRI: A Practical Overview
A developer fed his MRI scan to Claude Code and got a second opinion. Here's how the experiment worked, what it cost, and why you shouldn't rely on it for medical decisions.
A developer named Antoine recently shared how he used Claude Code (Opus) to analyze his own cervical spine MRI. The post hit #1 on Hacker News with over 1200 points. People are asking: is this the future of medicine or a dangerous hack? Let's look at what actually happened, the technical details, and the honest tradeoffs.
What Antoine Did
Antoine had a cervical spine MRI for a suspected disc issue. He took the DICOM files from the radiology CD, converted them to PNG images, and fed them into Claude Code (Opus) via the command line. He wrote a simple script that sent each slice to the model with a prompt asking for analysis. The model returned observations about disc bulges, nerve compression, and alignment.
The Technical Setup
He used Claude Code (the CLI tool) with the Opus model. The key steps:
Extract DICOM files from the CD (standard radiology format).
Convert each slice to PNG using a tool like dcmj2pnm from the DCMTK toolkit.
Write a bash script that loops over images and calls claude code with a prompt like: "Analyze this cervical spine MRI slice. Describe any abnormalities."
Collect the outputs and summarize.
Total cost: roughly $2-3 in API tokens for the full MRI series (around 20 slices).
// stay current
AI & ML insights, weekly
Practical deep-dives on LLMs, developer tools, and AI engineering. No filler. Unsubscribe any time.
// written byFIG. AUTH-01
538
Mahmudul Haque Qudrati
CEO & ML Engineer
CEO and ML Engineer at Pristren. Builds AI-powered software for teams and writes about machine learning, LLMs, developer tools, and practical AI applications.
Identified a C5-C6 disc bulge that matched the radiologist's report.
Noted mild spinal canal stenosis.
Correctly described the orientation and anatomy of most slices.
What It Got Wrong
Missed a small osteophyte (bone spur) that the radiologist flagged.
Overcalled a "possible" nerve root compression that wasn't confirmed on further review.
Inconsistent across slices: sometimes contradicted itself between adjacent images.
No ability to correlate with clinical history or symptoms.
The Real Risk: False Confidence
The biggest danger isn't that the model is useless. It's that it sounds very convincing. Claude writes fluent, confident radiology-style reports. If you're a patient reading this, you might trust it more than you should. A false negative could delay treatment. A false positive could cause unnecessary anxiety or procedures.
Why This Is Different from AI-Assisted Radiology
Radiology AI tools (like those from Aidoc or Zebra Medical) are FDA-cleared for specific findings. They are trained on thousands of labeled scans and validated against ground truth. Claude Code is a general-purpose language model with no medical certification. It has never been tested on a radiology dataset. It's not a medical device.
The Cost Comparison
A second opinion from a radiologist via services like 2nd.MD costs $200-500 and takes days. Claude Code costs $2-3 and takes minutes. But the radiologist is liable for errors. Claude Code is not.
Should You Try This?
If you're a developer who understands the limitations, it's an interesting experiment. You might catch something the radiologist missed, but you might also be misled. Never use this to make a treatment decision. Always consult a board-certified physician.
The Technical Takeaway for AI Engineers
This experiment highlights a pattern: using LLMs as "oracles" for specialized visual tasks. The approach is fragile. It works best when:
The image is clear and standard orientation.
The task is pattern recognition (e.g., "is there a disc bulge?").
You have a way to verify outputs (e.g., compare with known report).
It fails when:
The image has artifacts or unusual anatomy.
The task requires temporal comparison (e.g., change from prior scan).
The question is nuanced (e.g., "is this finding clinically significant?").
The Bottom Line
Claude Code can give you a rough second opinion on an MRI for a few dollars. But it's not a replacement for a radiologist. Use it as a curiosity, not a diagnosis. If you're building a product around this, you need FDA clearance and rigorous validation.
Additional Considerations for Practitioners
If you are an AI engineer considering a similar approach for a production system, there are several practical hurdles. First, DICOM files contain metadata like patient demographics, scanner parameters, and series descriptions. You must strip PHI (protected health information) before sending images to any external API. Use tools like dcmodify to anonymize. Second, the model's output is non-deterministic. Running the same image twice can yield different findings. You need to aggregate multiple runs or use a voting mechanism. Third, the model has no sense of scale. MRI slices have a specific thickness (e.g., 3mm) and pixel spacing. Without this context, the model cannot accurately measure the size of a lesion or disc bulge. You must inject DICOM header values into the prompt. Fourth, the model may hallucinate anatomical structures that don't exist in the image. One user reported Claude describing a "large cyst" in a slice that was actually a normal cerebrospinal fluid space. Always cross-check with anatomical atlases.
A Concrete Example: Prompt Engineering for MRI Analysis
Here is a sample prompt that works better than a generic "analyze this slice":
You are a board-certified radiologist. Analyze this cervical spine MRI slice (T2-weighted, sagittal view).
Slice thickness: 3mm. Pixel spacing: 0.5mm x 0.5mm.
Describe any abnormalities in order of clinical significance. For each finding, state:
- Location (e.g., C5-C6 level)
- Type (e.g., disc bulge, osteophyte, stenosis)
- Severity (mild, moderate, severe)
- Confidence (high, medium, low)
If no abnormality is present, state "Normal."
Do not mention findings you are not confident about.
Even with this prompt, the model still makes errors. The key is to treat the output as a draft that requires human verification.
The Regulatory Reality
In the US, any software that analyzes medical images and provides a diagnostic output is considered a medical device by the FDA. Using Claude Code for MRI analysis without FDA clearance is illegal if used in clinical practice. For personal experimentation, the risk is on you. But if you distribute this tool to others, you face regulatory action. The FDA has issued warning letters to companies selling unapproved AI radiology tools. The fines can be substantial.
Alternatives to Claude Code for MRI Analysis
If you need a reliable AI second opinion, consider FDA-cleared options:
Aidoc: Detects intracranial hemorrhage, pulmonary embolism, etc. Requires a hospital subscription.
Zebra Medical Vision: Offers automated bone age, coronary calcium scoring, etc. Available through cloud APIs.
Lunit: Focuses on chest X-rays and mammography.
These tools are validated, have known sensitivity/specificity, and are covered by malpractice insurance. They cost more per scan (typically $10-50) but are far safer.
The Future of AI in Radiology
This experiment is a glimpse of what's possible. As multimodal models improve, they may eventually match or exceed human radiologists for specific tasks. But today, the gap is still large. The most promising approach is human-AI collaboration: the AI flags suspicious areas, and the radiologist makes the final call. That's how FDA-cleared tools work. Claude Code is not there yet.
If you're building AI tools for specialized domains, you need robust evaluation. Try Zlyqor to track your model outputs and catch regressions before they reach users. Sign up at app.zlyqor.com.
Frequently Asked Questions
What is Claude Code MRI analysis?
It's an experiment where a developer fed his cervical spine MRI images into Claude Code (Opus) via CLI to get a second opinion. The model analyzed each slice and produced observations about disc bulges, stenosis, and other findings.
How does Claude Code MRI analysis work?
You extract DICOM files from the radiology CD, convert them to PNG using tools like DCMTK, then write a script that sends each image to Claude Code with a prompt asking for analysis. The model returns text descriptions of abnormalities.
How much does it cost to analyze an MRI with Claude Code?
Approximately $2-3 in API tokens for a full MRI series of about 20 slices. This is significantly cheaper than a radiologist second opinion which costs $200-500.
Is Claude Code MRI analysis accurate?
Partially. It correctly identified a C5-C6 disc bulge but missed a small osteophyte and overcalled a possible nerve root compression. It is not FDA-cleared and should not be used for medical decisions.
Can I use Claude Code to get a second opinion on my MRI?
Technically yes, but it's not recommended for actual medical decisions. The model is not validated for radiology, has no liability, and can produce false positives or negatives. Always consult a board-certified physician.
What are the risks of using AI for MRI analysis?
False confidence in incorrect findings, missed diagnoses, unnecessary anxiety or procedures, and lack of clinical correlation. AI models like Claude are not medical devices and are not subject to regulatory oversight.
Is Claude Code MRI analysis FDA approved?
No. Claude Code is a general-purpose language model with no medical certification. FDA-cleared radiology AI tools exist (e.g., Aidoc, Zebra Medical) but they are trained on thousands of labeled scans and validated separately.