cozempic  by Ruya-AI

AI context management for Claude Code

Created 2 months ago
270 stars

Top 95.1% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Cozempic addresses the significant issue of context bloat in Claude Code sessions, which inflates API costs and degrades performance. It offers a robust solution for users, particularly those employing Agent Teams, by intelligently pruning unnecessary data while preserving critical conversational context. The primary benefit is reduced operational expenses and enhanced efficiency for complex AI workflows.

How It Works

The project employs a sophisticated system of 17 composable pruning strategies, categorized into 'gentle', 'standard', and 'aggressive' tiers. A continuously running 'guard daemon', automatically initiated via session hooks, monitors and cleans sessions in real-time. Key innovations include 'compact-summary-collapse' for substantial savings, a 'behavioral digest' that persists user corrections into Claude Code's memory, and multi-layered 'Agent Teams protection' to maintain state integrity during compaction events.

Quick Start & Requirements

Installation is straightforward via pip install cozempic, pipx install cozempic, uvx cozempic, or package managers like Homebrew (brew install Ruya-AI/cozempic/cozempic) and Nix. It requires Python 3.10+ and has zero external dependencies, relying solely on the standard library. After installation, a one-time cozempic init command wires the necessary hooks and slash commands into the project.

Highlighted Details

  • Features 18 distinct pruning strategies across three tiers (gentle, standard, aggressive).
  • Achieves significant token savings, with 'compact-summary-collapse' offering 85-95% reduction.
  • Provides robust protection for Agent Teams, ensuring coordination state survives context compaction.
  • The 'behavioral digest' mechanism allows user corrections to be learned and retained across sessions.
  • Automatically detects and configures for both 200K and 1M Claude context windows.
  • A 4-tier proactive pruning system (Soft, Hard, Emergency, User) manages session size dynamically.

Maintenance & Community

The project is developed by Ruya AI. The README does not detail specific community channels (like Discord/Slack), notable contributors, sponsorships, or a public roadmap.

Licensing & Compatibility

Cozempic is released under the MIT License. This permissive license generally allows for commercial use and integration into closed-source projects without significant restrictions.

Limitations & Caveats

The README does not explicitly state alpha status or list known bugs. The 'aggressive' pruning tier carries a 'Moderate' risk. While designed for seamless integration, certain session recovery actions (like 'reload') may open new terminal windows for non-tmux/screen environments. Automatic updates are recommended for compatibility with evolving Claude Code formats.

Health Check
Last Commit

3 days ago

Responsiveness

Inactive

Pull Requests (30d)
8
Issues (30d)
40
Star History
96 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.