Summary
When a new thread is created from an @mention, fetch the last 10 messages from the channel to give Claude context about what was being discussed.
How Andy Does It
In bot.ts lines 410-415:
const CONTEXT_MESSAGE_COUNT = 10;
const recentMessages = await message.channel.messages.fetch({ limit: CONTEXT_MESSAGE_COUNT });
const recentContext = recentMessages
.filter(m => m.id !== message.id && m.id !== statusMessage.id)
.map(m => `${m.author.username}: ${m.content}`)
.reverse();
This is sent to Andy Core as recentContext in the payload.
Why This Matters
- User @mentions bot in the middle of a conversation
- Without context, Claude only sees the @mention
- With context, Claude knows what people were discussing
Not Redundant With --resume
recentContext = channel history BEFORE the thread ("what was being discussed?")
--resume = thread history INSIDE the session ("continue our conversation")
Implementation for Cord
- Add
CONTEXT_MESSAGE_COUNT = 10 constant
- In new mention handler, fetch recent messages
- Format as
username: content array
- Pass to Claude as part of the prompt or prepended context
Priority
Medium - improves conversation quality for new threads
Summary
When a new thread is created from an @mention, fetch the last 10 messages from the channel to give Claude context about what was being discussed.
How Andy Does It
In
bot.tslines 410-415:This is sent to Andy Core as
recentContextin the payload.Why This Matters
Not Redundant With --resume
recentContext= channel history BEFORE the thread ("what was being discussed?")--resume= thread history INSIDE the session ("continue our conversation")Implementation for Cord
CONTEXT_MESSAGE_COUNT = 10constantusername: contentarrayPriority
Medium - improves conversation quality for new threads