Store learned repo state inside the repository (opt-in), so it can be committed and shared across machines

Open
#193 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start by locating the code that stores micro-skills facts, tool-pruning counters, and loop-guard state, then trace how it resolves TOKENECONOMIZER_HOME. The issue proposes an opt-in repository directory and separates portable data from private, machine-specific data, but does not name files or tests. Done means portable state can be shared safely, merges by fact id, and the local-only files have a documented .gitignore snippet.

Written by the indexing model from the issue text.

Description

Problem

Everything TokenEconomizer learns about a repository (micro-skills facts, tool-pruning counters, loop-guard state) is stored under ~/.tokeneconomizer (or $TOKENECONOMIZER_HOME), outside the repository. It cannot be committed, reviewed, shared with teammates, or follow the repo to another machine. Anyone who works on the same repo from several PCs, or in a team, has to re-learn the same facts from scratch on each one, which is the cost the tool exists to reduce.

Request

Support an opt-in, per-repository state directory, for example <repo>/.tokeneconomizer/:

  • A setting (or auto-detection when that directory already exists) that makes the learned, repo-specific data live inside the repository instead of the user home.
  • Keep machine-specific and private data (errors.log, session transcripts, cost ledgers, absolute paths) in the home directory, and put only portable data (confirmed facts, pruned-tool list, thresholds) in the repo, in a diff-friendly format (JSON or Markdown, stable key order, no absolute paths).
  • Make it safe to commit: no secrets or transcript excerpts, and a documented .gitignore snippet for the parts that should stay local.
  • Merge-friendly: facts keyed by id so concurrent updates from two machines merge cleanly in git.

Why TOKENECONOMIZER_HOME is not enough

It is one global directory per user, not per repository, and it has to be an absolute path, so it cannot be set in a committed .claude/settings.json and work for different users or machines.

Context

Seen with the Claude Code plugin on Windows, where the same repo is used from several machines with different user names.

Dominant language
Python
Stars
5.6k
Forks
344
Avg merge
17h 41m
Merged PRs (30d)
73

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/TokenEconomizer

All issues in microsoft/TokenEconomizer

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.