Skip to main content

seed_claude_md_placeholder_if_missing

Function seed_claude_md_placeholder_if_missing 

Source
pub fn seed_claude_md_placeholder_if_missing(
    provider: &ProviderConfig,
    config_dir: &str,
) -> Result<bool>
Expand description

Seeds an empty placeholder CLAUDE.md into an isolated Claude Code CLAUDE_CONFIG_DIR the first time it’s used, so Claude Code CLI’s own user-level CLAUDE.md discovery always finds something there instead of silently falling through to the operator’s real $HOME/.claude/CLAUDE.md. CLAUDE_CONFIG_DIR relocates credential/ session/project storage but AgentMux never wrote a CLAUDE.md into the relocated dir — verified live on a real machine: 18+ isolated claude config dirs, none with a CLAUDE.md, and a session whose CLAUDE_CONFIG_DIR was a genuinely separate (non-ambient) dir still received the real host file’s contents. See docs/specs/SPEC_ISOLATE_HOST_CLAUDE_MD_2026_08_31.md.

Scoped to the claude provider only (auth_dir_name == "claude") — this is a Claude Code CLI-specific fallback behavior; whether any other provider’s CLI has an equivalent gap is unverified. Never overwrites an existing CLAUDE.md — Global Bundle (or anything else) may have legitimately placed real content at that path. Returns Ok(true) only when it actually wrote the placeholder.