Skip to main content

format_global_bundle_block

Function format_global_bundle_block 

Source
pub fn format_global_bundle_block(bundles: &[Bundle]) -> String
Expand description

Format global bundles into the block injected into an agent’s CLAUDE.md. is_system sections (see Bundle::is_system) are split out and rendered FIRST, wrapped in explicit override wording, so they outrank every ordinary # [Workspace] <name> section that follows — see docs/specs/SPEC_GLOBAL_MEMORY_SYSTEM_TIER_2026_08_24.md §3.4. Bundles arrive already ordered by bundle_list_global (is_system DESC, sort_order, name), so this only needs to partition, not re-sort. Sections are separated by a --- rule (GLOBAL_SECTION_SEPARATOR). Returns an empty string when no section has instructions.

Exactly global_bundle_sections joined by the separator: memory reinjection sends those same sections, so what it re-delivers is this block byte for byte (SPEC_GLOBAL_MEMORY_DELIVERY_2026_09_27.md §7 P1).