# long-running-agent > Framework for building AI agents that work effectively across multiple context windows on complex, long-running tasks. Use when building agents for multi-hour/multi-day projects, implementing persistent coding workflows, creating systems that need state management across sessions, or when an agent needs to make incremental progress on large codebases. Provides initializer and coding agent patterns, progress tracking, feature management, and session handoff strategies. - Author: nettee - Repository: refly-ai/skill-to-workflow - Version: 20260105163719 - Stars: 1 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/refly-ai/skill-to-workflow - Web: https://mule.run/skillshub/@@refly-ai/skill-to-workflow~long-running-agent:20260105163719 --- --- name: long-running-agent description: Framework for building AI agents that work effectively across multiple context windows on complex, long-running tasks. Use when building agents for multi-hour/multi-day projects, implementing persistent coding workflows, creating systems that need state management across sessions, or when an agent needs to make incremental progress on large codebases. Provides initializer and coding agent patterns, progress tracking, feature management, and session handoff strategies. --- # Long-Running Agent Framework Framework for enabling AI agents to work effectively across many context windows on complex tasks. ## Core Problem Long-running agents must work in discrete sessions where each new session begins with no memory of previous work. Without proper scaffolding, agents tend to: 1. **One-shot attempts** - Try to complete everything at once, running out of context mid-implementation 2. **Premature completion** - See partial progress and declare the job done 3. **Undocumented states** - Leave code in broken or undocumented states between sessions ## Two-Agent Solution ### 1. Initializer Agent (First Session Only) Sets up the environment with all context future agents need: - Create `init.sh` script for environment setup - Generate comprehensive `feature_list.json` with all requirements - Initialize `claude-progress.txt` for session logging - Make initial git commit See [references/initializer-prompt.md](references/initializer-prompt.md) for the full prompt template. ### 2. Coding Agent (Every Subsequent Session) Makes incremental progress while maintaining clean state: - Read progress files and git logs to get bearings - Run basic tests to verify working state - Work on ONE feature at a time - Test end-to-end before marking complete - Commit progress with descriptive messages - Update progress file See [references/coding-prompt.md](references/coding-prompt.md) for the full prompt template. ## Session Startup Sequence Every coding agent session should begin: ``` 1. pwd # Understand working directory 2. cat claude-progress.txt # Read recent progress 3. cat feature_list.json # Check feature status 4. git log --oneline -20 # Review recent commits 5. ./init.sh # Start dev environment 6. # Verify app works 7.