long-agent
Manage long-running agent sessions. Use for tracking progress in extended tasks, maintaining context across long sessions, and managing multi-step workflows.
What this skill does
# Long Agent Sessions Manage extended agent sessions with progress tracking and context management. ## Session Management ### Initialize Session ```bash # Create session file SESSION_ID=$(date +%Y%m%d-%H%M%S) SESSION_FILE=~/.claude/sessions/$SESSION_ID.md mkdir -p ~/.claude/sessions cat > $SESSION_FILE << EOF # Session: $SESSION_ID Started: $(date) Task: [Describe task] ## Progress - [ ] Step 1 - [ ] Step 2 - [ ] Step 3 ## Context [Important context to remember] ## Notes [Running notes] EOF echo "Session: $SESSION_FILE" ``` ### Track Progress ```bash # Update progress echo "- [x] Completed: [description]" >> $SESSION_FILE # Add note echo "### $(date +%H:%M) - [title]" >> $SESSION_FILE echo "[notes]" >> $SESSION_FILE ``` ### Resume Session ```bash # List recent sessions ls -lt ~/.claude/sessions/ | head -10 # View session cat ~/.claude/sessions/SESSION_ID.md # Continue from last checkpoint tail -50 ~/.claude/sessions/SESSION_ID.md ``` ## Progress Patterns ### Checkpoint System ```bash #!/bin/bash # checkpoint.sh SESSION_ID DESCRIPTION SESSION_FILE=~/.claude/sessions/$1.md CHECKPOINT=$2 echo "" >> $SESSION_FILE echo "## Checkpoint: $(date +%H:%M)" >> $SESSION_FILE echo "Status: $CHECKPOINT" >> $SESSION_FILE echo "Can resume from here." >> $SESSION_FILE ``` ### Milestone Tracking ```markdown # Session Progress ## Milestones - [x] M1: Environment setup - [x] M2: Core implementation - [ ] M3: Testing - [ ] M4: Documentation ## Current: M3 - Testing ### Completed - Unit tests for auth module - Integration test setup ### In Progress - API endpoint tests ### Blocked - Need test fixtures for edge cases ``` ## Context Management ### Save Important Context ```bash #!/bin/bash # save-context.sh SESSION_ID SESSION_FILE=~/.claude/sessions/$1.md cat >> $SESSION_FILE << 'CONTEXT' ## Critical Context (Don't Lose) ### File Locations - Main entry: src/index.ts - Config: src/config.ts - Tests: tests/ ### Key Decisions - Using JWT for auth (not sessions) - PostgreSQL for persistence - Redis for caching ### Current State - Auth module: complete - API routes: 80% done - Tests: 40% coverage CONTEXT ``` ### Context Recovery ```bash # Get context for resumption CONTEXT=$(grep -A 50 "## Critical Context" ~/.claude/sessions/$SESSION_ID.md) gemini -m pro -o text -e "" "I'm resuming a long coding session. Here's the context: $CONTEXT Help me remember: 1. Where was I? 2. What's the next step? 3. Any gotchas to remember?" ``` ## Bearings Check ### Get Your Bearings ```bash #!/bin/bash # bearings.sh - Where am I in this task? echo "=== Current Session Status ===" echo "" # Git status echo "### Git Status" git status --short echo "" echo "### Recent Commits" git log --oneline -5 echo "" echo "### Modified Files" git diff --stat HEAD~3 echo "" echo "### TODO Items" grep -r "TODO\|FIXME" src/ --include="*.ts" | head -10 ``` ### Progress Summary ```bash # Generate progress summary gemini -m pro -o text -e "" "Summarize progress on this session: Session log: $(tail -100 ~/.claude/sessions/$SESSION_ID.md) Git activity: $(git log --oneline -10) Provide: 1. What's been accomplished 2. Current status 3. Remaining work 4. Estimated completion" ``` ## Long Task Patterns ### Multi-Day Task ```markdown # Multi-Day Task: [Name] ## Day 1 - [Date] ### Accomplished - [items] ### Blocked - [items] ### Tomorrow - [items] --- ## Day 2 - [Date] ### Context from Yesterday [summary] ### Accomplished - [items] ``` ### Handoff Document When handing off to another session or agent: ```markdown # Task Handoff ## What This Is [Brief description] ## Current State - [Bullet points of where things stand] ## What's Working - [Completed items] ## What's Not Working - [Issues/blockers] ## Next Steps 1. [Specific step] 2. [Specific step] ## Key Files - `src/main.ts` - Entry point - `src/auth/` - Auth module (done) - `src/api/` - API routes (in progress) ## Commands to Know ```bash npm run dev # Start development npm test # Run tests npm run build # Build for production ``` ## Gotchas - [Things that might trip you up] ``` ## Session Templates ### Feature Development ```bash cat > ~/.claude/sessions/feature-template.md << 'EOF' # Feature: [Name] ## Requirements - [ ] Requirement 1 - [ ] Requirement 2 ## Design [Architecture notes] ## Implementation Progress - [ ] Step 1 - [ ] Step 2 - [ ] Step 3 ## Testing - [ ] Unit tests - [ ] Integration tests - [ ] Manual testing ## Documentation - [ ] Code comments - [ ] README update - [ ] API docs EOF ``` ### Bug Fix ```bash cat > ~/.claude/sessions/bugfix-template.md << 'EOF' # Bug Fix: [Issue ID/Description] ## Symptom [What's happening] ## Expected [What should happen] ## Investigation - [ ] Reproduced locally - [ ] Found root cause - [ ] Identified fix ## Fix [Description of fix] ## Verification - [ ] Fix works - [ ] No regressions - [ ] Tests added EOF ``` ## Best Practices 1. **Log frequently** - Update progress often 2. **Save context** - What would you need to resume? 3. **Create checkpoints** - Mark safe resume points 4. **Summarize before breaks** - Capture state of mind 5. **Use templates** - Consistent structure helps 6. **Track blockers** - Note what's waiting 7. **Handoff cleanly** - Assume fresh context next time
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.