Skip to content

thoeltig/better-base-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

246 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

better-base-tools

A collection of Claude Code plugins that provide more efficient base tools to reduce turns, duplicate tool calls, and token usage.

Claude Code sessions accumulate context fast — every native tool call appends its result to the context window, and every session starts blind into the project. These plugins address both: batch_file_tools cuts I/O round-trips by batching reads and edits; project-intel-tool builds a persistent project map so sessions start informed, not blind.

Note

Hey Thore here, the remaining documentation is generated by a model so a short personal note in my own words:

It's very cool what is possible today if you don't need to think about how many tokens you use and good if someone pushes the bounds with a simple 'why not' and 'let's try it'. And for me the Claude Code harness is exactly that, a flashy showcase of what is possible and where the future of this technology might go. In my opinion that is not a way to build an efficient tool which so many already rely on or want to work with every day.

I was a bit tired of the token burning and subagent theatrics which is why I built these tools so at least every tool call the model does is a bit more precise. And no this is not a magic 'Can do everything' tool, the goal was just to reduce wasted tokens and turns while increasing the information per token and actions per turn. I tested these tools over a couple weeks and finetuned the tool schemas and outputs. The model should be able to utilize the tools and the context window a bit more efficiently now. They work for me and I feel like I get a lot more done in a single session. From what I could extract from the transcripts the tools are working and the stats support my gut feeling.

If you see a bug, create an issue and if you have an idea what might increase the efficiency open a discussion. If the tools can help you get more out of your subscription or reduce your token usage a bit, I'm happy I could help.

Have fun, keep learning and coding!

Plugins

batch_file_tools

Replaces individual Read, Edit, and Write calls with two multi-file MCP tools to cut round-trips and reduce context overhead. Includes:

  • batch_read reads multiple files in one call using three modes: compact (collapsed whitespace, lowest token cost), verbatim (exact content, with offset+count slicing), and fileinfo (metadata and dependency refs).
  • batch_edit applies multiple operations across multiple files in one call, supporting replace, replace_all, insert_at_line, replace_range, and write.
  • Whitespace-normalized anchor matching keeps failed edits from requiring a re-read; nearest-anchor error hints pinpoint the correction.
  • Indentation is normalized to 2-space on read by default for token efficiency; disable via env var when editing indentation directly.
  • Glob and directory expansion with search and context windows for targeted reads.
  • Measured impact: −58% tool calls, −46% effective input tokens, −45% session duration; the same call budget completes 2.4× more equivalent I/O work compared to native tools.

See batch_file_tools README for detailed documentation.

project-intel-tool

Persistent project knowledge base for directed file exploration. Structural data (sizes, imports, exports, file map) is available immediately without any scan; run scan once to add semantic summaries. Query before reading to orient without touching file content.

  • query searches by keyword across filepaths, exports, imports, and referenced files without any prior scan. After a scan, summaries, roles, technologies, and search tags are also included.
  • scan runs AI analysis on changed and new files, ordering batches topologically so dependencies are analyzed before dependents.
  • A two-layer data model separates structural data (size, line count, imports, exports, referenced files), which is always current without AI, from semantic data (summary, role, technologies, search tags), which is populated by scan.
  • Incremental scanning via git re-analyzes only changed files; filesystem mtime serves as a fallback for non-git projects.
  • A session start hook refreshes structural data and injects knowledge status into the model's context on every session.
  • Two scan modes are available: subagent (default, works in any harness) and MCP sampling (runs in the background without polluting the model's context).
  • Committing .knowledge/summaries.json shares the knowledge base across teammates and sessions.
  • Monorepo support aggregates knowledge across all sub-project knowledge bases automatically.
  • Measured impact: exploration agents averaged ~577k subagent tokens per orientation; query replaces this with a single call at near-zero cost, and knowledge persists across sessions so orientation is paid only once.

See project-intel-tool README for detailed documentation.

How they work together

project-intel-tool eliminates the read-many-files orientation loop at session start: a single query call returns sizes, imports, refs, and summaries across the entire project without touching file content, so the model enters the task knowing which files are relevant and how large they are. batch_file_tools handles the work phase: batch_read reads only the identified files, bundled and targeted; batch_edit applies changes without any preceding read. Orientation front-loads into the first few turns; the remainder of the session is productive work rather than exploration. Tasks that previously required a full session to orient — and a second to execute — complete start-to-finish in one.

Requirements

Node.js >= v22

Installation

Each plugin can be installed independently through the Claude Code plugin marketplace.

License

See root LICENSE for details.

Author

Thore Höltig

About

A collection of Claude Code plugins that provide more efficient base tools to reduce turns, duplicate tool calls, and token usage.

Topics

Resources

License

Stars

Watchers

Forks

Contributors