Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new host-intercepted chat command to reset conversation session state for a group, addressing the need to start fresh without accumulated history.
Changes:
- Add
/new-session(and main-group-only/new-session <folder>) command handling in the host message router. - Add
deleteSession(groupFolder)DB accessor and accompanying unit tests. - Document
/new-sessionalongside existing host-level commands in the globalCLAUDE.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/index.ts | Intercepts /new-session and clears stored session state. |
| src/db.ts | Adds deleteSession to remove a session row by group_folder. |
| src/db.test.ts | Adds coverage verifying deleteSession behavior. |
| groups/global/CLAUDE.md | Documents /new-session as a host-handled command. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Mar 22, 2026
73f1987 to
b412d52
Compare
0c0ffd0 to
2f6da1f
Compare
cdbdf5a to
39f0e00
Compare
Author
|
@alaminrifat and @gavrielc test this functionality in my local installation. Works as expected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Change
.claude/skills/<name>/, no source changes)Description
We add a
/new-sessionchat command that lets users clear the current Claude SDK session for a group, forcing the next message to start with a clean conversation history. The command is handled entirely by the host process before routing to the agent, so the agent never sees it. We used the/remote-controlfeature for reference.In non-main groups it is restricted to the device owner (is_from_me); in the main group any sender can use it, and a
/new-session <folder>variant allows clearing another group's session by folder name.Also added an IPC command to reset the current sessionId inside running containers.
The global CLAUDE.md is updated to document
/new-sessionalongside/remote-controlso the agent can inform users about available commands.solves #1211
- [x] tested on local and new installation