Every team that adopts Claude Code hits the same wall after a few real engineering sessions. You write careful repository instructions in CLAUDE.md, yet twenty tool calls later — and especially right after /compact — the agent starts injecting unrequested comments and docstrings into clean code, patching files with sed or shell heredocs, ignoring installed skills, wasting context on unused tool schemas, and snapping back into English after a subagent returns in a non-English session.
Quasar (dayfinggg/quasar-claude) is an open-source Claude Code plugin built to stop those failures at the runtime composition layer rather than adding longer prose to CLAUDE.md. Using non-blocking Mod API hooks in hooks/register.ts and nine progressive-disclosure skills in skills/, it preserves behavioral rules across compaction, slims down the prompt and tool surface, enforces clean editing and shell hygiene, and keeps subagents aligned with the main thread. It pairs naturally with repository-level guidance in AGENTS.md for coding agents and execution-gate enforcement covered in Claude Code hooks, subagents, and worktrees.
Why plain CLAUDE.md breaks under long sessions
A CLAUDE.md file sits inside user-level context, which puts it in direct competition with verbose built-in engine instructions, full tool schemas, system reminders, and long command outputs. As the conversation fills up or passes through /compact, summary generation compresses earlier context and built-in boilerplate reasserts default habits. Telling the model twice in uppercase prose not to add comments or run sed rarely survives a multi-file refactor.
Quasar moves those invariants out of user prose and into Claude Code's Mod API lifecycle hooks (prompt.compose, tool.describe, prompt.attachment, tool.call, and classic.SubagentStart). Instead of fighting the engine from a low-priority markdown file, it shapes the assembled prompt, tool descriptions, attachments, and subagent startup payloads directly.
| Failure mode | Plain CLAUDE.md | Quasar Plugin |
|---|---|---|
Compaction amnesia after /compact |
User rules get diluted by summaries and built-in boilerplate | prompt.compose prunes noisy built-in sections and anchors rules at the tail with <tone_preference> |
| Prompt-cache stability | Ad-hoc prompt tweaks sit inside shifting user turns | Filters conflicting sections while keeping shared prompt-cache prefixes intact |
| Context bloat from built-in tools | All built-in tool schemas consume tokens on every idle turn | tool.describe defers 9 rarely used tools behind ToolSearch while keeping WebSearch, Grep, Write, and Edit loaded |
Unrequested comments and sed hacks |
Easily forgotten mid-refactor under pressure | tool.describe attaches executable-only and native-tool hygiene rules directly onto Write, Edit, Bash, WebSearch, and Skill |
| Passive or bloated skill listings | Long third-party skill descriptions inflate context and get skipped | prompt.attachment turns skill_listing into an active pre-action check and collapses external skill descriptions to name-only |
| Language drift after subagents return | Non-English sessions revert to English after subagent handoffs | tool.call + prompt.attachment inject a compact language-continuity reminder when Agent, Task, SendMessage, or TaskOutput return |
| Unruly subagents | Spawned agents ignore parent quality and security rules | classic.SubagentStart injects subagent.md and core-work.md automatically into spawned subagents |
Five engine-level fixes in hooks/register.ts
Rather than blocking tool execution or slowing down turns with extra model round-trips, hooks/register.ts registers non-blocking hooks across five Mod API interception points. Each hook targets a specific mechanical reason Claude Code drifts during complex work.
1. Compaction-proof rule composition with prompt.compose
When Claude Code ignores CLAUDE.md after compaction, the root cause is usually structural priority. Built-in engine sections take precedence, and verbose instructions about communication style or intermediate check-ins dilute your own engineering constraints.
Quasar intercepts prompt.compose to filter out noisy or conflicting built-in sections (communication, act_dont_rederive, heron_brook, total_tokens, and check_in_before_costly_work) while keeping shared prompt-cache prefixes intact so cached turns remain fast and inexpensive. It also normalizes typographic dashes inside session sections, appends core-work.md, applies model-specific behavioral deltas for opus-5, fable-5, sonnet-5, and haiku-5, and finishes with core-writing.md plus a closing <tone_preference> anchor. Placing that anchor at the tail of the composed prompt ensures coding discipline and response rules remain salient even after /compact.
2. Context window optimization via tool deferral and tool.describe
Every loaded tool schema consumes context tokens on every turn, whether the session uses notebooks, PowerShell, or feedback forms or not. Meanwhile, generic formatting instructions written far away from tool definitions lose influence by the time the agent picks Bash or Edit.
Quasar solves both problems inside tool.describe:
- Deferred schemas for 9 rarely used tools:
Artifact,PowerShell,Workflow,ScheduleWakeup,ListAgents,ReportFindings,AskUserQuestion,NotebookEdit, andSendFeedbackare moved behindToolSearchso they consume zero full-schema space until actually needed. - Immediate availability for daily tools:
WebSearch,Grep,Write, andEditstay loaded upfront so code reading, search, and editing happen without an extra discovery step. - Surgical rules bound to each tool:
WriteandEditcarry strict instructions to emit executable source code only with zero unrequested comment or docstring spam.Bashenforces using native file tools instead ofsedor heredoc hacks, probing optional binaries withcommand -vbefore calling them, and avoidingsleeppolling loops.WebSearchenforces treating snippets as leads only and opening full primary pages before citing them inline, whileSkillreinforces structured skill loading.
Binding each constraint directly to the tool schema means the model sees the exact guardrail at the moment it chooses parameters for that tool.
3. Active skill routing and attachment pruning with prompt.attachment
Installing several plugins creates a second context leak: long third-party skill descriptions sit in every prompt attachment even when unused, while the passive skill_listing header reads like optional metadata that the model routinely skips.
Inside prompt.attachment, Quasar rewrites the passive skill_listing header into an active pre-action check so the agent evaluates relevant skills before starting implementation, debugging, database work, or infrastructure edits. At the same time, it collapses external third-party skill descriptions down to name-only entries while preserving full descriptions for quasar:* skills and any additional described_skills configured by the user. It also strips noisy engine reminders (todo_reminder, silent_turn_reminder, total_tokens_reminder, and auto_mode) so the context window carries signal instead of status chatter.
4. Fixing subagent language switching with tool.call and prompt.attachment
Teams working in Russian, Ukrainian, Spanish, French, Arabic, Chinese, Kazakh, or Belarusian frequently run into a subtle regression: the session starts in the user's language, delegates research or edits to a subagent that thinks in English, and then the main thread continues replying in English once the subagent finishes.
Quasar fixes this across two hooks working together. First, prompt.attachment rewrites the language attachment cleanly so the active session locale is unambiguous. Second, tool.call monitors main-thread Agent, Task, SendMessage, and TaskOutput returns and injects a compact language-continuity reminder at the exact moment control returns to the main thread in Russian, Ukrainian, Spanish, French, Arabic, Chinese, Kazakh, or Belarusian sessions. The subagent still operates cleanly in English internally, and the user-facing thread stays locked to the chosen session language without manual nudges.
5. Subagent governance via classic.SubagentStart
Subagents spawned during complex refactors or parallel investigations often behave worse than the parent thread because they launch with minimal context and bypass project habits. When a child agent adds speculative comments, skips verification, or ignores security boundaries, the main thread inherits messy diffs.
Quasar hooks classic.SubagentStart to automatically inject subagent.md and core-work.md into spawned subagents, excluding lightweight web-fetch subagents that only retrieve pages. Every coding, debugging, and research subagent therefore starts with the same execution, security, and verification standards as the root session, complementing the defense-in-depth patterns outlined in prompt injection and MCP security.
Nine progressive-disclosure engineering skills in skills/
Prompt hooks keep the baseline runtime clean, while domain expertise lives inside skills/ as nine progressive-disclosure modules. On idle turns, only compact descriptors are visible; once a task enters a specific discipline, Claude Code loads the matching skill and its targeted references/*.md files on demand.
| Skill | Core responsibility | Specialized coverage and references |
|---|---|---|
clean-code |
Design heuristics, idioms, and pitfall checks before editing source code | TypeScript, JavaScript, Python, PHP, Shell, and PowerShell |
diagnosing-bugs |
Root-cause investigation protocol before proposing patches | Prevents symptom patching on crashes, regressions, and failing commands |
researching-docs |
Primary-source verification for fast-moving libraries, APIs, and CLI flags | Replaces guesswork with current official documentation checks |
verifying-work |
Post-edit verification gate before reporting completion | Covers runnable checks, regression coverage, and clean workspace state |
writing-tests |
Test design for unit, integration, and regression specs | Stabilizing flaky tests and building minimal reproduction cases |
working-with-databases |
Query tuning, indexes, transactions, migrations, and caching | PostgreSQL, MySQL/MariaDB, MongoDB, and Redis/Valkey |
operating-infrastructure |
Inspecting and changing servers, containers, and automation safely | Docker, GitHub Actions, systemd, Nginx, and SSH workflows |
securing-code |
Vulnerability auditing and defensive coding across trust boundaries | Web, backend, authentication, input validation, and supply-chain checks |
git-and-prs |
Branch hygiene, commits, worktrees, pull requests, and CI triage | Safe staging, PR creation, review response, and failing check diagnosis |
Keeping language-specific and platform-specific details in references/*.md avoids loading PostgreSQL tuning guides during a CSS edit or Docker Compose checklists during a TypeScript bug hunt.
Installation and practical quickstart
Installing Quasar takes one command inside Claude Code:
/plugin install quasar --marketplace dayfinggg/quasar-claude
For reproducible team setups or explicit control over marketplace registration, effort level, and session language, the repository includes settings.example.json for ~/.claude/settings.json:
{
"enabledPlugins": {
"quasar@quasar": true
},
"extraKnownMarketplaces": {
"quasar": {
"source": {
"source": "github",
"repo": "dayfinggg/quasar-claude"
}
}
},
"effortLevel": "high",
"language": "en"
}
Omit "language" if you want Claude Code to follow your prompt language dynamically, or set it explicitly when locking a workspace to a single language such as "ru", "uk", "es", "fr", "ar", "zh", "kk", or "be". If you rely on another third-party plugin whose skill descriptions must stay expanded rather than name-only, add those skill names to described_skills in your Quasar configuration.
A practical rollout takes three steps:
- Install the plugin via
/plugin install quasar --marketplace dayfinggg/quasar-claudeor merge theenabledPluginsandextraKnownMarketplacesentries into~/.claude/settings.json. - Keep your repository's
CLAUDE.mdfocused strictly on project-specific architecture, build commands, test targets, and forbidden paths rather than generic coding advice — the split described in agentic coding workflows. - Start a multi-file refactor or debugging session, trigger a subagent or
/compactpass, and inspect the resulting diff to verify clean executable output, nativeEdit/Writeusage, and preserved session language.
Honest boundaries and tradeoffs
No plugin replaces explicit team conventions or deterministic OS-level gates, and Quasar comes with two intentional boundaries worth noting before adoption:
- Public library documentation contracts: Because
tool.describepushesWriteandEdittoward raw executable code with zero unrequested comments, teams maintaining public SDKs or libraries that mandate JSDoc or PHPDoc blocks on exported symbols should state that requirement explicitly in their prompt or repositoryCLAUDE.md. - Platform scope and hard security gates:
quasar-claudeis built specifically for Claude Code's Mod API. Engineers working in Google Antigravity should use its sibling repository, Quasar for Antigravity (dayfinggg/quasar-agy). In addition, Quasar governs prompt composition, tool hygiene, skill routing, and subagent behavior, not filesystem permissions — keepPreToolUsehooks and Claude Code permission rules in place for destructive commands and secret paths.
When those boundaries are clear, Quasar turns Claude Code from a session that slowly forgets its instructions under load into a predictable engineering runtime with lean context, consistent subagents, and verifiable output.