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.
In this repository2 other files it gives its agents.
- session-handoffSkill
- session-retroSkill
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
- Very specific: line 29
Read ~/.claude/settings.json and take statusLine.command.
- Very specific: line 31
Run that command with --context-report appended.
- Very specific: line 35
Read ~/.claude/ccbar.config.json.
- Distinctive: line 41
Lower it when compactions say so: if more than half of the manual compactions happened below that handoff, the user is compacting before …
- Very specific: line 43
Percent thresholds: keep threshold_pct at 70 (handoff) and 85 (retro).
- Distinctive: line 49
If proposed equals current, say the thresholds already fit and stop.
- Distinctive: line 53
Ask whether to apply. Anything other than a clear yes leaves the config untouched.
- Very specific: line 57
If ~/.claude/ccbar.config.json exists, copy it to ~/.claude/ccbar.config.json.bak first, then Edit only handoff.threshold_tokens and …
- Very specific: line 58
If the file doesn't exist, Write it with only those two values: {"handoff": {"threshold_tokens": N}, "retro": {"threshold_tokens": M}}.
≈ “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.
Files
/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_pctat 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:
- If
~/.claude/ccbar.config.jsonexists, copy it to~/.claude/ccbar.config.json.bakfirst, then Edit onlyhandoff.threshold_tokensandretro.threshold_tokens, adding either key inside its block if it's missing. Change nothing else. - 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. - Confirm in one line what changed and where the backup is. The new values apply from the next status line refresh.
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
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.

