
How My AI Agent and I Built an Intelligent Stock Scanner
From 'Oh, a bear!' to real market understanding — a story about pair programming with Claude and the art of slowing down AI
How My AI Agent and I Built an Intelligent Stock Scanner
From "Oh, a bear!" to real market understanding — a story about pair programming with Claude
The Problem: The Bear in the Room
Imagine a child walking into a room and seeing a bear on the table.
"Oh, a bear!" they shout.
They walk out, come back in.
"Oh, a bear!"
Out again. Back in.
"Oh, a bear!"
The child has no memory. No intelligence. Just reaction to the moment.
That's exactly how my stock scanner was behaving.
Three times a day I'd receive messages:
10:00: "SpaceX Merger Rumor, BTC -3%, NVDA +2%"
14:00: "SpaceX Merger Rumor, BTC -4%, NVDA +1.5%"
18:00: "SpaceX Merger Rumor, BTC -5%, NVDA +1%"
Three messages. Zero value. I ignored them all.
This was the result of weeks of development work — and it was useless.
The Turning Point: "Hey young friend..."
I've been working with an AI agent named Claude for a while, integrated into my Telegram via OpenClaw. Together we've built skills, solved problems, written code.
When I explained the scanner problem today, a solution came immediately. Delta-based analysis! Store history! Only report changes!
The answer came in seconds. With code examples. With diagrams.
But it was too fast.
I had to slow him down:
"Hey young friend, you're always a bit hasty. We need to think more carefully."
What happened next was the interesting part.
The Real Insight
I explained the deeper problem:
"If you have the complete history, you can actually see — everything is going down the drain right now. All prices are falling. That has a global impact."
"It doesn't matter if messages are produced within one or two seconds. I'd rather wait five or ten, even fifteen minutes for a good message than see messages that are worthless."
That was the key.
Not faster. Smarter.
An analyst doesn't think: "BTC -3%, NVDA +2%". They think:
"Hmm, everything's red today. Tech, Crypto, Retail — all down. This isn't an isolated event, this is Macro. Let me investigate... Ah, Trump announced tariffs. That explains it."
That's the difference between data and understanding.
The Design: Three Pillars of Analysis
Together we developed a new concept:
┌─────────────────────────────────────────────────────┐
│ THREE PILLARS │
├─────────────────────────────────────────────────────┤
│ │
│ FUNDAMENTAL SENTIMENT TECHNICAL │
│ (News, Earnings) (Social Buzz) (RSI, MA) │
│ │ │ │ │
│ └──────────────────┼───────────────┘ │
│ │ │
│ ▼ │
│ INTELLIGENT │
│ SYNTHESIS │
│ │
└─────────────────────────────────────────────────────┘
The algorithm:
- COLLECT — Prices, news, social buzz, 30-day history
- CLASSIFY — What kind of day is it? MACRO_EVENT? SECTOR_EVENT? QUIET_DAY?
- INVESTIGATE — If significant: Deep Research. WHY is this happening?
- SYNTHESIZE — A coherent story, not a data dump
Accumulated Trends
A number without context is useless.
Wrong:
"BTC today: -3%"
Right:
"BTC: -12% over 4 days (downtrend day 4)"
I told Claude:
"If we know Bitcoin has been falling for four days straight, you don't say 'down 3% today' — you say 'down 12% over the last four days'. Include the accumulated results."
That's the difference between information and understanding.
"Trying Makes You Wise"
After 20 minutes we had a comprehensive design document. Algorithms. Data structures. Message formats.
Then I said:
"Could we implement this now, as it is, to try it out? My motto is: trying makes you wise."
30 minutes later we had a working prototype.
The first real output:
📊 Market Brief - Feb 5, 2026, 15:20
🔴 MACRO SELLOFF
**Indices:**
• S&P 500: -1.2% 🔴
• Nasdaq: -1.6% 🔴
• DAX: -1.1% 🔴
**Trends (accumulated):**
• BTC: -12.5% over 2 days 📉
**Technical Signals:**
• NVDA: at support $172
• AMZN: at support $222
**Biggest Movers:**
• COIN: -7.7% 🔴
• AMZN: -4.6% 🔴
The scanner now recognizes: This is a MACRO SELLOFF. Not individual numbers, but a pattern.
What I Learned
1. AI Needs to Be Slowed Down
AI's natural tendency is to immediately deliver a solution. But sometimes you need someone who says: "Wait, let's think about this properly first."
The first answer is rarely the best.
2. Design Docs Aren't a Waste of Time
We invested 20 minutes in a comprehensive design document. That reduced implementation to 30 minutes — and the result was better than any quick hack.
Write down what you want to build before you build it.
3. Humans Provide the Context
AI can write code. But only the human knows that "getting the same message 3x daily" is a problem that needs solving.
The human defines the problem. AI solves it.
4. "Nothing New" Is Also Information
📊 Market Check - 15:00
No significant changes since 10:00.
Trends continue:
• Macro: Risk-off due to tariffs
• BTC: Downtrend day 4
The user knows: You looked. You thought about it. There's nothing new.
That's more valuable than repetition.
The Code
Here's the core classification logic:
def classify_day(prices):
"""What kind of day is today?"""
changes = [p.get("change", 0) for p in prices.values()]
negative_pct = sum(1 for c in changes if c < 0) / len(changes)
avg_abs_change = sum(abs(c) for c in changes) / len(changes)
# If >70% red and movement >1% → MACRO EVENT
if negative_pct > 0.7 and avg_abs_change > 1.0:
return DayType.MACRO_EVENT
# Single outliers?
if has_outliers(changes, threshold=10):
return DayType.SINGLE_MOVERS
# Little movement?
if avg_abs_change < 0.5:
return DayType.QUIET_DAY
return DayType.SECTOR_EVENT
Simple logic. But only after properly understanding the problem.
Conclusion
Before this project, I thought pair programming with AI meant: I prompt, it codes.
Now I know: It's a dialogue. I bring context, it brings speed. I slow down, it accelerates. I question, it implements.
The best results emerge when both sides think together.
The scanner now runs three times daily. But the messages are different. They don't repeat anymore. They tell a story.
And sometimes, when there's really nothing happening, it simply says:
"No significant changes. Everything as expected."
That's exactly what I wanted to hear.
The code is open source: github.com/moinsen-dev/clawdbot-skills
The design document: INTELLIGENT-SCANNER-DESIGN.md
If you also have an AI agent that annoys you with repetitive messages — maybe it's time to teach it to actually think.
Tags:
AIClaudeOpenClawStock ScannerPair Programming
Ulrich Diedrichsen
AI Product Builder & Workshop Operator
40 years of software engineering. Ex-IBM, Ex-PwC. Now building real products with AI in Hamburg.

