[{"data":1,"prerenderedAt":286},["ShallowReactive",2],{"navigation_docs":3,"-benchmarks-ai-token-efficiency":129,"-benchmarks-ai-token-efficiency-surround":281},[4,45,62,88,108],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15,20,25,30,35,40],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F2.introduction","i-lucide-house",{"title":16,"path":17,"stem":18,"icon":19},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F3.installation","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F4.configuration","i-lucide-settings",{"title":26,"path":27,"stem":28,"icon":29},"Supported Formats","\u002Fgetting-started\u002Fsupported-formats","1.getting-started\u002F5.supported-formats","i-lucide-file-code",{"title":31,"path":32,"stem":33,"icon":34},"Agent Skill","\u002Fgetting-started\u002Fagent-skill","1.getting-started\u002F6.agent-skill","i-lucide-cpu",{"title":36,"path":37,"stem":38,"icon":39},"Changelog","\u002Fgetting-started\u002Fchangelog","1.getting-started\u002F7.changelog","i-lucide-scroll-text",{"title":41,"path":42,"stem":43,"icon":44},"Migrating from v4 to v5","\u002Fgetting-started\u002Fmigration","1.getting-started\u002F8.migration","i-lucide-arrow-right-left",{"title":46,"path":47,"stem":48,"children":49,"icon":6},"CI & Hooks","\u002Fci-and-hooks","2.ci-and-hooks\u002F1.index",[50,52,57],{"title":46,"path":47,"stem":48,"icon":51},"i-lucide-git-pull-request",{"title":53,"path":54,"stem":55,"icon":56},"Use jscpd in CI","\u002Fci-and-hooks\u002Fci","2.ci-and-hooks\u002F2.ci","i-lucide-github",{"title":58,"path":59,"stem":60,"icon":61},"Use jscpd in Pre-Commit Hook","\u002Fci-and-hooks\u002Fpre-commit","2.ci-and-hooks\u002F3.pre-commit","i-lucide-git-commit",{"title":63,"path":64,"stem":65,"children":66,"icon":68},"Reporters","\u002Freporters","3.reporters\u002F1.index",[67,69,73,78,83],{"title":63,"path":64,"stem":65,"icon":68},"i-lucide-file-chart-column",{"title":70,"path":71,"stem":72,"icon":29},"HTML Reporter","\u002Freporters\u002Fhtml","3.reporters\u002F2.html",{"title":74,"path":75,"stem":76,"icon":77},"JSON Reporter","\u002Freporters\u002Fjson","3.reporters\u002F3.json","i-lucide-braces",{"title":79,"path":80,"stem":81,"icon":82},"Badge Reporter","\u002Freporters\u002Fbadge","3.reporters\u002F4.badge","i-lucide-award",{"title":84,"path":85,"stem":86,"icon":87},"SARIF Reporter","\u002Freporters\u002Fsarif","3.reporters\u002F5.sarif","i-lucide-shield-check",{"title":89,"icon":6,"path":90,"stem":91,"children":92,"page":6},"Benchmarks","\u002Fbenchmarks","4.benchmarks",[93,98,103],{"title":94,"path":95,"stem":96,"icon":97},"Detection Speed","\u002Fbenchmarks\u002Fdetection-speed","4.benchmarks\u002F1.detection-speed","i-lucide-zap",{"title":99,"path":100,"stem":101,"icon":102},"Multi-Format Detection","\u002Fbenchmarks\u002Fcross-format","4.benchmarks\u002F2.cross-format","i-lucide-layers",{"title":104,"path":105,"stem":106,"icon":107},"AI Token Efficiency","\u002Fbenchmarks\u002Fai-token-efficiency","4.benchmarks\u002F3.ai-token-efficiency","i-lucide-sparkles",{"title":109,"path":110,"stem":111,"children":112,"icon":114},"API","\u002Fapi","5.api\u002F1.index",[113,115,120,125],{"title":109,"path":110,"stem":111,"icon":114},"i-lucide-code",{"title":116,"path":117,"stem":118,"icon":119},"Rust Crates (v5)","\u002Fapi\u002Fcore","5.api\u002F2.core","i-lucide-box",{"title":121,"path":122,"stem":123,"icon":124},"Server API","\u002Fapi\u002Fserver","5.api\u002F3.server","i-lucide-server",{"title":126,"path":127,"stem":128,"icon":119},"MCP Server","\u002Fapi\u002Fmcp-server","5.api\u002F4.mcp-server",{"id":130,"title":104,"body":131,"description":272,"extension":273,"links":274,"meta":275,"navigation":276,"path":105,"seo":277,"stem":106,"__hash__":280},"docs\u002F4.benchmarks\u002F3.ai-token-efficiency.md",{"type":132,"value":133,"toc":267},"minimark",[134,143],[135,136,137,138,142],"p",{},"When CPD output is fed to an LLM (for automated refactoring, code review, or deduplication workflows), output size directly impacts cost, latency, and context window usage. jscpd's ",[139,140,141],"code",{},"--reporters ai"," flag is purpose-built for this — agents and LLM workflows should use it by default.",[144,145,146,151,157,194,205,208,218,222,256],"benchmark-token-efficiency",{},[147,148,150],"h2",{"id":149},"the-ai-reporter","The AI Reporter",[135,152,153,154,156],{},"The ",[139,155,141],{}," flag produces a token-efficient plain-text format designed for LLM consumption. Key optimizations:",[158,159,160,172,178,184],"ul",{},[161,162,163,167,168,171],"li",{},[164,165,166],"strong",{},"Common-path-prefix compression"," — shared directory prefixes are factored out (e.g., ",[139,169,170],{},"fixtures\u002Fclike\u002F file1.cpp:1-88 ~ file2.cpp:1-88"," instead of two full paths)",[161,173,174,177],{},[164,175,176],{},"No code fragments"," — only file paths and line ranges are reported",[161,179,180,183],{},[164,181,182],{},"Minimal structure"," — one line per clone, no JSON overhead",[161,185,186,189,190,193],{},[164,187,188],{},"Summary line"," — clone count and duplication percentage after a ",[139,191,192],{},"---"," separator",[135,195,196,197,200,201,204],{},"The AI reporter uses ",[164,198,199],{},"~2,800 tokens"," for 212 clones (13 tokens\u002Fclone) — an ",[164,202,203],{},"8× reduction"," versus the console reporter (~23,000 tokens, 110 tokens\u002Fclone).",[135,206,207],{},"Sample output:",[209,210,216],"pre",{"className":211,"code":213,"language":214,"meta":215},[212],"language-text","fixtures\u002Fclike\u002F file1.cpp:1-88 ~ file2.cpp:1-88\nfixtures\u002Fclike\u002F file1.cs:1-91 ~ file2.cs:1-91\nfixtures\u002Fsvelte\u002F component1.svelte:css:112-230 ~ component2.svelte:css:112-230\nfixtures\u002Fmarkdown\u002F file3.md:typescript:34-64 ~ file4.md:typescript:34-64\n---\n212 clones · 37.1% duplication\n","text","",[139,217,213],{"__ignoreMap":215},[147,219,221],{"id":220},"methodology","Methodology",[158,223,224,234,244,250],{},[161,225,226,229,230,233],{},[164,227,228],{},"Target:"," ",[139,231,232],{},"fixtures\u002F"," directory — 547 files, 21,645 lines across 150+ language formats",[161,235,236,239,240,243],{},[164,237,238],{},"Token estimation:"," Using ",[139,241,242],{},"cl100k_base"," tokenizer on each tool's default output",[161,245,246,249],{},[164,247,248],{},"Output formats:"," Each tool's primary output format (AI reporter, console, JSON, plain text)",[161,251,252,255],{},[164,253,254],{},"Hardware:"," Apple Silicon (Darwin arm64)",[135,257,258,259,266],{},"Full methodology details are in the ",[260,261,265],"a",{"href":262,"rel":263},"https:\u002F\u002Fgithub.com\u002Fkucherenko\u002Fjscpd\u002Fblob\u002Fmaster\u002Fbenchmark\u002FBENCHMARK.md",[264],"nofollow","jscpd repository",".",{"title":215,"searchDepth":268,"depth":268,"links":269},2,[270,271],{"id":149,"depth":268,"text":150},{"id":220,"depth":268,"text":221},"How jscpd's AI reporter saves tokens compared to other CPD tools — 8× reduction for LLM workflows.","md",null,{},{"icon":107},{"title":278,"description":279},"AI Token Efficiency — jscpd","jscpd's AI reporter uses ~2,800 tokens for 212 clones (13 tokens\u002Fclone) — 8× fewer than the console reporter. Compare token efficiency across 7 CPD tools.","2Zb3u06ldRHe3ay_v16kCCVfBzfOlut2av8sUJ2pFko",[282,284],{"title":99,"path":100,"stem":101,"description":283,"icon":102,"children":-1},"How jscpd detects duplicates across Svelte, Astro, Vue, and Markdown formats — vs other tools.",{"title":109,"path":110,"stem":111,"description":285,"icon":114,"children":-1},"Use jscpd programmatically in your applications.",1782123774327]