Who it is forA developer or reviewer who wants a quick count or summary across many source files without loading each file into the chat.
The problemReading 50 files into context to count functions or lines uses far more context than the answer needs.
The outcomeThe agent runs one ctx_execute call and gets back only the printed summary, such as a line count per file.
What you need first
- Claude Code v1.0.33+ for the plugin install, or Node.js >= 22.5 (or Bun) for the Gemini CLI setup
- An existing AI coding agent session in a project you want to work on
Steps
- Install Context Mode in Claude Code using the plugin steps from the README.
- Ask the agent to answer a question about many files by writing a script.
- Have the agent call ctx_execute with a javascript script that uses console.log() for the final result only.
- Check that the printed output matches a spot check on one or two files.
Prompt for your agent
Using the context-mode ctx_execute tool, write a javascript script that lists each .ts file in <target-directory> with its line count and prints only those lines. Return the printed output and confirm the count for one file by reading it directly.
Caveat. The README example uses fs and a src folder, so the script must match the file layout of the target project.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for mksglu/context-mode and "Count or summarize code with one script, not many reads"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer