agentleFS
ValeheadValehead/ccBar/skills/ccbar-tune/SKILL.md

ccbar-tune

Skill1 starsChanged 15 days agoMITView on GitHub

Fit ccBar's handoff and retro thresholds to the user's own sessions. Runs ccbar.py --context-report over the local transcripts, recommends new threshold_tokens values, and edits ~/.claude/ccbar.config.json only after the user approves. Use when asked "should my thresholds be lower?", "the handoff feels early", "the handoff never fires", or "tune ccbar", or when ccBar's Stop hook asked and the user said yes.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read ~/.claude/settings.json and take statusLine.command.

    line 29
  2. Very specific:

    Run that command with --context-report appended.

    line 31
  3. Very specific:

    Read ~/.claude/ccbar.config.json.

    line 35
  4. Distinctive:

    Lower it when compactions say so: if more than half of the manual compactions happened below that handoff, the user is compacting before …

    line 41
  5. Very specific:

    Percent thresholds: keep threshold_pct at 70 (handoff) and 85 (retro).

    line 43
  6. Distinctive:

    If proposed equals current, say the thresholds already fit and stop.

    line 49
  7. Distinctive:

    Ask whether to apply. Anything other than a clear yes leaves the config untouched.

    line 53
  8. Very specific:

    If ~/.claude/ccbar.config.json exists, copy it to ~/.claude/ccbar.config.json.bak first, then Edit only handoff.threshold_tokens and …

    line 57
  9. Very specific:

    If the file doesn't exist, Write it with only those two values: {"handoff": {"threshold_tokens": N}, "retro": {"threshold_tokens": M}}.

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/ccbar-tune

Recommend handoff and retro thresholds from measured session lengths, then apply them only on approval.

1. Run the report

Read ~/.claude/settings.json and take statusLine.command. It already names the right Python and the right ccbar.py for either install mode (the clone, or the copy at ~/.claude/ccbar.py). If it doesn't contain ccbar.py, ccBar isn't installed: say so and stop.

Run that command with --context-report appended. Pass --days N only if the user asked for a different window (default 35).

2. Read the current values

Read ~/.claude/ccbar.config.json. Current values are handoff.threshold_tokens and retro.threshold_tokens; if the file or a key is missing, the defaults apply (handoff 200000, retro 300000). The report's last lines also show them.

3. Recommend

  • Under 10 sessions: there isn't enough history to fit. Say so, keep the current values, and stop. Suggest running again after more use.
  • Handoff: the p90 peak rounded to the nearest 50,000, at least 50,000.
  • Lower it when compactions say so: if more than half of the manual compactions happened below that handoff, the user is compacting before the handoff would ever reach them. Propose instead the median manual compaction point, rounded down to 50,000, and say that's why.
  • Retro: handoff + 100,000.
  • Percent thresholds: keep threshold_pct at 70 (handoff) and 85 (retro). The report can't model them, since transcripts don't record the context window size.

4. Show current against proposed

One short table: current and proposed for handoff and retro, with how many sessions each value would have fired in. The report gives counts for the current values; for proposed values (multiples of 50k) read the matching "Sessions reaching" line, or 0 above the last step. Quote the session count, median and p90, and that percentiles are nearest-rank.

If proposed equals current, say the thresholds already fit and stop.

5. Apply only on approval

Ask whether to apply. Anything other than a clear yes leaves the config untouched.

On yes:

  1. If ~/.claude/ccbar.config.json exists, copy it to ~/.claude/ccbar.config.json.bak first, then Edit only handoff.threshold_tokens and retro.threshold_tokens, adding either key inside its block if it's missing. Change nothing else.
  2. If the file doesn't exist, Write it with only those two values: {"handoff": {"threshold_tokens": N}, "retro": {"threshold_tokens": M}}. ccBar merges it over its defaults.
  3. Confirm in one line what changed and where the backup is. The new values apply from the next status line refresh.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.