
long-agent
Manage long-running agent sessions. Use for tracking progress in extended tasks, maintaining context across long sessions, and managing multi-step workflows.
- Installs
- 44
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/johnlindquist/claude --skill long-agent- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads long-agent automatically when relevant.
- 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.
Long Agent Sessions
Manage extended agent sessions with progress tracking and context management.
Session Management
Initialize Session
# 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
# Update progress
echo "- [x] Completed: [description]" >> $SESSION_FILE
# Add note
echo "### $(date +%H:%M) - [title]" >> $SESSION_FILE
echo "[notes]" >> $SESSION_FILE
Resume Session
# 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
#!/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
# 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
#!/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
# 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
#!/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
# 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
# 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:
# 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
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
- Log frequently - Update progress often
- Save context - What would you need to resume?
- Create checkpoints - Mark safe resume points
- Summarize before breaks - Capture state of mind
- Use templates - Consistent structure helps
- Track blockers - Note what's waiting
- Handoff cleanly - Assume fresh context next time
FAQ
What does the long-agent skill do?
Manage long-running agent sessions. Use for tracking progress in extended tasks, maintaining context across long sessions, and managing multi-step workflows.
How do I install long-agent?
Run npx skills add https://github.com/johnlindquist/claude --skill long-agent 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/long-agent/ (personal) or .claude/skills/long-agent/ (project).
Which AI agents can use long-agent?
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 long-agent 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 long-agent?
It is published by johnlindquist in johnlindquist/claude. It has 44 recorded installs.
More from johnlindquist/claude
gemini-image
johnlindquist/claude
Analyze images using Gemini's vision capabilities. Use for image analysis, text extraction from screenshots, and visual content understanding.
memory
johnlindquist/claude
Persistent knowledge storage using basic-memory CLI. Use to save notes, search memories semantically, and build context for topics across sessions.
brainstorm
johnlindquist/claude
Generate ideas and explore possibilities with AI. Use for creative problem solving, generating alternatives, and expanding on concepts.
deepwiki
johnlindquist/claude
Query DeepWiki for repository documentation and structure. Use to understand open source projects, find API docs, and explore codebases.
Popular other skills
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.
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.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.