fix: Add Identity section to CLAUDE.md template#952
Open
MarvinDontPanic wants to merge 1 commit intodanielmiessler:mainfrom
Open
fix: Add Identity section to CLAUDE.md template#952MarvinDontPanic wants to merge 1 commit intodanielmiessler:mainfrom
MarvinDontPanic wants to merge 1 commit intodanielmiessler:mainfrom
Conversation
CLAUDE.md.template uses {DAIDENTITY.NAME} for the assistant's name in
output format lines, but never includes {PRINCIPAL.NAME} (the user's
name). This means the generated CLAUDE.md tells the LLM the assistant's
name but not the user's name.
In setups where the assistant's name appears in system paths, project
names, or OS usernames, the LLM can mistake the assistant's name for
the user's identity — leading to the AI addressing the user by the
wrong name.
Add an Identity section between Subagent Defaults and Critical Rules
that explicitly states both names. BuildCLAUDE.ts already resolves
{PRINCIPAL.NAME} from settings.json, so this just needs the template
reference.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
8646e8a to
e793e9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
CLAUDE.md.templateuses{DAIDENTITY.NAME}for the assistant's name in output format lines, but never includes{PRINCIPAL.NAME}(the user's name). The generatedCLAUDE.mdtells the LLM the assistant's name but not the user's name.In setups where the assistant's name appears in system paths, project names, or OS usernames, the LLM mistakes the assistant's name for the user's identity — addressing the user by the wrong name.
Data from affected setup (2 weeks of Slack gateway logs):
Fix
Add an Identity section to
CLAUDE.md.templatebetween the format definitions and Critical Rules:BuildCLAUDE.tsalready resolves{PRINCIPAL.NAME}fromsettings.json, so this just needs the template reference. Updated the pre-builtCLAUDE.mdwith default values ("User"/"Assistant") to match.Files Changed
Releases/v4.0.3/.claude/CLAUDE.md.template— Added Identity section with template variablesReleases/v4.0.3/.claude/CLAUDE.md— Updated pre-built version with default values🤖 Generated with Claude Code