Claude Code token test: path-scoped rules add zero tokens until triggered

A developer ran controlled experiments on Claude Code v2.1.263 to measure how different rule placement options affect token usage in a fresh session. The same 2,004-word rule set was placed inline in CLAUDE.md, via @import, as an unscoped rules file, and as a path-scoped rules file, with each method tested against a baseline. Inline, @import, and unscoped file placements all loaded the full rule text at session start, adding roughly 3,330–3,442 tokens over baseline. However, a path-scoped rule using paths: ["src/api/**"] added zero tokens at launch and only loaded its 2,987 tokens when Claude actually read a matching file. The findings confirm that path-scoped rules are the only placement method that meaningfully reduces context usage, while @import and unscoped files offer no token savings despite their organizational differences.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in