AI agents that stay in flow
indefinitely
Keep agents in the 50-150k token sweet spot forever. Intelligent handoffs before degradation. Knowledge that improves with each session, not just accumulates.
npx agent-focus initAI agents have a focus limit
Every AI agent has an optimal performance window - typically 50-150k tokens. Within this range, they're focused, coherent, and productive.
Beyond it, quality degrades rapidly. Hallucinations increase. Early context gets forgotten. The agent loses the plot.
Complex projects require weeks or months of sustained work. Current solutions (waiting for bigger context windows) don't solve the core problem.
Relay Race, Not Marathon
Each agent performs at peak during their leg. Handoff happens before fatigue sets in.
Focus persistence through intelligent relay
Like a relay race team vs. a marathon runner: each agent performs at peak performance during their leg, handoff happens before degradation, and knowledge is compressed and refined, not just passed.
Agent Focus maintains sustained attention across arbitrary timelines. Weeks, months, or longer - whatever your project requires.
Wisdom compounds, not accumulates
Traditional systems accumulate knowledge until context explodes. Agent Focus compresses and refines. Each session makes knowledge better, not just bigger.
Context grows until overflow
Knowledge improves, size stays constant
Session 10 doesn't need to read 1.5M tokens. It gets distilled wisdom from all previous sessions in ~40k tokens.
Three-layer architecture
Scopes for focused work, messaging for coordination, specs as source of truth.
Scopes
Focused work contexts with automatic session management. Workers execute in optimal windows, hand off before degradation.
- Session handoffs at ~150k tokens
- Knowledge refinement each handoff
- Progressive context loading
Messaging
Inter-agent communication across sessions and scopes. Past agents are queryable: wake them to ask questions.
- Thread-based messaging
- Wake dormant agents
- Cross-scope coordination
Specifications
Living documentation with stable catalog references. Implementation plans stay synchronized with reality.
- Catalog-numbered specs
- Task dependencies
- Generated progress views
The Context Lifecycle
Mind the context window: proactive handoffs before degradation
Beyond simple handoffs
Agent Focus isn't just session management. It's a complete focus persistence system.
Queryable Past Agents
Previous sessions aren't gone, they're dormant. Wake them to ask about decisions they made.
for horizontal scaling. See catalog ref 2.1.3.
Multi-level Hierarchy
Project → Scopes → Sessions. Orchestrator maintains big picture while workers stay focused.
Built for complex, long-running work
Any project that exceeds single-session capabilities benefits from focus persistence.
Software Development
- Multi-week features
- Legacy refactoring
- Cross-repo coordination
Research
- Literature reviews
- Deep investigations
- Competitive analysis
Strategy & Planning
- System design
- Architecture decisions
- Technical roadmaps
Knowledge Work
- Documentation
- Evolving requirements
- Team onboarding
File-based, git-versioned
No databases. No infrastructure. Everything is Markdown, YAML, and JSON: human-readable, grep-able, diff-able.
Simple CLI commands
Start scopes, check progress, hand off sessions. All from your terminal.
/af-begin auth-coreStart worker session in scope/af-handoffFinalize session, refine knowledgeaf statusCheck project progressaf spec 2.1.1Query specification by catalog refaf wake session-04Query a past agentReady to keep your agents focused?
Agent Focus is open source and designed to work with Claude Code out of the box.
claude skills add agent-focusaf init my-project/af-begin my-first-scope