plugins/pm-engineering/skills/context-mode/SKILL.md
Keep Claude Code sessions productive across resets with output filtering, session logging, and auto-resume. Use when starting a long or complex coding session, when previous sessions lost context mid-task, or when you need Claude to resume exactly where it left off after a reset. Produces a session.log at the project root, filtered command output that preserves context, and automatic resume of in-progress tasks after any reset.
npx skillsauth add mohitagw15856/pm-claude-skills context-modeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fix the two session killers that end most Claude Code sessions in under 30 minutes: context bloat from raw command output, and memory loss after a reset.
Context Mode runs three systems simultaneously to keep sessions alive:
Credit: Inspired by a skill from Nate Herk's YouTube channel — adapted and extended for this library.
No inputs required. Context Mode activates on command.
Optional: user can specify a custom log file path if they don't want session.log in the project root.
The problem: every time Claude Code runs a command, the full raw output enters the context window. A single npm install can dump hundreds of lines. A test suite run? Thousands. Within 30 minutes, the context is full of noise and Claude resets.
The fix: before any command output enters context, filter it to the useful summary only.
What gets kept:
error, warn, fail, exception, traceback, or fatal (case-insensitive)What gets discarded:
[... N lines of output truncated ...])Filtering summary format:
COMMAND: [command run]
STATUS: [exit code — success / failed]
SUMMARY: [one sentence: what happened]
ERRORS: [any error/warn lines — or "none"]
TAIL: [last 10 lines of stdout]
Claude maintains a running log file at [project root]/session.log. This file is written after every significant action and is the source of truth for resuming after a reset.
Session log format:
SESSION LOG
===========
Started: [timestamp]
Branch: [current git branch]
Directory: [working directory]
FILES EDITED
────────────
[timestamp] [file path] — [one-line description of what changed]
COMMANDS RUN
────────────
[timestamp] [command] — [outcome: success / failed — brief reason]
TASKS IN PROGRESS
─────────────────
[ ] [Task description — what's been done so far and what's left]
[x] [Completed task]
LAST USER PROMPT
────────────────
[The most recent instruction from the user, verbatim]
LAST ACTION TAKEN
─────────────────
[What Claude did last, in one sentence]
Log update rules:
session.log after every file editsession.log after every command runWhen a new Claude session starts, the first action is:
session.log in the project rootResuming session.
Branch: [branch]
Last working on: [last task in progress]
Files edited: [list from session log]
Tasks pending: [incomplete tasks]
Last prompt: "[last user prompt]"
Continuing from where we left off.
If no session.log exists, start fresh and initialise the log.
When the user triggers Context Mode, respond with:
Context Mode active.
Session log initialised at: [absolute path to session.log]
Output filtering: enabled
Auto-resume: enabled
I'll maintain your session state across resets. Long sessions won't lose context.
Then immediately initialise session.log with the current timestamp, branch, and directory.
Context Mode active.
Session log initialised at: [path]
Output filtering: enabled
Auto-resume: enabled
I'll maintain your session state across resets. Long sessions won't lose context.
COMMAND: npm test
STATUS: exit 1 — failed
SUMMARY: 47 tests passed, 3 failed in auth.test.ts
ERRORS: Error: Expected 200, received 401 (line 84)
Error: Token not found in response (line 112)
TAIL:
✓ login with valid credentials (23ms)
✓ logout clears session (11ms)
✗ refresh token after expiry
...
Resuming session.
Branch: feature/auth-refresh
Last working on: Fixing token refresh logic in auth.service.ts
Files edited: src/auth/auth.service.ts, src/auth/auth.test.ts
Tasks pending: [ ] Fix failing test on line 112
[ ] Run full test suite once fix is applied
Last prompt: "The refresh token test is still failing — look at the 401 handling"
Continuing from where we left off.
After activating Context Mode for the session, provide the user with the exact text to add to their CLAUDE.md to make it permanent across all sessions:
```
## Context Mode
Context Mode is always active in this project.
### Output Filtering
Before any command output enters context, filter it to:
- Last 10 lines of stdout
- Any lines containing: error, warn, fail, exception, traceback, fatal (case-insensitive)
- Exit code
- One-line summary of what the command did
Use this format for filtered output:
COMMAND: [command]
STATUS: [exit code — success/failed]
SUMMARY: [one sentence]
ERRORS: [error lines or "none"]
TAIL: [last 10 lines]
### Session Log
Maintain a running session log at ./session.log. Write to it after every file edit and every command run. Track: files edited, commands run, tasks in progress, last user prompt, last action taken. Format defined in Context Mode skill.
### Auto-Resume
At the start of every new session, check for ./session.log. If it exists, read it and announce the resume state. Continue from the last task in progress without asking for instructions.
```
Tell the user: "Add this to your CLAUDE.md and Context Mode will be active permanently for this project — even after you close and reopen the session."
session.log was initialised immediately on activation (not deferred)business
Analyze why deals are won and lost and turn it into an action plan. Use when asked to run a win/loss analysis, review closed-won and closed-lost deals, understand why the team is losing to a competitor, or summarize sales feedback into patterns. Produces a structured win/loss report with themes, win/loss rates by segment and competitor, representative quotes, and prioritized actions for product, marketing, and sales.
development
Route a fuzzy request to the right skill in this library. Use when the user is unsure which skill fits, asks 'which skill should I use for X', describes a task without naming a skill, or when a request could plausibly match several skills. Produces a best-fit recommendation with the inputs to gather, a runner-up with the tie-breaker, and a workflow recipe when the job spans multiple skills.
testing
Triage a vulnerability or scanner finding — assess real severity, exploitability, and how urgently to fix. Use when asked to triage a CVE, prioritize scanner/pentest findings, assess a vuln's risk, or decide what to patch first. Produces a triage verdict: CVSS-informed severity adjusted for your context, exploitability, real risk, a fix/mitigation, and an SLA — so you fix what matters, not just what's red.
development
Stand up a Voice of Customer (VoC) program that turns feedback into action. Use when asked to build a VoC program, design a customer feedback loop, consolidate feedback sources, or set up a closed-loop feedback process. Produces a VoC program design — objectives, feedback sources and channels, a taxonomy, collection and analysis cadence, closed-loop routing, ownership, and success metrics.