stevesolun/ctx: Context-Aware Recommendations for Claude Code
Context switching kills flow. Loading every skill, agent, and MCP server into your LLM session burns tokens and degrades output quality. With 68,494 skills, 467 agents, and 10,790 MCP servers floating around the ecosystem, no developer can manually curate the right bundle for every task. stevesolun/ctx solves this with a graph-backed recommendation layer that watches what you're building and serves only what you need, when you need it.
This open-source Python↗ Bright Coding Blog tool (552 GitHub stars, MIT licensed) integrates with Claude Code and local/API models alike. It maintains a 79,958-node knowledge graph with 1,778,069 edges encoding semantic relationships, usage patterns, and quality signals. The result: smaller context windows, lower API bills, and less local compute wasted on irrelevant prompts.
What is stevesolun/ctx?
stevesolun/ctx is a recommendation layer, not a catalog or marketplace. Built by Steve Solun and released under the MIT License, it sits between your development environment and the sprawling ecosystem of LLM-augmented tools. The project is actively maintained—last commit July 9, 2026—with 67 forks and a growing contributor base.
The tool addresses a specific technical problem: context budget management. Modern LLM sessions degrade when overloaded with irrelevant skills or stale prompts. ctx tracks what you're building, walks its pre-computed graph, and returns a capped, scored bundle of relevant resources. It supports three operational modes:
- Claude Code integration: Hooks into
PostToolUseandStopevents for automatic recommendations - Local/API model harnesses: Standalone recommendations with dry-run/update/uninstall controls
- Custom agent loops: JSON contract output for DSL runners and frameworks like LoopFlow
The knowledge graph ships as a compressed runtime artifact (wiki-graph-runtime.tar.gz) or a full local wiki for browsing. It encodes eight edge types: semantic similarity, tags, slug tokens, source overlap, direct links, quality scores, usage frequency, type affinity, and graph structure. This multi-signal approach distinguishes ctx from simple keyword matching or static registries.
Key Features
Graph-Backed Recommendations
The 79,958-node, 1,778,069-edge graph is the core differentiator. Nodes represent skills, agents, MCP servers, harnesses, and concepts. Edges capture real relationships mined from the ecosystem. When you run ctx-recommend, the engine traverses this structure to surface resources that similar tasks actually use—not just keyword matches.
Multi-Entity Support
ctx handles four entity types uniformly: skills (68,494 pages, 67,024 with installable SKILL.md bodies), agents (467), MCP servers (10,790), and harnesses (207). Each gets quality scoring, health monitoring, and update review with benefits/risks analysis.
Smart Update Handling
Entity updates print explicit benefits/risks and skip replacement unless you approve. This prevents "skill rot"—stale, unused capabilities cluttering your context window. The ctx-skill-health dashboard provides structural health and drift detection.
Micro-Skill Gate
28,612 long skill bodies get converted through a compression pipeline rather than shipping raw prompts. This keeps the runtime artifact small while preserving semantic coverage.
Privacy-Respecting Telemetry
ctx-telemetry-export --dry-run --json lets you inspect what's collected before sending anything. The tool operates locally by default; no external API required for core recommendations.
Two-Tier Quality Gates
The no_mistakes_run.sh system provides smoke tests (fast, cheap invariants) and full profiles (unit, package, graph, browser, similarity checks). Lane isolation via temporary worktrees prevents cross-test pollution.
Use Cases
1. Claude Code Session Optimization
You're debugging a FastAPI auth issue. Instead of manually searching for relevant skills, ctx-recommend "fix FastAPI auth" returns a scored bundle. You pin skill:fastapi-pro and mcp-server:codex-cli as active, and ctx excludes them from future suggestions—avoiding redundant recommendations.
2. Local Model with Custom Harness
Running a local LLM via API (e.g., OpenAI GPT-5.5) for a CAD agent project. ctx-harness-install --dry-run interviews you on model, goals, tools, and privacy constraints, then recommends a fitting harness or emits a no-fit PRD. No blind cloning or dependency pollution.
3. Custom Agent Loop Integration
Building a DSL runner or LoopFlow-compatible system. python -m ctx.adapters.loopflow emits a permission-gated JSON contract with skill, agent, MCP, and harness recommendations scoped to the current planning phase. Your loop consumes this contract before each plan iteration.
4. Organization-Specific Tooling
Point ctx at your internal tool registry instead of the shipped graph. The same recommendation engine scores your proprietary skills and agents against current development signals, keeping context loads minimal even with custom infrastructure.
5. Pre-Commit Quality Checks
ctx-toolbox run --event pre-commit runs a "council" on your current diff, applying relevant skills to catch issues before CI. This integrates with existing git hooks without requiring hosted LLM access.
Installation & Setup
Install from PyPI with Python 3.11+:
pip install claude-ctx
Optional extras for specific backends:
pip install "claude-ctx[embeddings]" # semantic similarity backend
pip install "claude-ctx[harness]" # local/API model harness runs
pip install "claude-ctx[dev]" # test toolchain
Initialize with the terminal wizard:
ctx-init # interactive: hooks, graph, model, harness goal
Fast paths for specific setups:
ctx-init --graph --hooks --model-mode skip # runtime graph + Claude Code hooks only
ctx-init --graph --graph-install-mode full # full local wiki for browsing
ctx-init --wizard # force wizard mode from scripts/tests
ctx-init --model-mode custom --model openai/gpt-5.5 --goal "build a CAD agent"
The --graph flag installs the compressed runtime artifact by default. This contains the skill index and harness pages needed for recommendations. For local browsing or Obsidian integration, use --graph-install-mode full to expand 68,494 skill pages and 67,024 SKILL.md files.
Windows note: PowerShell's tar.exe lacks --force-local. Use:
tar -xzf graph\wiki-graph.tar.gz -C "$env:USERPROFILE\.claude\skill-wiki"
Git Bash/MSYS users can use --force-local only with drive-letter paths like C:/Users/....
Real Code Examples
Example 1: Repository Scan with Recommendations
Scan your current project and get a scored bundle:
ctx-scan-repo --repo . # analyze stack signals
ctx-scan-repo --repo . --recommend # include skill/agent/MCP recommendations
The first command builds a profile of your codebase. The second feeds that profile into the recommendation engine, returning a capped list ranked by graph score and task relevance.
Example 2: Constrained Recommendation for Local Tasks
When working offline or with key restrictions:
ctx-recommend "LoCoBench python feature_implementation no API keys" \
--local-code-task \
--no-api-keys \
--language python \
--json
The --local-code-task flag restricts to skills viable without hosted inference. --no-api-keys filters out MCP servers requiring authentication. --json outputs machine-parseable results for pipeline integration.
Example 3: Harness Installation with Dry-Run Review
Inspect before installing any harness:
ctx-harness-install text-to-cad --dry-run # review plan: clone URLs, deps, risks
ctx-harness-install text-to-cad # execute after review
ctx-harness-install text-to-cad --update --dry-run # preview updates
ctx-harness-install text-to-cad --uninstall --dry-run # preview cleanup
The dry-run pattern applies consistently across install, update, and uninstall operations. Each prints a concrete plan with resource URLs and dependency changes before touching your filesystem.
Example 4: LoopFlow Adapter for Custom Agents
Emit a permission-gated recommendation contract:
python -m ctx.adapters.loopflow \
--goal "fix checkout e2e" \
--permissions skills,agents,mcps
Output is a JSON contract your agent loop consumes before planning. The --permissions flag controls which entity types appear, preventing capability escalation in restricted environments.
Advanced Usage & Best Practices
Start with smoke tests before heavy gates. The scripts/no_mistakes_run.sh fast --profile smoke command validates cheap invariants (formatting, docs tracker, no-test policy) in seconds. Run the full profile only after smoke passes.
Pin active entities to prevent re-suggestion. Use --selected and --active flags with ctx-recommend so your loop state persists across calls. This reduces redundant API traffic and keeps recommendation latency low.
Monitor with ctx-monitor serve. The local dashboard at http://127.0.0.1:8765/ shows loaded entities, session timeline, and live SSE events. Use it to debug why specific skills were recommended or excluded.
Review entity health periodically. ctx-skill-quality list surfaces four-signal quality scores. ctx-skill-health dashboard detects structural drift. Schedule these in your maintenance routine—monthly for active projects, quarterly for stable ones.
For custom harnesses, prefer PRD emission over blind installation. When no harness scores above threshold, ctx emits a specification document. Treat this as a requirements artifact for manual implementation rather than forcing a poor match.
Comparison with Alternatives
| Tool | Approach | Key Difference |
|---|---|---|
| stevesolun/ctx | Graph-backed recommendations with multi-entity support | Capped, scored bundles; explicit dry-run controls; local-first |
| Claude Code native skills | Static registry, manual curation | No automatic task-scoping; no quality scoring or health monitoring |
| OpenAI GPTs / Custom Actions | Closed ecosystem, API-centric | No local model support; no graph relationships between tools |
| LangChain/LlamaIndex toolkits | Framework-level orchestration | Requires integration code; no pre-built knowledge graph of 68K+ skills |
ctx occupies a distinct niche: recommendation infrastructure rather than framework or registry. It complements rather than replaces LangChain-style orchestration—you might use ctx to select tools, then LangChain to execute them. The explicit dry-run/update/uninstall lifecycle also exceeds what most static registries provide.
FAQ
Does ctx require Claude Code?
No. Claude Code hooks are optional. Local/API model users run ctx-harness-install and LoopFlow adapters independently.
What's the performance impact of the graph?
Runtime recommendations use the compressed artifact, not the full 68K-page wiki. Graph traversal is local and typically sub-second.
Can I use my own skills and agents?
Yes. ctx-init accepts organization-specific tool registries. The recommendation engine scores internal entities the same way.
Is the telemetry mandatory?
No. Core functionality requires no network access. ctx-telemetry-export --dry-run lets you inspect any collected data before transmission.
How are entity updates handled?
Updates print benefits/risks and skip by default. Re-run with --update-existing after review.
What's the license?
MIT License. Commercial use permitted.
Does it work on Windows?
Yes, with tar extraction path differences noted in setup. PowerShell and Git Bash paths are documented.
Conclusion
stevesolun/ctx addresses a concrete, growing pain point in LLM-assisted development: context bloat from undifferentiated tool loading. Its graph-backed approach—79,958 nodes, 1,778,069 edges, eight relationship signals—produces genuinely smaller, more relevant bundles than keyword matching or manual curation. The explicit dry-run lifecycle, quality scoring, and health monitoring show engineering maturity beyond typical skill registries.
Best suited for: Claude Code power users, teams building custom agent loops, local model enthusiasts, and organizations with internal tool ecosystems needing scoped recommendations.
Not a fit for: Developers wanting fully automatic, zero-review tool installation; or those satisfied with static, manually-curated skill lists.
Explore the source, browse the full documentation, and try the initialization wizard at https://github.com/stevesolun/ctx. The [INTERNAL_LINK: Python developer tools] guide covers complementary ecosystem projects.