Claude’s chat system lacked automatic loading of custom context files stored in the .claude/commands/ directory. Users had to manually invoke the /CONTEXT command in each new session to load persistent context, leading to inconsistent context availability and repetitive manual intervention.
Issue
Custom context files, such as CONTEXT.md, were not automatically loaded at the start of new chat sessions. Users were required to manually execute the /CONTEXT command to parse and inject the context into the session, resulting in a lack of seamless continuity across conversations.
Culprit
Claude’s chat system did not include a built-in mechanism to detect or load custom context files during session initialization. This required explicit user action to activate the context, creating dependency on manual intervention for each new session.
Solution
Manual Context Injection Workflow
Users manually triggered context loading by invoking the /CONTEXT command in-chat, which parsed and injected the content from the designated context file. The file structure relied on a directory-based approach:
- File Structure: A
.claude/commands/directory containing theCONTEXT.mdfile. - Content Format: The
CONTEXT.mdfile used Markdown headers and bullet points for easy parsing by Claude.
Automation Proposal
To eliminate manual intervention, a Python wrapper script was proposed to pre-process new sessions:
- Automatic Injection: The script automatically prepended the context content to new sessions.
- Low Overhead: File reads were minimal (<1KB context size) and completed in milliseconds.
The proposed solution reduced manual context loading from 100% of sessions to 0% when using the wrapper script, ensuring consistent context availability without user interaction.