feat(si): Implement Multi-File Context System for AI Coding Tools #8151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The System Initiative assistant context was defined in a single monolithic SI_Agent_Context.md.tmpl file (~27KB) that was used identically across all AI coding tools (Claude Code, Codex, Cursor, OpenCode.ai). This approach:
We now implemented a modular template system that splits provider documentation into separate files and uses each tool's optimal loading strategy for efficient, on-demand context access.
Modular Template Structure
Created provider-specific templates in data/templates/providers/:
Tool-Specific Implementations
Claude Code - Skills with Progressive Disclosure:
Codex - On-Demand Read Tool:
Cursor - On-Demand Read Tool:
OpenCode - On-Demand Read Tool:
Benefits
✅ Efficient context usage - Tools load only what they need, when they need it
✅ Modular maintenance - Update one provider file, all tools benefit
✅ File sharing - Codex, Cursor, and OpenCode share AGENTS.md and docs/providers/
✅ No duplication - Single source templates, tool-specific generation strategies
✅ Native capabilities - Each tool uses its optimal loading mechanism
✅ Scalable - Add new providers by creating one template file
✅ Multi-provider support - All tools can access multiple providers in one session
For non-Claude (where Claude has skills), we generate a file as follows:
Which means we get the following behaviour:
It has read the correct file on demand. This means that it still understands that it needs to get the correct context about a provider when the user needs it.
This reduces the initial tokens that a user spends starting our agent