ctx  by ctxrs

Fast local search for coding agent context

Created 4 months ago
769 stars

Top 44.7% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

ctx is an open-source CLI tool designed to address the problem of coding agents losing context from previous sessions. It provides fast, local search capabilities across past agent interactions, indexing logs into an SQLite database. This allows current and future agents to quickly access discussions, decisions, failed attempts, commands, and test results from earlier work, preventing repetition and improving efficiency. The target audience includes engineers, researchers, and power users who leverage coding agents, offering the benefit of readily available, meaningful historical context.

How It Works

ctx indexes past agent sessions stored in local provider history files. It discovers supported sources, imports persisted records, and stores normalized session, event, and touched-file metadata in a local SQLite database optimized for retrieval. This approach enables fast, scriptable searches without requiring a background service. By structuring agent history into sessions, events, and indexed fields, ctx returns ranked, cited matches, allowing agents to access relevant history with significantly fewer tokens compared to raw transcript searches, making it 50x more token-efficient.

Quick Start & Requirements

  • Primary install / run command: curl -fsSL https://ctx.rs/install | sh
  • Non-default prerequisites and dependencies: Bash shell is required for installation. npx is recommended for installing the agent skill (npx skills add ctxrs/ctx).
  • Estimated setup time or resource footprint: Not explicitly stated, but the setup involves local indexing.
  • Links: Installation is facilitated via https://ctx.rs/install. Documentation and CLI reference are accessible through ctx docs commands.

Highlighted Details

  • Achieves up to 50x greater token efficiency than raw transcript search by structuring and indexing agent history.
  • Operates with a local and private index by default, requiring no cloud service, API keys, or writes into source repositories.
  • Supports indexing history from a wide range of agent harnesses, including Claude Code, Codex, Cursor, Pi, OpenCode, Antigravity/Gemini CLI, Factory AI Droid, and Copilot CLI.
  • Offers SDKs for integration into custom applications across TypeScript, Python, Rust, Go, JVM, Swift, and .NET.
  • Provides cited retrieval, returning ranked matches that include relevant snippets and context IDs for deeper inspection.

Maintenance & Community

No explicit mentions of notable contributors, sponsorships, partnerships, or community channels (e.g., Discord, Slack) are present in the provided README.

Licensing & Compatibility

  • License type: The README does not explicitly state the project's license.
  • Compatibility notes: The local and private nature of the index is beneficial for sensitive environments. Users are advised to review indexed transcript text before sharing, as it preserves local paths and potentially sensitive strings. Source builds and package-manager installs do not self-upgrade, unlike official installer-managed binaries.

Limitations & Caveats

The README does not explicitly list limitations. However, the absence of explicit license information is a significant caveat for due diligence and adoption decisions. Users are responsible for reviewing indexed content for sensitive data, as transcripts are preserved verbatim. Official installer-managed binaries support self-upgrades, but source builds and package-manager installs do not.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
100
Issues (30d)
11
Star History
696 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.