MCPInstall

pre-session-end

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.

Installs
1.7K
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/gjkim42/kanon-repo --skill pre-session-end
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads pre-session-end automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

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

  1. Read project settings: .claude/settings.local.json
  2. Read global settings: ~/.claude/settings.json
  3. 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

  1. For approved skills: Create files in ~/.claude/skills/learned/
  2. For approved permissions: Update ~/.claude/settings.json
  3. 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

FAQ

What does the pre-session-end skill do?

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.

How do I install pre-session-end?

Run npx skills add https://github.com/gjkim42/kanon-repo --skill pre-session-end in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/pre-session-end/ (personal) or .claude/skills/pre-session-end/ (project).

Which AI agents can use pre-session-end?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is pre-session-end safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains pre-session-end?

It is published by gjkim42 in gjkim42/kanon-repo. It has 1,664 recorded installs.

More from gjkim42/kanon-repo

View all →

review-all

gjkim42/kanon-repo

Run a two-agent code review: spawn two fresh, clean-context agents that examine the SAME committed branch diff in parallel. One agent runs Codex's native codex review --base command, while the other independently reviews the code against Google's "What to look for in a code review" guidance. Merge both outputs into one agreement-ranked report. Use this whenever the user asks for "review-all", a second-opinion review, a dual review, a cross-check before a PR, or a maximum-confidence review of committed branch changes. Do not use it to APPLY fixes; it is review-only.

api-review

gjkim42/kanon-repo

Review the current Kelos branch, or an explicitly specified PR, issue, or diff, for Kubernetes API and CRD design quality. Use when asked for a Kelos API review, CRD/API compatibility review, Kubernetes API convention review, or review of changes under api/, generated CRDs, examples/, or self-development/ manifests. Default to the current branch when no target is specified. This skill is review-only.

gjkim-instruction

gjkim42/kanon-repo

Create and maintain gjkiminstruction.md, the root document for a loop-engineering effort. The document holds only the minimum requirements and confirmed decisions, and deliberately leaves everything else open so that later iterations are not locked into early guesses. Use whenever the user mentions gjkiminstruction.md, a root document or root doc for a loop, loop engineering, starting a long-running agent loop on a goal, or asks to record a requirement or a confirmed decision for such an effort. Also use at the start of a loop iteration to check what is already decided versus still open.

3.6K installs

design-cleanup

gjkim42/kanon-repo

Sweep the current branch for leftovers of an abandoned design after a significant mid-work decision change, and rewrite the affected code, comments, tests, and docs so the result reads as if it had been designed this way from the beginning. Use when the user says "design cleanup", "clean up the old approach", "erase the journey", says a design decision changed and asks to clean up after it, or after a pivot in approach mid-branch. This is a rewrite pass over the code touched by the decision only — not a general refactoring or bug-hunting pass.

address-pr-review

gjkim42/kanon-repo

Review the comments on a PR and address the findings that are valid and required. Use when the user says "address-pr-review", asks to address the PR review, handle or apply the review comments or review feedback on a PR, or fix what the reviewers asked for. Defaults to the PR for the current branch when none is named. This skill changes code; it is not a review pass.

pr-finish

gjkim42/kanon-repo

Finish an open PR by batching review feedback, applying valid fixes, running verification, pushing once per batch, and monitoring CI with bounded waits. Use when the user asks to update code until PR review comments are handled, review-all has no valid blocking findings, and required checks pass.

Popular other skills

View category →

hyperframes-cli

heygen-com/hyperframes

The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.

1.3M installs

triage

mattpocock/skills

Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.

1M installs

ask-matt

mattpocock/skills

Ask which skill or flow fits your situation. A router over the skills in this repo.

778.4K installs

to-questionnaire

mattpocock/skills

Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

508.9K installs

wait-what

mattpocock/skills

Stop. That last message did not land: re-pitch it.

459.7K installs

loop-me

mattpocock/skills

Grill me about specs for the workflows I want to build, within this workspace.

447.9K installs