SLOPSHOPPER

Auto Session Name

Names each session from its first prompt and re-checks the name every few prompts as the work moves on, so it is easy to find in /resume.

model
A shopper browsing a rack in a slop shop
README

๐Ÿงฉ Claude Code Mods

Live panes, prompt bands, status line entries, toasts, and hooks for Claude Code, each shipped as a plugin.

Release CI License: MIT

๐Ÿš€ Install

/plugin marketplace add tartinerlabs/claude-code-mods
/plugin install <mod> --marketplace tartinerlabs/claude-code-mods

๐Ÿงฐ Mods

| | Mod | Where it shows | In one line | | :-: | --- | --- | --- | | โธ | auto-resume | Status line, toast | Picks a turn back up once a usage limit resets | | ๐Ÿท | auto-session-name | Session title | Names each session from its first prompt and keeps the name current as the work moves on | | โฑ | cache-clock | Band above the prompt | Counts down to the prompt cache going cold | | ๐Ÿ“Š | limit-watch | Band above the prompt, toasts | Shows the 5-hour and weekly usage limits and the session's cost | | ๐Ÿ›ซ | pr-pilot | Band above the prompt, toasts | Shows the branch's PR checks and merges it with /merge | | ๐Ÿ“ | release-notes | Band above the prompt, toast | Drafts App Store release notes for Xcode projects when the version is bumped | | ๐Ÿ“ฑ | resource-watch | Band above the prompt, toast | Shows which session is using each simulator, Claude Design project or the Xcode app, and messages the other session on a clash | | ๐Ÿ—œ | smart-compact | Toast | Compacts between turns, sooner at checkpoints or when the cache is cooling | | โ›… | token-weather | Band above the prompt | Forecasts how full the context window is |


โธ auto-resume

When a turn stops on a usage limit, waits until the limit resets and sends continue. Typing a prompt yourself or running /auto-resume cancel stops the wait.

โธ auto-resume in 1h 12m                                    โ† status line
Usage limit reset, resuming                                 โ† toast

<sub>๐Ÿ“ plugins/auto-resume</sub>

๐Ÿท auto-session-name

Names each session from its first prompt using Haiku and can give it a prompt bar colour, so it is easy to find with claude -r after a crash. When the first prompt is short, such as continue or look at this, it titles the session again from the last four prompts on the fourth. Every eighth prompt it checks the title against the last four prompts and renames the session only when the work has moved to a different task; small shifts keep the title. Sessions already named with -n or /rename are left alone, and a rename stops any re-title. Set the color option to red, blue, green, yellow, purple, orange, pink or cyan to colour named sessions; default leaves the colour alone.

> fix the flaky retry test in the upload worker
                                    โ†’ session titled "Fix flaky upload retry test"

<sub>๐Ÿ“ plugins/auto-session-name</sub>

โฑ cache-clock

Draws a countdown above the prompt to when the prompt cache goes cold, with the last request's hit rate. Once cold, it shows how much the next turn re-writes. Set the ttl option to 1h when extended caching is on.

๐Ÿ”ฅ cache 3:42 left ยท 96% hit                                โ† green, yellow under a minute
๐ŸงŠ cache cold ยท next turn re-writes 84.3k                   โ† red

<sub>๐Ÿ“ plugins/cache-clock</sub>

๐Ÿ“Š limit-watch

Draws the 5-hour and weekly usage limits above the prompt with live reset countdowns, green under 60%, yellow to 80% and red past it. Toasts once a window passes 80% and again at 95%. Any other window the API reports, such as a gateway spend limit, shows under its own name. The session's cost so far follows the limits.

๐Ÿ•” 5h 42% ยท 2h17m  ๐Ÿ“… 7d 81% ยท 3d4h  ๐Ÿ’ฐ $2.36              โ† band
7d limit at 81%, resets in 3d4h                             โ† toast

<sub>๐Ÿ“ plugins/limit-watch</sub>

๐Ÿ›ซ pr-pilot

Draws the current branch's open pull request above the prompt with its checks and whether it can merge, refreshed each minute and after every turn. Toasts when a run of checks finishes. /merge merges it with gh and deletes the branch, but only once every check has passed and nothing blocks it. On a gh-stack layer the band shows its place in the stack, and /merge merges the whole stack with gh stack merge once every unmerged layer has passed its checks and has no unpushed commits, then switches to the trunk and deletes every layer's branch, local and remote, once all of them have merged. Set the method option to merge (default), squash or rebase. Needs the GitHub CLI, signed in.

๐Ÿ”€ PR #42  โณ 3/5 checks  waiting                            โ† band
PR #42  โœ— 1 failing: SonarCloud  blocked                     โ† red
PR #42  โœ“ 5/5 checks  ready ยท /merge                         โ† green
PR #42  stack 2/3  โœ“ 5/5 checks  ready ยท /merge              โ† a gh-stack layer
PR #42 checks passed, ready to /merge                        โ† toast

<sub>๐Ÿ“ plugins/pr-pilot</sub>

๐Ÿ“ release-notes

In an Xcode project, draws the app's MARKETING_VERSION and build above the prompt with the commits since the last release. When a turn, or anything between sessions, changes the version, Haiku drafts App Store "What's New" notes from those commits and a toast says where they went. With fastlane they go to fastlane/metadata/<locale>/release_notes.txt for the default locale, else en-US, else the first. Without fastlane they become a ## <version> section in CHANGELOG.md, and a section that is already there is left alone. The last release is the newest tag, or the commit that set the previous version when the repository has no tags. The first time it sees a repository it only records the version. /draft-release-notes drafts the notes again, replacing what is there.

๐Ÿ“ v2.4.0 (41)  12 commits since v2.3.0  notes drafted      โ† band
Release notes for 2.4.0 drafted in fastlane/metadata/en-US/release_notes.txt   โ† toast

<sub>๐Ÿ“ plugins/release-notes</sub>

๐Ÿ“ฑ resource-watch

Shows which Claude Code session is using each shared thing on the machine, so parallel agents do not fight over one. Booted Apple simulators and Claude Design projects are the baseline; the Xcode app sits on top.

  • Simulators: in an Xcode project, or once the session has used one, every booted simulator with the sessions holding it. A session takes a simulator when simctl or xcodebuild names it by UDID or name, or uses booted or an Xcode MCP run while only one is booted; commands that only look, as simctl list or xcodebuild -showdestinations, do not count.
  • Claude Design: a project, on any claude-design tool call on it.
  • Xcode app: on Xcode MCP calls that change its shared state: switching scheme, run destination or test plan, opening or closing a workspace, building, running, testing or stopping.

A hold lasts the hold option's minutes (10 by default) after the last call, and ends with the session. Sessions share their holds as files in ~/.claude/resource-watch/, labelled by their project's folder. A simulator call on one another session holds is refused the first time: the holding session is asked, and the agent is told to wait for its reply, then repeat the call to go ahead, and never to switch to or create another simulator without asking you. The holder tells the waiting sessions once it is done: after StopProject or DeviceInteractionEndSession, when its hold runs out, or when it ends. For a Claude Design project or the Xcode app nothing is refused: it toasts, messages the holding session so its agent can reply asking it to wait, and tells its own agent who holds it; a session that ends tells the sessions it shared with.

๐Ÿ“ฑ iPhone 18 Pro (iOS 27.2) ยท this session  ๐Ÿ›  the Xcode app ยท โš  also the web session   โ† band
iPhone 18 Pro is in use by the web session; asked it, waiting                            โ† toast

<sub>๐Ÿ“ plugins/resource-watch</sub>

๐Ÿ—œ smart-compact

Compacts the conversation between turns, never during one, weighing several factors against the context's fill. Past the threshold option (60, 70 default, or 80%) it compacts about ten seconds after a turn ends. It compacts sooner when compacting is cheapest or most worth it:

  • Checkpoints, 20 points lower: a turn that committed, opened or merged a PR (gh pr, gh stack), had a plan approved, finished its todo list, or switched branch or worktree. The summary is told what to keep for each, such as the approved plan verbatim. A checkpoint counts only until the next turn starts. Set checkpoints to off to ignore them.
  • Cache cooling, 20 points lower in the last minute before the prompt cache goes cold, so the summary still reads the conversation from cache. Once the cache is cold it does not compact sooner, since the summary would re-read the whole conversation uncached.
  • 5-hour limit, 10 points lower while it is at 80% or more.

Nothing takes it under the floor option (30, 40 default, or 50%), and it tries at most once per idle stretch. The ttl option defaults to auto: 1h on a subscription, 5m on an API key or cloud provider. Set it to 5m while a subscription draws on usage credits, or to 1h when you set a one-hour cache yourself.

Set continue to tasks to carry on after compacting while todos or tasks are still open. It sends Continue with the remaining tasks., unless the turn was interrupted or ended on a question.

Compacted at 52%: committed                                  โ† toast
Compacted at 55%: cache cooling                              โ† toast
Compacted at 74%: context high, 5h limit at 86%              โ† toast
Compacted at 75%: context high; continuing                   โ† toast

<sub>๐Ÿ“ plugins/smart-compact</sub>

โ›… token-weather

Draws a forecast of the context window above the prompt, with tokens used, a sparkline of the last 12 turns and the change since the last turn.

โ›… Cloudy  38% of context  76.4k / 200k   last turns โ–โ–‚โ–‚โ–ƒโ–„โ–„โ–…โ–†  โ–ฒ +4.1k last turn

| ๐ŸŒž Clear | โ›… Cloudy | โ˜” Showers | โšก Storm | ๐Ÿšจ Compact soon | | :-: | :-: | :-: | :-: | :-: | | under 25% | under 50% | under 75% | under 90% | 90% and up |

<sub>๐Ÿ“ plugins/token-weather</sub>


MIT ยฉ Tartiner Labs

Source 2 files
hooks/register.ts 88 lines
1import { atom, read, update } from 'claude-code'
2import type { Register } from 'claude-code'
3
4import type { Naming } from '../types'
5
6const PROMPT = `Write a 3-5 word title for a coding session from the requests below, oldest first. Title what the session is about now. Reply with the title only: no quotes, no trailing punctuation.
7
8{requests}`
9
10// Added to the periodic check, so only a real change of direction renames the session.
11const KEEP_HINT = `\n\nThe current title is "{title}". Reply KEEP unless the requests have moved to a different task or area of the code. A closer wording, a related step, or more detail on the same work is not a reason to rename.`
12
13// A first prompt shorter than this ("continue", "look at this") is too thin to title from alone.
14const THIN = 40
15// The prompt that re-titles a session whose first prompt was thin.
16const RETITLE_AT = 4
17// Every this many prompts, check the title still fits the recent prompts.
18const CHECK_EVERY = 8
19const MAX_PROMPT = 800
20
21// Held by the host, so a hot reload doesn't restart the prompt count.
22const naming = atom(
23  { plugin: 'auto-session-name', key: 'naming' } as const,
24  { turns: 0, prompts: [], title: null, isDone: false } as Naming,
25)
26
27export const register: Register = (on, options) => {
28  // `default` leaves the prompt bar colour alone.
29  const color = typeof options.color === 'string' && options.color !== 'default' ? options.color : undefined
30  // /color can't run while the turn waits on UserPromptSubmit, so it waits for turn.complete.
31  let colorPending = false
32  // A /color from the person or another plugin wins over the configured one.
33  let colorChosen = false
34
35  on('classic.UserPromptSubmit', async ($, e, next) => {
36    const result = await next(e)
37    if (e.source !== undefined && e.source !== 'user') return result
38    const prompt = e.prompt.trim()
39    if (!prompt || prompt.startsWith('/')) return result
40    const state = await read($, naming)
41    if (state.isDone) return result
42    // Stop for good once -n, /rename or another hook names the session.
43    if (result.sessionTitle || (e.session_title && e.session_title !== state.title)) {
44      await update($, naming, s => ({ ...s, isDone: true }))
45      return result
46    }
47
48    const turns = state.turns + 1
49    const prompts = [...state.prompts, prompt.slice(0, MAX_PROMPT)].slice(-RETITLE_AT)
50    await update($, naming, s => ({ ...s, turns, prompts }))
51    // At RETITLE_AT the kept prompts still start with the first one.
52    const isRetitle = turns === RETITLE_AT && (prompts[0] ?? '').length < THIN
53    const isCheck = turns % CHECK_EVERY === 0
54    if (turns !== 1 && !isRetitle && !isCheck) return result
55
56    const requests = PROMPT.replace('{requests}', prompts.map(p => `<request>\n${p}\n</request>`).join('\n\n'))
57    const reply = await $.model.complete({
58      model: 'haiku',
59      prompt: isCheck && state.title !== null ? requests + KEEP_HINT.replace('{title}', state.title) : requests,
60      maxTokens: 30,
61      timeoutMs: 5000,
62    })
63    if (!reply.isAnswered) return result
64    const title = (reply.text.split('\n')[0] ?? '').replace(/^["'`]+|["'`.]+$/g, '').trim().slice(0, 60)
65    if (!title || title.toUpperCase() === 'KEEP' || title.toLowerCase() === state.title?.toLowerCase()) return result
66    await update($, naming, s => ({ ...s, title }))
67    // Colour only when the session is first named, not on a re-title.
68    if (state.title === null) colorPending = color !== undefined && !colorChosen
69    return { ...result, sessionTitle: title }
70  }).catch(($, e, next) => next(e))
71
72  on('command.run', { command: 'color' }, ($, e, next) => {
73    if (e.origin.kind !== 'plugin' || e.origin.name !== 'auto-session-name') {
74      colorChosen = true
75      colorPending = false
76    }
77    return next(e)
78  })
79
80  on('turn.complete', async ($, e, next) => {
81    const result = await next(e)
82    if (!colorPending || e.agentId !== undefined) return result
83    colorPending = false
84    $.command.run({ command: 'color', args: color }).catch(() => {})
85    return result
86  })
87}
88
types/index.d.ts 18 lines
1/** How far the mod has got naming this session. */
2export type Naming = {
3  /** Prompts from the person counted so far. */
4  turns: number
5  /** Their most recent prompts, oldest first, each trimmed. */
6  prompts: string[]
7  /** The last title this mod gave; null before it names the session. */
8  title: string | null
9  /** True once the session was named some other way, such as -n or /rename. */
10  isDone: boolean
11}
12
13declare module 'claude-code' {
14  interface PluginState {
15    'auto-session-name': { naming: Naming }
16  }
17}
18