pre-session-end
gjkim42/kanon-repo
Capture session learnings and propagate project settings before ending work.
What is pre-session-end?
Run this skill when wrapping up a Claude Code session to analyze patterns that could become reusable skills or commands, and propagate useful project permissions to global settings. It helps preserve knowledge and configuration across sessions.
- Detects repeated workflows and problem-solving patterns that could become reusable skills
- Identifies multi-step sequences suitable for slash commands or specialized agents
- Extracts learnable domain-specific knowledge and code patterns from the session
- Analyzes project-level permissions and selectively propagates generic ones to global settings
- Provides English correction of the original user prompt if needed
- Requires explicit user confirmation before creating any skills or modifying settings
How to install pre-session-end
npx skills add https://github.com/gjkim42/kanon-repo --skill pre-session-endHow to use pre-session-end
- 1.Invoke the skill when you say goodbye, indicate you're done, or complete significant work
- 2.Review the English correction of your original prompt if provided
- 3.Examine each proposed skill, command, or agent candidate and approve or decline
- 4.Decide whether to propagate each project permission to global settings
- 5.Confirm all changes before the skill applies them to your local configuration
Use cases
- End a coding session and automatically capture workflows you repeated multiple times
- Propagate tool permissions (like Bash or WebFetch) from a project to your global Claude settings
- Convert a successful problem-solving approach into a reusable skill for future sessions
- Review and preserve domain-specific knowledge or code patterns discovered during work
- Maintain a learned-skills library that grows with your coding practices
- Claude Code and Cursor users who want to build personal skill libraries over time
- Developers working on projects with specialized workflows or permissions
- Teams seeking to capture and reuse successful patterns across sessions
- Anyone who repeats similar multi-step processes and wants to automate them
pre-session-end FAQ
Use it proactively when the user says they're done, wrapping up, ending the session, or saying goodbye. Also use it when significant work is completed without an explicit request to continue.
No. The skill never auto-applies changes and always requires your explicit confirmation. It will not overwrite existing skills or settings without your approval.
Generic tool permissions like Bash(git:*), Bash(npm:*), Bash(docker:*), and similar broadly-useful permissions. Project-specific paths and domain-specific settings are kept project-only unless you approve otherwise.
Yes. For each skill candidate, you can choose to create it as-is, edit it, or decline it entirely.
Approved skills are created in ~/.claude/skills/learned/ so they persist across sessions and projects.
Full instructions (SKILL.md)
Source of truth, from gjkim42/kanon-repo.
name: pre-session-end description: Use this skill PROACTIVELY when the user indicates they are done working, ending the session, wrapping up, or saying goodbye. Also use when significant work has been completed and the user hasn't explicitly asked to continue. Analyzes the session to evolve skills/commands/agents and propagates useful project permissions to global settings.
Pre-Session-End Skill
Run this skill before ending a Claude Code session to capture learnings and propagate useful settings.
When to Activate
- User says: "done", "wrapping up", "ending session", "goodbye", "that's all", "I'm finished"
- Significant work completed without explicit continuation request
- User explicitly invokes
/pre-session-end
Workflow
Step 0: English Correction
Before proceeding with other steps, provide a corrected or more natural version of the user's original prompt from this session.
Format:
## English Correction
**Original:** [user's original prompt]
**Corrected:** [corrected/more natural version]
[If changes are significant, add brief explanation of what was changed and why]
- Only include this section if corrections are needed
- Focus on grammar, word choice, and natural phrasing
- Keep explanations concise
Step 1: Analyze Session for Learnable Patterns
Review the chat history and identify:
Skill Candidates
Patterns that could become reusable skills:
- Repeated workflows (e.g., "always run tests before commit")
- Problem-solving approaches that worked well
- Domain-specific knowledge applied multiple times
- Code patterns or architectures used consistently
Command Candidates
Operations that could become slash commands:
- Multi-step sequences performed repeatedly
- Common parameter combinations for tools
- Project-specific workflows
Agent Candidates
Specialized task patterns that could become agents:
- Complex multi-tool operations
- Tasks requiring specific expertise or context
- Recurring analysis or review patterns
Step 2: Present Extracted Learnings
For each candidate, present to user:
**Potential Skill: [name]**
- Pattern observed: [description]
- Would save: [how it helps]
- Proposed location: ~/.claude/skills/learned/[name].md
Create this skill? [Yes/No/Edit]
Step 3: Propagate Project Permissions to Global
- Read project settings:
.claude/settings.local.json - Read global settings:
~/.claude/settings.json - Identify permissions in project but not in global
For each permission found only in project settings:
Categorize the permission:
- Generic tool permissions:
Bash(git:*),Bash(npm:*),Bash(docker:*)→ likely useful globally - Domain-specific web:
WebFetch(domain:docs.example.com)→ ask user if generally useful - Project-specific paths: Contains project directory paths → skip (not portable)
- MCP server permissions:
mcp__*→ ask user (may be project-specific)
Present each selectively:
**Permission found in project settings:**
`Bash(helm template:*)`
This permission allows: Running helm template commands
Currently: Project-only
Recommendation: [Useful globally / Project-specific]
Propagate to global settings? [Yes/No]
Step 4: Apply Approved Changes
- For approved skills: Create files in
~/.claude/skills/learned/ - For approved permissions: Update
~/.claude/settings.json - Report what was applied
Step 5: Session Summary
Provide a brief summary:
## Session Wrap-Up Complete
**Learnings captured:**
- [X] Created skill: skill-name
- [X] Created command: command-name
- [ ] Skipped: pattern-name (user declined)
**Permissions propagated:**
- [X] Bash(helm:*) → global
- [ ] WebFetch(domain:internal.corp) → kept project-only
**Ready to end session.**
Important Notes
- Never auto-apply: Always get user confirmation for each change
- Preserve existing: Don't overwrite existing skills/settings without explicit approval
- Be selective: Only propose truly useful patterns, not every repeated action
- Explain value: For each proposal, explain why it's worth saving
Related skills
More from gjkim42/kanon-repo and the wider catalog.

review-all
Run parallel code reviews from two independent agents for high-confidence findings.

api-review
Review Kubernetes API and CRD design quality for Kelos changes and proposals.

design-cleanup
Remove design-change leftovers and rewrite code as if the new design was always there.

gjkim-instruction
Create and maintain gjkim_instruction.md, a root document for loop-engineering efforts.

gluestack-ui-v4:components
Component usage patterns for gluestack-ui v4 - covers component selection, props vs className, compound patterns, icons, and provider setup.

gmgn-contract-dd
Single 0-100 contract safety score combining security, holder structure, and price action for one token address.