Skip to content

feat: global config toggle & LaTeX rendering optimization#253

Open
Sophomoresty wants to merge 8 commits intoYishenTu:mainfrom
Sophomoresty:feature/global-cc-config
Open

feat: global config toggle & LaTeX rendering optimization#253
Sophomoresty wants to merge 8 commits intoYishenTu:mainfrom
Sophomoresty:feature/global-cc-config

Conversation

@Sophomoresty
Copy link

Summary

This PR adds two improvements:

  1. Global Claude Code Config Toggle: Users can now optionally use their global Claude Code config (~/.claude/) for skills and MCP servers instead of vault-specific config. This provides better integration with Claude Code CLI for users who want to share skills and MCP servers across all vaults.

  2. LaTeX Rendering Optimization: Improved streaming performance by rendering LaTeX/MathJax expressions only at the end of streaming instead of on each chunk. This eliminates visual flickering and improves performance during long responses with mathematical content.


New Feature: Use Global Claude Code Config

Location: Settings → Safety section
Default: false (vault-only, maintaining backward compatibility)

When enabled (true)

  • Skills load from ~/.claude/skills/
  • MCP servers load from ~/.claude/mcp.json
  • Shared with Claude Code CLI

When disabled (false)

  • Skills load from {vault}/.claude/skills/
  • MCP servers load from {vault}/.claude/mcp.json
  • Each vault has isolated configuration

Benefits

  • Better CLI integration: Users who manage skills via Claude Code CLI can now use the same skills in Claudian
  • Reduced duplication: No need to copy skills/MCP configs to each vault
  • Backward compatible: Existing vaults continue working as before (default is vault-only)
  • Flexible: Users can choose per-vault whether to use global or local config
  • Runtime toggle: Takes effect immediately without restart

LaTeX Rendering Optimization

Problem

Previously, every chunk of streamed text triggered a full re-render with MathJax processing the entire accumulated content. This caused:

  • Visual flickering as LaTeX expressions re-rendered repeatedly
  • Performance degradation during long responses
  • Janky scrolling experience

Solution

The streaming controller now:

  1. Shows plain text immediately during streaming (very fast, no rendering overhead)
  2. Renders full markdown with MathJax only at stream end

Benefits

  • Smooth visual experience during streaming
  • Eliminates repeated MathJax processing overhead
  • Better performance for long responses with mathematical content

Testing

  • Verified default is vault-only (backward compatible)
  • Tested toggle on/off - skills and MCP servers reload correctly
  • Tested LaTeX rendering during streaming - smooth, no flicker
  • Verified existing vaults work without any changes needed

Files Modified

  • src/core/types/settings.ts - Added useGlobalCcConfig setting
  • src/core/storage/StorageService.ts - Dynamic config switching with updateGlobalConfig()
  • src/core/storage/SkillStorage.ts - Support for global skills directory
  • src/core/storage/McpStorage.ts - Support for global MCP config
  • src/features/settings/ClaudianSettings.ts - Settings UI toggle
  • src/features/chat/controllers/StreamController.ts - LaTeX rendering optimization
  • src/i18n/locales/en.json, src/i18n/locales/zh-CN.json - Translations

Screenshots

Settings Toggle

(Would add screenshot here - shows the toggle in Settings > Safety section)

LaTeX Rendering

Before After
Text flickers during streaming Smooth text streaming, LaTeX renders at end

## Global Config Integration
- Skills: prioritize ~/.claude/skills/ over vault config
- MCP: prioritize ~/.claude/mcp.json over vault config
- Settings: already handled by SDK (loadUserClaudeSettings)
- Agents: already supported global ~/.claude/agents/
- Hooks: already handled by SDK via settings.json

This ensures Claudian uses the same configuration as Claude Code CLI.

## Streaming Performance Optimization
- During streaming: display plain text (no markdown/MathJax)
- At stream end: render full markdown with LaTeX
- Eliminates expensive re-renders during chunk accumulation
- Fixes issue with interrupted/invalidated streams

## Files Modified
- src/core/storage/McpStorage.ts: add global config support
- src/core/storage/SkillStorage.ts: prioritize global skills
- src/core/storage/StorageService.ts: pass preferGlobal option
- src/core/types/settings.ts: add 'vault' and 'global' sources
- src/features/chat/controllers/StreamController.ts: streaming optimization
- src/features/chat/rendering/MessageRenderer.ts: related changes
When enabled, Claudian uses the same working directory as Claude Code CLI
(user's home directory). This merges conversation history between both tools.

Settings:
- useCCWorkingDirectory (default: true)
- UI toggle in Advanced settings section
- Translations for all supported languages
- SessionStorage now loads sessions from ~/.claude/projects/{dir}/
- Directory determined by useCCWorkingDirectory setting
- Merges CC and Claudian conversation history
Use (app.vault.adapter as any).basePath instead of getPath()
- Skills: ~/.claude/skills/
- MCP: ~/.claude/mcp.json
- Working directory: vault path (not changed)
## New Feature: Global Claude Code Config Toggle

- Added useGlobalCcConfig setting (default: false for backward compatibility)
- When enabled: skills and MCP servers load from ~/.claude/
- When disabled: load from vault (isolated per vault)
- Settings UI toggle in Safety section
- Translations for English and Chinese

## Existing Features Included in PR

1. **LaTeX Rendering Optimization**:
   - Plain text during streaming, full markdown + MathJax at end
   - Eliminates visual flickering and performance issues

2. **Global Config Support** (from earlier commits):
   - SkillStorage supports ~/.claude/skills/
   - McpStorage supports ~/.claude/mcp.json
   - Dynamic reconfiguration via updateGlobalConfig()

## Files Modified

- src/core/types/settings.ts - Add useGlobalCcConfig setting
- src/core/storage/StorageService.ts - Dynamic config switching
- src/features/settings/ClaudianSettings.ts - Settings UI toggle
- src/i18n/locales/en.json - English translations
- src/i18n/locales/zh-CN.json - Chinese translations

## Backward Compatibility

Default is false (vault-only), maintaining existing behavior.
Users must opt-in to use global config.
@YishenTu
Copy link
Owner

YishenTu commented Feb 7, 2026

we already have global skills/plugins/agents in Claudian, and option to turn off global plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants