plugins/gir-tools/skills/agenthub-session-management/SKILL.md
Patterns for managing multiple Claude Code sessions using AgentHub
npx skillsauth add rivit-studio/gir agenthub-session-managementInstall 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.
Skills for coordinating, monitoring, and optimizing multi-session Claude Code workflows.
NEW → THINKING → EXECUTING_TOOL → WAITING_FOR_USER → IDLE
↓ ↓ ↓
AWAITING_APPROVAL ↓ ↓
↓ ↓ ↓
└──────────────┴────────────────┘
↓
COMPLETED
| State | Description | User Action | |-------|-------------|-------------| | Thinking | Processing request | Wait | | Executing Tool | Running tool operation | Wait | | Awaiting Approval | Needs confirmation | Approve/Reject | | Waiting for User | Needs input | Provide input | | Idle | Ready for new task | Send request |
~/.claude/projects/{encoded-path}/{sessionId}.jsonl
Project path is URL-encoded:
/Users/dev/myproject → %2FUsers%2Fdev%2FmyprojectEach line in the session file is a JSON object:
{
"type": "message|tool_use|tool_result",
"timestamp": "ISO-8601",
"content": {...}
}
Best for large features with independent components.
┌─────────────────────────────────────────────────┐
│ Main Feature │
├─────────────┬─────────────┬─────────────────────┤
│ Session 1 │ Session 2 │ Session 3 │
│ Backend │ Frontend │ Tests │
│ (worktree) │ (worktree) │ (worktree) │
├─────────────┴─────────────┴─────────────────────┤
│ Integration Branch │
└─────────────────────────────────────────────────┘
Setup:
# Create feature branches
git checkout -b feature/main
git push -u origin feature/main
# Create component branches
git checkout -b feature/backend feature/main
git checkout -b feature/frontend feature/main
git checkout -b feature/tests feature/main
# Create worktrees
git worktree add ../proj-backend feature/backend
git worktree add ../proj-frontend feature/frontend
git worktree add ../proj-tests feature/tests
Multiple sessions tackling different bugs simultaneously.
┌───────────┬───────────┬───────────┐
│ Bug #1 │ Bug #2 │ Bug #3 │
│ Session A │ Session B │ Session C │
│ bugfix/1 │ bugfix/2 │ bugfix/3 │
└─────┬─────┴─────┬─────┴─────┬─────┘
│ │ │
└───────────┼───────────┘
↓
main branch
Best for: Sprint bug bashes, hotfix situations
Multiple sessions exploring different solutions.
Problem
│
┌─────────────┼─────────────┐
↓ ↓ ↓
Approach A Approach B Approach C
Session 1 Session 2 Session 3
│ │ │
└─────────────┼─────────────┘
↓
Best Solution Selected
↓
Main Session
Best for: Architecture decisions, algorithm selection
Sequential handoffs between specialized sessions.
Session 1 Session 2 Session 3
[Architect] ──→ [Implement] ──→ [Review]
│ │ │
↓ ↓ ↓
Plan.md Code + Tests Feedback
Handoff Document:
## Handoff: [From] → [To]
**Date**: YYYY-MM-DD
**Task**: [description]
### Completed
- [x] Item 1
- [x] Item 2
### In Progress
- [ ] Item 3 (started, needs completion)
### Pending
- [ ] Item 4
### Key Files
- `path/to/file.ts` - [description]
### Notes
- [important context]
- [decisions made]
### Blockers
- [any blockers for next session]
# Always branch from a clean state
git fetch origin
git checkout main
git pull
# Create feature branch first
git checkout -b feature/name
# Then create worktree
git worktree add ../project-feature feature/name
# List all worktrees
git worktree list
# Prune stale worktrees
git worktree prune
# Remove specific worktree
git worktree remove ../project-feature
# Force remove (with uncommitted changes)
git worktree remove --force ../project-feature
Maintain a mapping document:
## Active Worktrees
| Worktree Path | Branch | Session ID | Owner | Status |
|---------------|--------|------------|-------|--------|
| ../proj-auth | feature/auth | abc123 | @dev1 | Active |
| ../proj-api | feature/api | def456 | @dev2 | Idle |
# Find sessions active in last hour
find ~/.claude/projects -name "*.jsonl" -mmin -60
# Count active sessions per project
for dir in ~/.claude/projects/*/; do
count=$(ls "$dir"*.jsonl 2>/dev/null | wc -l)
echo "$(basename "$dir"): $count sessions"
done
# Find error patterns
grep -r "error" ~/.claude/projects/ --include="*.jsonl" | head -20
# Find tool usage
grep -r "tool_use" ~/.claude/projects/ --include="*.jsonl" | \
jq -r '.content.name' 2>/dev/null | sort | uniq -c | sort -rn
testing
GIR orchestration core — routing rules, delegation tiers, cost discipline, Graphify integration, escalation trigger, and lazy-load instructions. Always loaded.
tools
Native parallel agent execution using Claude Code's built-in Agent tool with worktree isolation. On-demand skill — load when parallel work is needed.
testing
Autonomous execution mode for GIR — unattended operation, cap fail-safe, checkpoint/resume protocol. On-demand skill loaded by /gir:run.
tools
MCP tool reference for web development — v0, Figma, Vercel. Apply when doing UI generation or deployment for frontend work.