claudekit-terminal 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -8
- package/lib/cleanup.js +3 -3
- package/lib/cli.js +44 -19
- package/lib/docs.js +23 -16
- package/lib/telemetry.js +7 -1
- package/lib/terminal-state.js +5 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,9 +20,12 @@ Sends anonymous usage counts (never your chats or code); turn it off with `claud
|
|
|
20
20
|
|
|
21
21
|
| Free | ClaudeKit Pro |
|
|
22
22
|
| --- | --- |
|
|
23
|
-
| The status line: model, context, 5-hour and weekly use with resets, what a prompt cost, the daily budget, the "use it" nudge, the near-limit hint | The run-out
|
|
24
|
-
|
|
|
25
|
-
|
|
|
23
|
+
| The status line: model, context, 5-hour and weekly use with resets, what a prompt cost, the daily budget, the "use it" nudge, the near-limit hint | The run-out time from 20% used, and replies left (status line and `usage`) |
|
|
24
|
+
| The run-out time once a limit is 70% used | `notify` ("Claude is back") |
|
|
25
|
+
| A warning before Claude Code deletes your chats | `backup` (and `--auto`) to keep them |
|
|
26
|
+
| `search` and `export` of chats from the last 7 days | `search` and `export` of every chat, `export --format json` and `--turns` |
|
|
27
|
+
| `usage`, `week`, `map`, `tokens`, `pins`, `brief`, `prompts` and the prompt packs | `fork`, `reference`, `brief --start` |
|
|
28
|
+
| `/ck-handoff`, `/ck-optimize`, `/ck-pin` and every `/ck-` prompt | Everything Pro in the browser extension, with the same licence |
|
|
26
29
|
|
|
27
30
|
- **Get Pro:** `claudekit-terminal pro` shows the price and opens a checkout in your browser. The key arrives by itself; if you close the terminal first, run `claudekit-terminal pro check` later. Add `monthly` for monthly.
|
|
28
31
|
- **Already have Pro in the extension?** Open its popup, choose "Use Pro in your terminal", copy the key, then run `claudekit-terminal activate <key>`. A trial key works too.
|
|
@@ -47,13 +50,13 @@ Faster status line: `npm install -g claudekit-terminal`, then `claudekit-termina
|
|
|
47
50
|
| `5h 62%` | Your 5-hour session limit used: green, yellow from 70%, red from 90% |
|
|
48
51
|
| `+3%` | What your current prompt has cost of the session so far |
|
|
49
52
|
| `resets 3:10 PM` | When the session resets, in your time. At 100% it says `back 3:10 PM` |
|
|
50
|
-
| `out ~2:40 PM` |
|
|
53
|
+
| `out ~2:40 PM` | When you run out at your pace over the last hour: from 70% used, or from 20% with Pro |
|
|
51
54
|
| `~6 replies left` | Pro: about how many prompts are left at your pace on this model (from 50% used) |
|
|
52
55
|
| `week 41% · Thu 9:00 AM · ~13%/day` | Your weekly limit, when it resets, and a daily budget |
|
|
53
56
|
| `use it: resets in 10h` | In the last day before the weekly reset with 25% or more left: unused limit doesn't roll over |
|
|
54
57
|
| `spend 63% of $500` | A spend limit, when your plan has one |
|
|
55
58
|
| `near limit: /ck-handoff` | At 90%: save your context before you're cut off |
|
|
56
|
-
| `2 chats
|
|
59
|
+
| `Claude Code deletes 2 chats ≤3d` | Claude Code deletes chats older than `cleanupPeriodDays` (30 days by default) without a word. This says when some are due within 3 days and aren't in your backup, for an hour, once a day at most. `usage` says it too, once a day |
|
|
57
60
|
|
|
58
61
|
Limits show for Claude Pro, Max and Ultra plans, after the first reply in a session. With an API key you see the model and context only.
|
|
59
62
|
|
|
@@ -76,15 +79,15 @@ Run them as `claudekit-terminal <command>` (or `npx claudekit-terminal <command>
|
|
|
76
79
|
|
|
77
80
|
**Your limits**
|
|
78
81
|
|
|
79
|
-
- `usage`: every limit with bars and reset times, what your last prompt and this chat cost, cost per model,
|
|
82
|
+
- `usage`: every limit with bars and reset times, what your last prompt and this chat cost, cost per model, days without a limit, and when you'll run out once a limit is 70% used. With Pro, the run-out time shows from 20%, plus replies left.
|
|
80
83
|
- `week`: your Claude week, with weekly % used, busiest day, days active, limit hits, and a by-day chart.
|
|
81
84
|
- `notify` (Pro): at a limit, waits and sends a desktop notification when Claude is back. `--test` sends one now.
|
|
82
85
|
|
|
83
86
|
**Your chats.** Claude Code keeps every chat in `~/.claude/projects` and deletes them after 30 days by default. These commands read those files and never change them.
|
|
84
87
|
|
|
85
|
-
- `search <words
|
|
88
|
+
- `search <words>`: chats from the last 7 days with all the words, the matching lines, and how to reopen each. With Pro, every chat however old.
|
|
86
89
|
- `map [chat]`: a numbered outline of a chat, one line per prompt.
|
|
87
|
-
- `export [chat]
|
|
90
|
+
- `export [chat]`: a chat from the last 7 days as Markdown (default) or `--format txt`; `--out file.md`, or `--out -` to print. With Pro: any chat, `--format json`, and `--turns 3-5` (or `2,4`) for some prompts.
|
|
88
91
|
- `backup [folder]` (Pro): one Markdown file per chat, by project, in `~/claudekit-backup`, writing only new and changed chats. `--auto` backs up after every session; `--auto off` stops it.
|
|
89
92
|
- `fork [chat]` (Pro): opens a copy of a chat in Claude Code to try another direction, keeping the original.
|
|
90
93
|
- `reference [chat]` (Pro): saves a chat in `~/.claudekit/references`. Type `@<path>` in Claude Code to use it as context in another chat.
|
|
@@ -105,6 +108,7 @@ Run them as `claudekit-terminal <command>` (or `npx claudekit-terminal <command>
|
|
|
105
108
|
- It reads the JSON Claude Code passes to the status line, and Claude Code's chat files on your computer when you run a chat command.
|
|
106
109
|
- It keeps a few usage numbers in `~/.claudekit/usage.json`: readings for 8 days (percent used, reset times, when each reading was taken, the model family, and short numbers standing for the session and prompt), and one line per day for 90 days (that day's peak 5-hour and weekly %, and its limit hits). No chat text. It also keeps what you save (pins, briefs, references) and your Pro key.
|
|
107
110
|
- **Anonymous usage counts.** It sends a random id for this terminal, the version, your OS family (macOS, Windows, Linux) and Node.js major version. For each command it sends the name, the names of the flags used (never their values), the exit code and how long it took. It also sends words like `pro_gate: notify` or `key_activated: paid`, and whether a key came from the extension. Once a day it sends whether your limits show (a paid Claude plan), whether you hit a limit, and a usage band. It never sends your chats, prompts, code, file paths, project or repo names, or your key. Counts go out about once an hour from a command you run; the status line never waits on the network. The server keeps the country Cloudflare reports, not your IP address.
|
|
111
|
+
- Setups may appear on claudekit.app as "someone in <country> set it up", with no other detail. Weekly totals show there only once they're 50 or more.
|
|
108
112
|
- Nothing is sent before you've seen the notice once in a command, so the status line alone never sends anything. Nothing at all is sent after `claudekit-terminal telemetry off`, with `DO_NOT_TRACK=1`, or in CI.
|
|
109
113
|
- The Pro key is checked on your computer. The network is used to send those counts, to fetch or renew a key, and by `pro` to show the price. `npx` itself may check npm for a newer version; a global install avoids that.
|
|
110
114
|
- The status line never shows ads.
|
package/lib/cleanup.js
CHANGED
|
@@ -82,9 +82,9 @@ export function expiringChats(env = process.env, now = Date.now(), withinDays =
|
|
|
82
82
|
return { count, days, soonest };
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
/** "
|
|
85
|
+
/** "3 chats will be deleted by Claude Code in the next 3 days. …" '' when none. */
|
|
86
86
|
export function expiryLine(found, say, withinDays = 3) {
|
|
87
87
|
if (!found?.count) return '';
|
|
88
|
-
const
|
|
89
|
-
return
|
|
88
|
+
const one = found.count === 1;
|
|
89
|
+
return `${one ? '1 chat' : `${found.count} chats`} will be deleted by Claude Code in the next ${withinDays} days (it keeps ${found.days} days). \`${say} backup\` keeps ${one ? 'it' : 'them'} (Pro), or raise "cleanupPeriodDays" in ~/.claude/settings.json.`;
|
|
90
90
|
}
|
package/lib/cli.js
CHANGED
|
@@ -26,7 +26,7 @@ import { FALLBACK, colorEnabled, formatStatusLine, parseInput } from './statusli
|
|
|
26
26
|
import { countWords, estimateTokens } from './tokens.js';
|
|
27
27
|
import { checkKey, forgetKey, saveKey } from './license.js';
|
|
28
28
|
import { fetchKeyFor, fetchOffer, gateLines, offerLine, proStatus, refreshKeyIfDue } from './pro.js';
|
|
29
|
-
import { TELEMETRY_NOTICE, apiBase, clearQueue, flagNames, flush, flushDue, statusSignals, telemetryAllowed, track } from './telemetry.js';
|
|
29
|
+
import { SITE_NOTICE, TELEMETRY_NOTICE, apiBase, clearQueue, flagNames, flush, flushDue, statusSignals, telemetryAllowed, track } from './telemetry.js';
|
|
30
30
|
import { GRANDFATHER_UNTIL, loadTerminal, saveTerminal } from './terminal-state.js';
|
|
31
31
|
import { expiringChats, expiryLine } from './cleanup.js';
|
|
32
32
|
import { randomBytes } from 'node:crypto';
|
|
@@ -200,7 +200,7 @@ export async function run(argv, io = defaultIo()) {
|
|
|
200
200
|
function showNotices(io, state, command) {
|
|
201
201
|
let changed = false;
|
|
202
202
|
if (!state.noticeShown.grandfather && state.grandfatherUntil && Date.parse(state.grandfatherUntil) > io.now()) {
|
|
203
|
-
io.err(`Heads-up: ClaudeKit Pro features in the terminal (run-out forecast, notify, search
|
|
203
|
+
io.err(`Heads-up: ClaudeKit Pro features in the terminal (the early run-out forecast and replies left, notify, search and export beyond 7 days, backup, fork, reference) are part of ClaudeKit Pro from 0.3.0. They stay free for you until Jan 31, 2027. After that they're in ClaudeKit Pro, one licence with the browser extension: ${io.self.say} pro`);
|
|
204
204
|
state.noticeShown.grandfather = true;
|
|
205
205
|
changed = true;
|
|
206
206
|
track(io.env, state, 'notice', 'grandfather', io.now());
|
|
@@ -208,19 +208,32 @@ function showNotices(io, state, command) {
|
|
|
208
208
|
if (!state.noticeShown.telemetry && command !== 'telemetry') {
|
|
209
209
|
io.err(TELEMETRY_NOTICE(io.self.say));
|
|
210
210
|
state.noticeShown.telemetry = true;
|
|
211
|
+
state.noticeShown.site = true;
|
|
211
212
|
changed = true;
|
|
212
213
|
track(io.env, state, 'notice', 'telemetry', io.now());
|
|
214
|
+
} else if (state.noticeShown.telemetry && !state.noticeShown.site && command !== 'telemetry') {
|
|
215
|
+
// Seen before 0.3.1: say once that setups may appear on the site (nothing to say if counts are off).
|
|
216
|
+
if (state.telemetry !== false) io.err(SITE_NOTICE(io.self.say));
|
|
217
|
+
state.noticeShown.site = true;
|
|
218
|
+
changed = true;
|
|
219
|
+
track(io.env, state, 'notice', 'site', io.now());
|
|
213
220
|
}
|
|
214
221
|
if (changed) saveTerminal(state, io.env);
|
|
215
222
|
}
|
|
216
223
|
|
|
224
|
+
/** This terminal's Pro status; a key that has ended or ends within 5 days is refreshed first. */
|
|
225
|
+
async function currentPro(io, state) {
|
|
226
|
+
const status = proStatus(io.env, state, io.now());
|
|
227
|
+
if (status.key === 'expired' || (status.via === 'key' && Date.parse(status.exp) - io.now() < 5 * 86_400_000)) {
|
|
228
|
+
if (await refreshKeyIfDue(io.env, io.fetch, io.now())) return proStatus(io.env, state, io.now());
|
|
229
|
+
}
|
|
230
|
+
return status;
|
|
231
|
+
}
|
|
232
|
+
|
|
217
233
|
/** Pro, or the reason it isn't, printed. Counts the gate hit. A key near its end is refreshed first. */
|
|
218
234
|
async function requirePro(io, feature, { silent = false } = {}) {
|
|
219
235
|
const state = io.state ?? loadTerminal(io.env, io.now());
|
|
220
|
-
|
|
221
|
-
if (status.key === 'expired' || (status.via === 'key' && Date.parse(status.exp) - io.now() < 5 * 86_400_000)) {
|
|
222
|
-
if (await refreshKeyIfDue(io.env, io.fetch, io.now())) status = proStatus(io.env, state, io.now());
|
|
223
|
-
}
|
|
236
|
+
const status = await currentPro(io, state);
|
|
224
237
|
if (status.pro) return true;
|
|
225
238
|
track(io.env, state, 'pro_gate', feature, io.now());
|
|
226
239
|
if (status.key === 'expired') track(io.env, state, 'key_expired', status.trial ? 'trial' : 'paid', io.now());
|
|
@@ -241,14 +254,9 @@ function forecastFor(readings, cur, key, pro) {
|
|
|
241
254
|
return forecast(readings, cur, key);
|
|
242
255
|
}
|
|
243
256
|
|
|
244
|
-
/** Pro
|
|
257
|
+
/** Pro, for a command with free and Pro parts. Nothing is printed or counted. */
|
|
245
258
|
async function hasPro(io) {
|
|
246
|
-
|
|
247
|
-
const status = proStatus(io.env, state, io.now());
|
|
248
|
-
if (status.pro && !(status.via === 'key' && Date.parse(status.exp) - io.now() < 5 * 86_400_000)) return true;
|
|
249
|
-
if (status.key === 'none' && !status.pro) return false;
|
|
250
|
-
if (await refreshKeyIfDue(io.env, io.fetch, io.now())) return proStatus(io.env, state, io.now()).pro;
|
|
251
|
-
return status.pro;
|
|
259
|
+
return (await currentPro(io, io.state ?? loadTerminal(io.env, io.now()))).pro;
|
|
252
260
|
}
|
|
253
261
|
|
|
254
262
|
// ---------------------------------------------------------------- status line
|
|
@@ -316,9 +324,15 @@ function statusNotice(terminal, now) {
|
|
|
316
324
|
return null;
|
|
317
325
|
}
|
|
318
326
|
|
|
319
|
-
/**
|
|
327
|
+
/**
|
|
328
|
+
* "Claude Code deletes 3 chats ≤3d" when chats are about to go. Once a day at most (owner, Dec 4):
|
|
329
|
+
* the note stays for its first hour that day. The files are checked at most once an hour.
|
|
330
|
+
*/
|
|
320
331
|
function expirySegment(io, terminal, now) {
|
|
321
332
|
try {
|
|
333
|
+
const day = new Date(now).toISOString().slice(0, 10);
|
|
334
|
+
const shown = terminal.expiryNote;
|
|
335
|
+
if (shown?.day === day && now - Date.parse(shown.from) >= 3_600_000) return null;
|
|
322
336
|
const cached = terminal.expiring;
|
|
323
337
|
let count = cached && now - Date.parse(cached.at) < 3_600_000 ? cached.count : null;
|
|
324
338
|
if (count === null) {
|
|
@@ -326,7 +340,13 @@ function expirySegment(io, terminal, now) {
|
|
|
326
340
|
terminal.expiring = { at: new Date(now).toISOString(), count };
|
|
327
341
|
saveTerminal(terminal, io.env);
|
|
328
342
|
}
|
|
329
|
-
|
|
343
|
+
if (!(count > 0)) return null;
|
|
344
|
+
if (shown?.day !== day) {
|
|
345
|
+
terminal.expiryNote = { day, from: new Date(now).toISOString() };
|
|
346
|
+
terminal.expiryWarnedAt = new Date(now).toISOString();
|
|
347
|
+
saveTerminal(terminal, io.env);
|
|
348
|
+
}
|
|
349
|
+
return `Claude Code deletes ${count} ${count === 1 ? 'chat' : 'chats'} ≤3d`;
|
|
330
350
|
} catch {
|
|
331
351
|
return null;
|
|
332
352
|
}
|
|
@@ -377,7 +397,7 @@ function setupCommand(argv, io) {
|
|
|
377
397
|
? `ClaudeKit Pro is on until ${new Date(status.exp).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })}.`
|
|
378
398
|
: status.via === 'grandfather'
|
|
379
399
|
? 'Pro features stay free for you until Jan 31, 2027.'
|
|
380
|
-
: `Free: the status line, usage, week, prompts, tokens, pins. Pro (forecast, notify, search,
|
|
400
|
+
: `Free: the status line, usage, week, the last 7 days of search and export, prompts, tokens, pins. Pro (early forecast, replies left, notify, all-time search, backup, fork): ${self.say} pro`);
|
|
381
401
|
io.out(lines.join('\n'));
|
|
382
402
|
if (io.state) {
|
|
383
403
|
if (!result.statusLine.kept) track(io.env, io.state, 'setup_step', 'settings', io.now());
|
|
@@ -749,7 +769,12 @@ async function backupCommand(argv, io) {
|
|
|
749
769
|
const { words, flags } = parseArgs(argv);
|
|
750
770
|
const off = flags.auto === 'off' || words[0] === 'off';
|
|
751
771
|
// The automatic backup's hook runs with --quiet after every session: without Pro it stays quiet.
|
|
752
|
-
|
|
772
|
+
// A backup someone runs within a day of the deletion warning counts as that warning's click-through
|
|
773
|
+
// (the session-end hook's --quiet run doesn't).
|
|
774
|
+
const warned = Date.parse(io.state?.expiryWarnedAt ?? '');
|
|
775
|
+
const afterWarning = flags.quiet !== true && Number.isFinite(warned) && io.now() - warned < 86_400_000;
|
|
776
|
+
const feature = flags.auto !== undefined ? 'backup_auto' : afterWarning ? 'backup_warning' : 'backup';
|
|
777
|
+
if (!off && !(await requirePro(io, feature, { silent: flags.quiet === true }))) return flags.quiet ? 0 : 4;
|
|
753
778
|
if (flags.auto !== undefined) return autoBackup(words, flags, io);
|
|
754
779
|
const dir = resolve(io.cwd, words[0] ?? defaultBackupDir(io.env));
|
|
755
780
|
const manifestPath = join(dir, '.claudekit-backup.json');
|
|
@@ -983,7 +1008,7 @@ function licenseCommand(argv, io) {
|
|
|
983
1008
|
if (status.via === 'key') io.out(`ClaudeKit Pro${status.trial ? ' (free trial)' : ''} is on until ${fmtDay(status.exp)}.`);
|
|
984
1009
|
else if (status.via === 'grandfather') io.out(`Pro features are free for you until ${fmtDay(GRANDFATHER_UNTIL)}, because you used ClaudeKit in the terminal before 0.3.0. Keep them after that: ${io.self.say} pro`);
|
|
985
1010
|
else if (status.key === 'expired') io.out(`Your Pro key ended on ${fmtDay(status.exp)}. Copy a new one from the ClaudeKit popup, or: ${io.self.say} pro`);
|
|
986
|
-
else io.out(`Free. Pro adds the run-out
|
|
1011
|
+
else io.out(`Free. Pro adds the run-out time from 20% and replies left, notify, all-time search and export, backup, fork and reference: ${io.self.say} pro`);
|
|
987
1012
|
return 0;
|
|
988
1013
|
}
|
|
989
1014
|
|
|
@@ -1005,7 +1030,7 @@ async function proCommand(argv, io) {
|
|
|
1005
1030
|
const offer = await fetchOffer(io.env, io.fetch);
|
|
1006
1031
|
const url = `${apiBase(io.env)}/v1/billing/checkout?period=${period}&installId=${state.installId}&source=terminal`;
|
|
1007
1032
|
io.out([
|
|
1008
|
-
'ClaudeKit Pro: the run-out
|
|
1033
|
+
'ClaudeKit Pro: the run-out time from 20% and replies left, "Claude is back" notifications, all-time search and export, backups, fork and reference chats in the terminal, plus everything Pro in the browser extension. One licence.',
|
|
1009
1034
|
offer ? offerLine(offer) : 'Prices: claudekit.app/pricing',
|
|
1010
1035
|
'',
|
|
1011
1036
|
`Checkout (${period}${period === 'yearly' ? `; monthly: ${io.self.say} pro monthly` : ''}):`,
|
package/lib/docs.js
CHANGED
|
@@ -11,14 +11,14 @@ Set up (one command):
|
|
|
11
11
|
${say} remove undo it (--all also deletes ~/.claudekit)
|
|
12
12
|
|
|
13
13
|
Your limits:
|
|
14
|
-
usage every limit, what prompts cost
|
|
14
|
+
usage every limit, what prompts cost, the run-out time from 70% (Pro: from 20%, replies left)
|
|
15
15
|
week your Claude week: busiest day, days active, limit hits
|
|
16
16
|
notify Pro wait, then tell you when Claude is back after a limit
|
|
17
17
|
|
|
18
18
|
Your chats (Claude Code's own files on this computer):
|
|
19
|
-
search
|
|
19
|
+
search search your chats from the last 7 days (Pro: every chat)
|
|
20
20
|
map [chat] numbered outline of a chat
|
|
21
|
-
export
|
|
21
|
+
export save a chat from the last 7 days as Markdown or text (Pro: any chat, json, --turns)
|
|
22
22
|
backup Pro every chat as Markdown in ~/claudekit-backup (--auto: after each session)
|
|
23
23
|
fork Pro open a copy of a chat to try another direction
|
|
24
24
|
reference Pro save a chat to bring into another one with @
|
|
@@ -60,10 +60,12 @@ SET UP
|
|
|
60
60
|
|
|
61
61
|
FREE AND PRO
|
|
62
62
|
Free: the status line (model, context, 5-hour and weekly use and resets, what a prompt cost, the
|
|
63
|
-
daily budget, the "use it" nudge, the near-limit hint
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
daily budget, the "use it" nudge, the near-limit hint, the warning before Claude Code
|
|
64
|
+
deletes chats), the run-out time once a limit is 70% used, usage, week, search and export
|
|
65
|
+
of chats from the last 7 days, prompts and packs, /ck- commands, tokens, pins, map, brief.
|
|
66
|
+
Pro: the run-out time from 20% used and replies left (status line and usage), notify,
|
|
67
|
+
search and export of every chat, export as JSON and --turns ranges, backup (and --auto),
|
|
68
|
+
fork, reference, brief --start.
|
|
67
69
|
If you used ClaudeKit in the terminal before 0.3.0, everything stays free for you until
|
|
68
70
|
Jan 31, 2027.
|
|
69
71
|
pro shows the price and opens a checkout in your browser; the key arrives by itself
|
|
@@ -78,15 +80,16 @@ THE STATUS LINE (inside Claude Code)
|
|
|
78
80
|
5h 62% your 5-hour session limit used (green, yellow from 70%, red from 90%)
|
|
79
81
|
+3% what your current prompt has cost of the session so far
|
|
80
82
|
resets 3:10 PM when the session resets, in your time (at 100%: "back 3:10 PM")
|
|
81
|
-
out ~2:40 PM
|
|
83
|
+
out ~2:40 PM when you run out at your pace over the last hour (from 70% used; Pro: from 20%)
|
|
82
84
|
~6 replies left Pro: about how many prompts are left at your pace on this model (from 50% used)
|
|
83
85
|
week 41% your weekly limit, when it resets, and a daily budget (~13%/day)
|
|
84
86
|
use it in the last day before the weekly reset with 25%+ left: unused limit doesn't roll over
|
|
85
87
|
spend 63% a spend limit, when your plan has one
|
|
86
88
|
near limit at 90%: type /ck-handoff to save your context before you're cut off
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
Claude Code deletes 2 chats ≤3d
|
|
90
|
+
Claude Code deletes chats older than cleanupPeriodDays (30 by default) without a
|
|
91
|
+
word; this says when some are due within 3 days and aren't backed up. Once a day
|
|
92
|
+
at most, for an hour (usage says it too, once a day)
|
|
90
93
|
Limits show for Claude Pro, Max and Ultra plans, after the first reply in a session.
|
|
91
94
|
Options: --no-color (or NO_COLOR), --no-history (or CLAUDEKIT_NO_HISTORY=1) keeps no numbers.
|
|
92
95
|
|
|
@@ -103,7 +106,8 @@ COMMANDS IN CLAUDE CODE (type them; Claude never runs them on its own)
|
|
|
103
106
|
|
|
104
107
|
YOUR LIMITS
|
|
105
108
|
usage every limit with bars and reset times, what your last prompt and this chat
|
|
106
|
-
cost, per-model cost, days without a limit
|
|
109
|
+
cost, per-model cost, days without a limit, the run-out time from 70% used
|
|
110
|
+
(Pro: from 20%, and replies left)
|
|
107
111
|
week your Claude week: weekly % used, busiest day, days active, limit hits, by day
|
|
108
112
|
notify Pro at a limit, waits and sends a desktop notification when Claude is back
|
|
109
113
|
(--test sends one now)
|
|
@@ -111,10 +115,11 @@ YOUR LIMITS
|
|
|
111
115
|
YOUR CHATS
|
|
112
116
|
Claude Code keeps every chat in ~/.claude/projects and deletes them after 30 days by default.
|
|
113
117
|
These commands read those files; they never change them.
|
|
114
|
-
search
|
|
118
|
+
search every chat from the last 7 days that has all the words, with the matching lines
|
|
119
|
+
and how to reopen it (Pro: every chat, however old)
|
|
115
120
|
map [chat] a numbered outline: one line per prompt
|
|
116
|
-
export
|
|
117
|
-
--out
|
|
121
|
+
export a chat from the last 7 days as Markdown (default) or --format txt; --out file.md,
|
|
122
|
+
or --out - to print it. Pro: any chat, --format json, --turns 3-5 or 2,4
|
|
118
123
|
backup Pro one Markdown file per chat, by project, in ~/claudekit-backup; only new and
|
|
119
124
|
changed chats are written. --auto turns on a backup after every session,
|
|
120
125
|
--auto off turns it off
|
|
@@ -142,7 +147,9 @@ PRIVACY
|
|
|
142
147
|
major version; per command its name, flag names (never values), exit code and duration; words
|
|
143
148
|
like "pro_gate: notify"; and once a day whether limits show (a paid Claude plan), a limit hit and
|
|
144
149
|
a usage band. Never your chats, prompts, code, file paths, project or repo names, or your key.
|
|
145
|
-
Counts go out about once an hour from a command; the status line never waits on the network.
|
|
150
|
+
Counts go out about once an hour from a command; the status line never waits on the network.
|
|
151
|
+
Setups may appear on claudekit.app as "someone in <country> set it up", with no other detail.
|
|
152
|
+
Nothing is sent before you've seen the notice once, and nothing at all after
|
|
146
153
|
${say} telemetry off, with DO_NOT_TRACK=1, or in CI.
|
|
147
154
|
The Pro key is checked on your computer. The network is used to send those counts, to fetch or
|
|
148
155
|
renew a key, and by pro to show the price. npx itself may check npm for a newer version; a
|
package/lib/telemetry.js
CHANGED
|
@@ -13,8 +13,14 @@ import { kitDir } from './paths.js';
|
|
|
13
13
|
const MAX_QUEUE = 200;
|
|
14
14
|
const queuePath = (env) => join(kitDir(env), 'events.json');
|
|
15
15
|
|
|
16
|
+
/** Said on the site's terminal page from 0.3.1 (Sales spec, Dec 4): country only, no other detail. */
|
|
17
|
+
export const SITE_LINE = "Setups may appear on claudekit.app as 'someone in <country> set it up', with no other detail.";
|
|
18
|
+
|
|
16
19
|
export const TELEMETRY_NOTICE = (say) =>
|
|
17
|
-
`ClaudeKit for the terminal sends anonymous usage counts (which commands run and when a Pro feature is asked for; never your chats, code, file paths or keys) so we can make it better. Turn it off any time: ${say} telemetry off (or set DO_NOT_TRACK=1).`;
|
|
20
|
+
`ClaudeKit for the terminal sends anonymous usage counts (which commands run and when a Pro feature is asked for; never your chats, code, file paths or keys) so we can make it better. ${SITE_LINE} Turn it off any time: ${say} telemetry off (or set DO_NOT_TRACK=1).`;
|
|
21
|
+
|
|
22
|
+
/** For people who saw the notice before 0.3.1 said that. */
|
|
23
|
+
export const SITE_NOTICE = (say) => `New in 0.3.1: ${SITE_LINE} Turn usage counts off: ${say} telemetry off`;
|
|
18
24
|
|
|
19
25
|
export function apiBase(env = process.env) {
|
|
20
26
|
return (env.CLAUDEKIT_API || 'https://api.claudekit.app').replace(/\/$/, '');
|
package/lib/terminal-state.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
// ~/.claudekit/terminal.json: this terminal's own settings.
|
|
2
2
|
// id random "ckt_…" id for the anonymous usage counts (never tied to a person)
|
|
3
3
|
// telemetry false once turned off
|
|
4
|
-
// noticeShown { telemetry, grandfather }: one-time notices already shown
|
|
4
|
+
// noticeShown { telemetry, site, grandfather }: one-time notices already shown (site: the 0.3.1
|
|
5
|
+
// line that setups may appear on claudekit.app)
|
|
5
6
|
// grandfatherUntil set for people who used ClaudeKit in the terminal before 0.3.0: every
|
|
6
7
|
// feature stays free for them until then (Terminal Pro, Dec 2026)
|
|
7
8
|
// hints { command: 'YYYY-MM-DD' }: the last day a "Pro: …" hint was shown for it
|
|
8
9
|
// installId the id a terminal checkout used, so `pro` can pick up its key later
|
|
9
10
|
// lastDaily 'YYYY-MM-DD' of the status line's last daily count
|
|
11
|
+
// expiring { at, count }: chats Claude Code deletes within 3 days, checked hourly
|
|
12
|
+
// expiryNote { day, from }: the day's status-line deletion note (shown for its first hour)
|
|
13
|
+
// expiryWarnedAt when the deletion warning was last shown (a backup soon after counts it)
|
|
10
14
|
|
|
11
15
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
12
16
|
import { randomBytes } from 'node:crypto';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudekit-terminal",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Your Claude limits, chats and prompts in the terminal: a status line for Claude Code, usage and week, prompt packs and /ck- commands free;
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Your Claude limits, chats and prompts in the terminal: a status line for Claude Code, usage and week, prompt packs and /ck- commands free; all-time search and export, backup, notify, replies left and fork with ClaudeKit Pro. One command sets it up. Zero dependencies; anonymous usage counts you can turn off.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"claudekit-terminal": "bin/claudekit-terminal.js"
|