Skip to content

feat: Tiered bootstrap file loading for progressive context control #22438

@882soft

Description

@882soft

Motivation

Bootstrap files consume LLM tokens on every session. For users with large workspaces, loading all files into every session — including sub-agents and cron jobs — wastes context window budget on files the agent never references. This proposal introduces tiered loading so users can control how much context each session type receives, reducing unnecessary token usage while preserving persona consistency where needed.

Problem

Currently, bootstrap file loading has a binary split:

  • Main sessions load ALL workspace files (SOUL.md, IDENTITY.md, USER.md, AGENTS.md, TOOLS.md, HEARTBEAT.md, BOOTSTRAP.md, MEMORY.md)
  • Subagent/cron sessions load only AGENTS.md + TOOLS.md

This creates a gap: there's no way to configure intermediate loading levels. Users who want subagents to inherit persona context (SOUL.md, IDENTITY.md) must choose between "everything" or "almost nothing."

Real-world use cases

  1. Token savings on sub-agents — A spawned sub-agent doing a quick task doesn't need MEMORY.md or USER.md, but may need SOUL.md for consistent tone
  2. Context-budget optimization — Loading all files wastes tokens on large workspaces; users want fine-grained control
  3. Cron jobs with personality — Scheduled tasks that send messages should sound like the configured persona, not a generic bot — but don't need the full context

Proposal

Add a bootstrapTier configuration option with three tiers:

Tier Files Loaded Default For
minimal AGENTS.md, TOOLS.md Subagent, Cron sessions
standard All recognized bootstrap files Main sessions
full Standard + extra bootstrap patterns Explicit opt-in

Key design decisions

  • Backward compatible — No tier set = existing behavior unchanged
  • Config-driven overrideagents.defaults.bootstrapTier lets users promote subagents to standard or constrain main sessions to minimal
  • Session-type heuristic preserved — Without explicit config, subagent→minimal, main→standard
  • full tier integrates with existing extraBootstrapFiles hook for additional patterns

Configuration example

agents:
  defaults:
    bootstrapTier: "standard"  # minimal | standard | full

I have an implementation ready with 11 unit tests. Happy to open a PR if there's interest.

Still active. Waiting for CI to pass on the latest push (38d9e0a). Will update once confirmed green.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions