feat(serve): session-start hook wiring + CLAUDE.md warm-start section#179
Merged
Merged
Conversation
…#155) - `charter hook print --claude` emits the UserPromptSubmit hook config JSON that auto-runs `charter context-refresh --once` at each Claude Code session open - `charter bootstrap` nextSteps now surfaces the hook command with a reason line explaining that charter_context returns live state, not a cold snapshot - Both POINTER_CLAUDE_MD templates (thin and hybrid) gain a `## Session Start` section directing agents to call charter_context before any other action, with fallback instructions for sessions without charter serve running - docs/cli-reference.md updated to document --emit-pointers Session Start output Closes #155. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Closes #155 — the final two items from the session continuity feature:
charter hook print --claude— new subcommand on the existinghookcommand that prints a copy-pasteableUserPromptSubmithook config. Pasting it into.claude/settings.jsonmakes Claude Code auto-runcharter context-refresh --onceat every session open, socharter_contextreturns live project state (open work, recent decisions, metric ceilings) before the agent acts on anything.charter bootstrapnow surfacescharter hook print --claudewith an explicit reason line: agents that skip this start cold, re-inferring constraints already declared in.ai/.## Session Startin generated CLAUDE.md — both pointer templates (POINTER_CLAUDE_MD,POINTER_CLAUDE_MD_HYBRID) now include a## Session Startsection telling Claude to callcharter_contextfirst, with a fallback path for sessions wherecharter serveisn't running..claude/settings.jsonis user-controlled. Charter emits the snippet; the user pastes it.Test plan
charter hook print --claudeoutputs valid JSON withUserPromptSubmitandcharter context-refresh --oncecharter hook print(without--claude) throws with actionable errorcharter bootstrapnext steps include the hook command entrycharter adf init --emit-pointerswritesCLAUDE.mdcontaining## Session Startandcharter_contextSession Startappears before## Environment(thin) and before## Module Index(hybrid)🤖 Generated with Claude Code