lean-ctx 3.5.7

Context Runtime for AI Agents with CCP. 57 MCP tools, 10 read modes, 95+ compression patterns, cross-session memory (CCP), persistent AI knowledge with temporal facts + contradiction detection, multi-agent context sharing + diaries, LITM-aware positioning, AAAK compact format, adaptive compression with Thompson Sampling bandits. Supports 24 AI tools. Reduces LLM token consumption by up to 99%.
Documentation
pub(super) fn extract_git_subcommand(command: &str) -> Option<&str> {
    let mut tokens = command.split_whitespace();
    while let Some(tok) = tokens.next() {
        let base = tok.rsplit('/').next().unwrap_or(tok);
        if base == "git" {
            let mut skip_next = false;
            for arg in tokens {
                if skip_next {
                    skip_next = false;
                    continue;
                }
                if arg == "-C" || arg == "-c" || arg == "--git-dir" || arg == "--work-tree" {
                    skip_next = true;
                    continue;
                }
                if arg.starts_with('-') {
                    continue;
                }
                return Some(arg);
            }
            return None;
        }
    }
    None
}