-
Notifications
You must be signed in to change notification settings - Fork 6
Add channel context for new conversations #5
Copy link
Copy link
Open
Description
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 = 10constant - In new mention handler, fetch recent messages
- Format as
username: contentarray - Pass to Claude as part of the prompt or prepended context
Priority
Medium - improves conversation quality for new threads
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels