DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to count or summarize code with one script, not many reads with Context Mode

Have the agent write a short script that prints only the result, using ctx_execute.

Short answer: Install Context Mode in Claude Code using the plugin steps from the README; then 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. All steps.

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

  1. Install Context Mode in Claude Code using the plugin steps from the README.
  2. Ask the agent to answer a question about many files by writing a script.
  3. Have the agent call ctx_execute with a javascript script that uses console.log() for the final result only.
  4. 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer