Skip to main content

remove_claude_md_guidance

Function remove_claude_md_guidance 

Source
pub fn remove_claude_md_guidance(
    project_dir: &Path,
) -> Result<Option<(PathBuf, bool)>>
Expand description

Remove sqz’s guidance block from CLAUDE.md if present.

Locates the block by its BEGIN/END sentinels and excises the entire range including one preceding blank line (if any) so the remaining file reads cleanly. If CLAUDE.md becomes empty (or contains only the sqz preamble) after removal, deletes the file.

Returns the path plus a flag indicating whether anything changed. Missing file or missing block → (path, false).