Modern AI coding workflows are currently locked in a battle with the context window. Developers increasingly rely on comprehensive configuration files like CLAUDE.md to enforce project-specific standards, but these documents create a paradox. The more guidance provided to the AI to ensure code quality, the more tokens are consumed at the very start of a session, driving up latency and costs. This overhead becomes a significant friction point as project rule-sets grow from a few lines to massive architectural manifests.
The Mechanics of Token Reduction
nunchi enters this ecosystem as a specialized plugin for Claude Code, Anthropic's terminal-based AI coding tool, designed to decouple rule delivery from session initialization. In recent performance benchmarks, nunchi successfully reduced session start tokens from 79,683 down to 45,808, representing a 42.5% decrease in initial overhead. This efficiency gain was achieved by removing eight rule documents totaling approximately 76KB from the @import list, effectively stripping 34,000 tokens from the initial prompt.
To validate its reliability in production-like environments, nunchi was tested against 166KB of CLAUDE.md configuration files gathered from 12 distinct projects, including high-complexity environments like airflow, next.js, and supabase. The results showed a 100% format validity rate with zero instances of hallucination. Even in non-English environments, the plugin maintained high fidelity; testing with four Korean-language CLAUDE.md files, including those for pinpoint, resulted in zero format violations or over-extractions. Specifically, the plugin achieved an 88% accuracy rate in interpreting negative constraints, such as the strict instruction to never commit directly to a branch.
For developers looking to implement this optimization, the installation process is handled through the Claude Code marketplace via two specific commands:
/plugin marketplace add seob717/nunchi
/plugin install nunchi@nunchi-marketplaceScheduling Intelligence Over Static Context
The fundamental shift nunchi introduces is the move from static context to scheduled delivery. Most existing optimization strategies, such as path-scoped rules, trigger based on file-reading actions. Others, like Context Mode or Runtime Token (RTK) management tools, focus on compressing the output that returns to the user. nunchi ignores these approaches, focusing instead on the timing of the input.
When a user executes the `/nunchi:compile` command, the plugin extracts rules from CLAUDE.md and reference documents to create a rule file consisting of triggers mapped to specific tools and regular expressions. Rather than loading these rules at the start, nunchi utilizes a PreToolUse hook. This hook acts as an event listener that monitors for specific actions, such as `gh pr create`. Only when that specific action is triggered does the plugin read the original document and deliver the relevant rules to the context in real-time.
This Just-In-Time (JIT) delivery system also addresses the problem of session compaction. In long AI conversations, the system often compresses previous dialogue to save space, which frequently leads to the AI forgetting the initial project rules. nunchi solves this by employing a SessionStart hook that resets the delivery status during compaction, ensuring that the next time a trigger is hit, the rules are delivered fresh.
However, this efficiency comes with a documented trade-off. While the format validity is perfect, the recall rate—the frequency with which the AI actually applies the delivered rule to the task—stands at 35% compared to adversarial gold standards. nunchi acknowledges this gap as a primary area for ongoing development. The current architecture prioritizes the physical elimination of initial token waste and the prevention of rule forgetting over absolute recall perfection.
This transition toward action-triggered context suggests a future where AI agents no longer carry the full weight of a project's documentation in every prompt, but instead fetch precise instructions only at the moment of execution.




