Context engineering plugin for Claude Code — real-time prompt scoring, RLM adaptive weights, and token optimization. Scores every tool use across 5 dimensions (token utilization, structural clarity, specificity, content density, cache-friendliness) and learns optimal weights for your project.
npx claudepluginhub sunnypatneedi/claude-code-contextstellarAnalyze recent prompt patterns and suggest optimizations. Use when the user wants to improve their prompting patterns, reduce token costs, or see what the RLM flywheel has learned about their project.
Score a prompt for context engineering quality. Use when the user asks to score, analyze, or optimize a prompt, or when reviewing prompt quality before sending to an LLM.
Set up ContextStellar cloud mode for RLM learning and dashboards. Use when the user wants to configure an API key, connect their project, or upgrade from local-only scoring.
Show ContextStellar scoring statistics, RLM learning progress, and grade distribution for the current project. Use when the user asks about their scoring stats, prompt quality trends, or RLM weight learning.
Real-time prompt scoring and context engineering optimization for Claude Code.
Every tool use is automatically scored across 5 dimensions. Works instantly with zero configuration — no API key, no signup, no network required.
# Install from marketplace
/plugin install contextstellar
# Or test locally
claude --plugin-dir ./claude-code-plugin
That's it. The plugin starts scoring immediately using the bundled local scorer.
For RLM adaptive weight learning and team dashboards, connect to the ContextStellar API:
export CONTEXTSTELLAR_API_KEY="cs_live_your_key_here"
export CONTEXTSTELLAR_PROJECT_ID="your_project_id_here"
Get credentials at contextstellar.com/connect.
| Mode | Config needed | Scoring | RLM Learning | Stats/Dashboard |
|---|---|---|---|---|
| Local (default) | None | Bundled scorer.js | No | No |
| Cloud | API key | Server-side + learned weights | Yes | Yes |
The plugin hooks into every tool use:
Scored tools: Bash, Write, Edit, Agent, NotebookEdit.
| Command | Description | Requires API Key |
|---|---|---|
/contextstellar:setup | Configure API key and project ID | No |
/contextstellar:score <prompt> | Manually score a prompt | No (local) / Optional (cloud) |
/contextstellar:stats | View scoring stats and RLM progress | Yes |
/contextstellar:optimize | Get optimization recommendations | Yes |
| Dimension | Weight | What It Measures |
|---|---|---|
| Token Utilization | 25% | Filler, politeness, intensifiers, redundancy |
| Structural Clarity | 23% | XML tags, lists, headers, code blocks |
| Specificity | 20% | Numbers, format keywords, examples, constraints |
| Content Density | 17% | Lexical diversity, n-gram repetition |
| Cache-Friendliness | 15% | Volatile data positioning, timestamps, UUIDs |
Weights are defaults initially. As you use Claude Code, the plugin reports outcomes (success/failure) alongside scores. After 100+ events, ContextStellar learns which dimensions matter most for your project and adjusts weights automatically.
Check progress with /contextstellar:stats.
jq and curl (for cloud mode only)claude-code-plugin/
├── .claude-plugin/
│ └── plugin.json # Plugin manifest
├── skills/
│ ├── score/SKILL.md # /contextstellar:score
│ ├── stats/SKILL.md # /contextstellar:stats
│ ├── setup/SKILL.md # /contextstellar:setup
│ └── optimize/SKILL.md # /contextstellar:optimize
├── hooks/
│ └── hooks.json # PreToolUse, PostToolUse, Stop
├── scripts/
│ ├── pre-tool-use.sh # Scoring hook (local or cloud)
│ ├── post-tool-use.sh # Outcome reporting (cloud only)
│ ├── session-stop.sh # Session end (cloud only)
│ └── scorer.js # Bundled local scorer (zero deps)
└── README.md
MIT
Governor: always-on compact professional output, telemetry, context slimming, tool-output filtering, prompt guidance, and drift guardrails for Claude Code Max users.
Opus 4.7-aware context optimization: 1M-context tuning, prompt coach, smart context packs, ContextShield, CLAUDE.md analyzer, accurate token costs, MCP tool tracking
Cost-conscious mode for Claude Code. Saves 30-60% on costs through concise responses, model routing, and efficient workflow patterns.
Estimate per-turn token cost of your .claude/ configuration and CLAUDE.md. Always-loaded vs path-scoped vs invoked-only, with top contributors. Use --api for exact counts via Anthropic's count_tokens endpoint.
Executes bash commands
Hook triggers when Bash tool is used
Modifies files
Hook triggers on file write and edit operations
Share bugs, ideas, or general feedback.
Analyze and optimize AI prompts for better results
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claim