Repository navigation
v0.2.0: Custom prompts, historical summarise, nested session fix - #3
Merged
Merged
Conversation
Users can override the default compaction prompt by setting SEAMLESS_PROMPT_FILE to a file path. Tilde expansion supported. Validation relaxed for custom prompts — section-name check skipped, minimum length still enforced.
Instructs the summariser to preserve the user's original requests, clarifications, and stated constraints verbatim. Only direction-shaping messages, not every message. Also updates expected sections in validation config.
New feature: custom compaction prompts via SEAMLESS_PROMPT_FILE.
Add custom compaction prompt section explaining the env var, tilde expansion, silent fallback, and relaxed validation. Update section list from 5 to 6 with User Intent. Add SEAMLESS_PROMPT_FILE to configuration table.
claude-summarise resolves any historical session ID (or prefix) to its transcript and runs the compactor. Supports --list, --force, and prefix matching. Strip CLAUDECODE env var when spawning claude -p so compaction works from inside a Claude Code session.
There was a problem hiding this comment.
Pull request overview
This PR bumps seamless-claude to v0.2.0 by adding custom compaction prompt support, introducing a new “User Intent” section in summaries, and adding a claude-summarise CLI for summarising historical sessions; it also attempts to fix nested-session spawning by stripping CLAUDECODE from the child environment.
Changes:
- Add
SEAMLESS_PROMPT_FILEto fully override the default compaction prompt and relax section validation when active. - Add a new
claude-summarisecommand (script + bin wrapper) to summarise historical sessions by ID/prefix and list available sessions. - Update prompt/validation config for the new “User Intent” section and adjust docs/changelog accordingly.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Version bump to 0.2.0 and register claude-summarise binary. |
| scripts/compactor.mjs | Adds “User Intent” section; supports loading a custom prompt file; passes custom-prompt flag into validation. |
| scripts/summarise.mjs | New script to locate historical transcripts and run the compactor against them. |
| bin/claude-summarise | New CLI wrapper that forwards args to scripts/summarise.mjs. |
| lib/claude.mjs | Attempts to strip CLAUDECODE from spawned claude -p environment. |
| lib/validate.mjs | Adds customPrompt mode to skip section-name checks. |
| lib/config.mjs | Adds “User Intent” to EXPECTED_SECTIONS. |
| README.md | Documents custom prompts, new “User Intent” section, and claude-summarise. |
| CHANGELOG.md | Adds v0.2.0 release notes. |
Comments suppressed due to low confidence (1)
lib/validate.mjs:16
validateResult()now has acustomPromptmode that skips section validation, but there are no tests covering the new behavior (e.g., long output with no expected headings should be accepted whencustomPrompt=true, while short output should still fail). Adding/adjusting unit tests will help prevent regressions in this new branch.
}
if (result.length < MIN_RESULT_LENGTH) return false
if (customPrompt) return true
const lower = result.toLowerCase()
const found = EXPECTED_SECTIONS.filter((s) =>
lower.includes(s.toLowerCase()),
).length
return found >= 3
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Wrap statSync in try/catch for TOCTOU resilience. Fix misleading --list example (filters by session ID prefix, not project name).
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.
Summary
SEAMLESS_PROMPT_FILEenv var to overridethe default compaction prompt entirely
preserves user's original requests verbatim
claude-summariseCLI to summarise anyhistorical session by ID or prefix
CLAUDECODEenv var so
claude -pworks from inside aClaude Code session
Changed files
package.jsonclaude-summarisebinscripts/compactor.mjsscripts/summarise.mjsbin/claude-summariselib/claude.mjsCLAUDECODEfrom child envlib/validate.mjslib/config.mjsUser IntenttoEXPECTED_SECTIONSREADME.mdCHANGELOG.md