Global prompt for Claude Code (CLI)
For Claude Code CLI there are two mechanisms for cross-project preferences:
1. ~/.claude/CLAUDE.md – For instructions and context (equivalent to the claude.ai preferences in https://claude.ai/settings/general)
# My Coding Standards
- Test Driven Development: Specs first
- Focus on relevant specs (request, feature, complex methods)
- No trivial boilerplate specs
- Indentation: 2 spaces
- Lean, human-readable code
- When unclear: ask one clarifying question
...2. ~/.claude/settings.json – For technical settings (permissions, tools, hooks)
{
"permissions": {
"allowedTools": ["Read", "Write", "Bash(bundle exec rspec *)"]
}
}The CLAUDE.md is loaded at every session start and is the right place for your coding preferences.
The settings.json is more for tool permissions and hooks.
NOTE: The settings in https://claude.ai/settings/general are only for the web chat and do not take effect in Claude Code nor in API calls.
Tweet