
session-optimizer
Session analysis plugin that runs four parallel subagents over a transcript to find optimizations.
- version
- 1.0.0
- GitHub stars
- 365
What it does
- Adds the
/optimize-sessioncommand and four agents:conversation-efficiency-analyzer,tool-and-skill-usage-analyzer,skill-compliance-analyzer, andcontext-and-skills-gap-analyzer - Covers wasted cycles, back-and-forth, unused tools, missed parallelism, and violations of loaded skills
- Produces a ranked report where each finding includes a category, transcript quotes as evidence, and a recommendation
- Ends in an interactive walkthrough that proposes CLAUDE.md rules, new skills, or config changes; defaults to the most recent session
Analyze session transcripts for optimization opportunities using 4 parallel subagents
Add marketplace
/plugin marketplace add NTCoding/claude-skillzRun it inside Claude Code once, then install the plugin below.
Install
/plugin install session-optimizer@claude-skillzRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceOptimize Session
Analyze a Claude Code session transcript to find concrete opportunities to work faster and better.
Arguments
ARGUMENTS: $ARGUMENTS
- Optional: session ID (UUID) or session slug. Defaults to most recent session in current project.
Procedure
Step 1: Locate the Session File
Determine the current project's conversation directory:
# Encode current working directory path: replace / with -
# e.g., /Users/nicktune/code/my-project → -Users-nicktune-code-my-project
ls -t ~/.claude/projects/<encoded-path>/*.jsonl | head -5
If argument provided:
- If UUID: find
<session-id>.jsonl - If slug: search JSONL files for matching
slugfield
If no argument: use the most recently modified JSONL file.
Report: "Analyzing session: [slug or ID] ([message count] messages, [duration])"
Step 2: Read the Session Transcript
Read the JSONL file. Extract:
- All user and assistant messages (skip file-history-snapshot, system errors)
- The system-reminder blocks (contain loaded skills and available tools)
- Basic stats: message count, first/last timestamp, tools used, model
Step 3: Prepare Transcript for Subagents
Create a condensed version of the transcript suitable for subagent context:
- Include all user messages in full
- Include assistant text responses in full
- Include tool_use calls (name + input summary) but truncate large tool results to first 500 chars
- Include system-reminder blocks in full (skills and tools lists)
- Skip file-history-snapshot entries
- Skip duplicate/redundant system messages
Write the condensed transcript to a temporary file:
# Write to /tmp/session-optimizer-transcript-<session-id>.md
Also write the extracted context (loaded skills list, available tools list, session stats) to:
# Write to /tmp/session-optimizer-context-<session-id>.md
Step 4: Launch Analysis Subagents
Launch ALL FOUR subagents IN PARALLEL using the Task tool:
- conversation-efficiency-analyzer — finds wasted cycles, unnecessary back-and-forth, misinterpretations
- tool-and-skill-usage-analyzer — finds unused tools, missed parallelism, underutilized capabilities
- skill-compliance-analyzer — finds violations of loaded skills
- context-and-skills-gap-analyzer — finds missing project context and skill-building opportunities
Each subagent receives the same prompt:
Analyze this Claude Code session transcript for optimization opportunities.
## Session Context
[Contents of /tmp/session-optimizer-context-<session-id>.md]
## Transcript
[Contents of /tmp/session-optimizer-transcript-<session-id>.md]
Step 5: Collect and Present Report
Once all subagents return, compile their findings into a single report:
# Session Optimization Report
**Session:** [slug or ID]
**Duration:** [time]
**Messages:** [count] ([user count] user, [assistant count] assistant)
**Model:** [model name]
**Tools used:** [list]
**Skills loaded:** [list]
---
## Findings
[All findings from all 4 subagents, numbered sequentially]
[Sorted by impact: high → medium → low]
[Deduplicate if multiple subagents found the same issue — keep the most detailed version]
---
**Total findings:** [count] ([high count] high, [medium count] medium, [low count] low impact)
Step 6: Interactive Discussion
After presenting the report, say:
"Pick a finding number to discuss in detail, or 'all' to walk through each one."
For each finding discussed:
- Show the full evidence
- Explain the optimization opportunity
- Propose the best action for this specific finding — whatever fits the context:
- Edit CLAUDE.md with a new rule
- Create a new skill file
- Update project config or documentation
- Create a GitHub issue (
gh issue create) - Add to a todo list or backlog
- Update an existing skill's trigger conditions or rules
- Add a hook
- Any other action that makes sense
- Offer the user a choice:
- Do it now — implement the change immediately
- Create a ticket — create a GitHub issue capturing the finding and proposed action
- Note it — just acknowledge, no action now
- Skip — move to next finding
Notes
- If the transcript is too large for subagent context windows, split it into overlapping chunks and give each subagent the full transcript in segments, instructing them to analyze all segments.
- Clean up temp files after analysis is complete.
Readme
Session Optimizer
Analyze Claude Code session transcripts for concrete optimization opportunities.
Usage
/optimize-session [session-id|slug]
Defaults to most recent session in current project.
What It Does
Spawns 4 parallel subagents, each analyzing the transcript from a different angle:
| Agent | Focus |
|---|---|
| conversation-efficiency-analyzer | Wasted cycles, back-and-forth, misinterpretations |
| tool-and-skill-usage-analyzer | Unused tools, missed parallelism, underutilized capabilities |
| skill-compliance-analyzer | Violations of loaded skills |
| context-and-skills-gap-analyzer | Missing project context, skill-building opportunities |
Produces a ranked report of findings with evidence and actionable recommendations, then enters interactive discussion mode.
Output
- Structured report with findings sorted by impact
- Each finding includes: category, evidence (transcript quotes), recommendation
- Interactive walkthrough proposing specific actions (CLAUDE.md rules, new skills, config changes)
Details
- Marketplace
- NTCoding/claude-skillz
- Source
- session-optimizer
- Category
- Productivity
- Keywords
- session, optimization, analysis, workflow
- Listed since
- Apr 7, 2026
More from NTCoding/claude-skillz
All 13Similar to session-optimizer
More Agent Workflow & Planning
pm-tokensPluginmohitagw15856/pm-claude-skills1.6K starsToken optimization for every stage of the agent journey: crush tool outputs before they enter context, navigate code by map instead of reading files, diet the o
session-wrapPluginteam-attention/plugins-for-claude-natives831 starsSession wrap-up workflow with multi-agent analysis for documentation, automation, learning, and follow-up
agent-performance-analyzerSkillruvnet/ruflo1.1K installsAnalyzes workflow bottlenecks and recommends optimizations across execution time, resources, and agent coordination.
workflow-optimizerSkillhoangsonww/claude-code-agent-monitor1.2K starsAnalyzes Claude Code workflow patterns via the Agent Monitor API to produce quantified optimization recommendations.
agent-straceMCP serversiddhant-k-code108 starsQuery recorded AI agent sessions for events, summaries, diffs, health, and skill adoption.
performancePluginaws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrock412 starsPerformance profiling, optimization, and monitoring with 5 specialized agents for comprehensive performance analysis