-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
The session-memory hook currently captures the last 15 JSONL lines from a session. This can be insufficient for longer conversations, and the count should be configurable.
Proposed Changes
- Add
messagesconfig option to hook entry:
{
"hooks": {
"internal": {
"entries": {
"session-memory": {
"enabled": true,
"messages": 100
}
}
}
}
}-
Fix message filtering order: Currently the code does
slice(-15)first, then filters for user/assistant messages. This means if those 15 lines contain tool calls, you get fewer actual messages.Proposed: Filter user/assistant messages first, then slice to guarantee N actual conversation messages.
-
Default: Keep 15 for backward compatibility.
Use Case
Power users with long sessions want to capture more context when running /new. I've been running a local override with messages: 100 and it works great.
Implementation Notes
- Config schema update for hook entry type
- Handler reads
messagesfrom config - HOOK.md documentation update
- Will include tests
Happy to submit a PR for this! 🦞
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request