← Back to PRs

#18110: enhance: elevate special context files (soul.md, identity.md, user.md, memory.md) into dedicated prompt sections

by sar618 open 2026-02-16 14:13 View on GitHub →
agents size: S
Closes #17810 Elevates `soul.md`, `identity.md`, `user.md`, and `memory.md` out of the flat `# Project Context` list into dedicated sections (`## Doctrine`,` ## Identity`, `## User Context`, `## Memory`) with scoped preambles. Non-special files render in Project Context as before; elevated files are filtered out to save tokens. Running in production since 2026.2.3 across all releases up to and including 2026.2.15 with zero conflicts or regressions. See issue #17810 for full design rationale and patch documentation. **AI Disclosure:** This patch was developed with AI assistance (Claude) for code review, syntax fixes, type safety refinements, and documentation. <!-- greptile_comment --> <h3>Greptile Summary</h3> This PR elevates four special context files (`soul.md`, `identity.md`, `user.md`, `memory.md`) from the flat `# Project Context` list into dedicated sections with descriptive names (`## Doctrine`, `## Identity`, `## User Context`, `## Memory`) and scoped preambles for soul.md and identity.md. Non-special files continue to render in `# Project Context` as before. The implementation correctly: - Uses case-insensitive, normalized path matching to identify special files - Handles duplicate special files by keeping only the first occurrence - Filters all special files (including duplicates) out of the `# Project Context` section using `Map.has()` - Renders special sections in deterministic order - Includes comprehensive test coverage validating the new behavior including duplicate suppression The change has been running in production since 2026.2.3 with no reported issues. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with no significant risk - The implementation is clean, well-tested, and has been validated in production for 12+ days across multiple releases. The logic correctly handles edge cases (duplicates, case sensitivity, path normalization), and the test suite validates all key behaviors including duplicate suppression. The previous thread's concern has already been resolved by the current implementation. - No files require special attention <sub>Last reviewed commit: ab61cb3</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs