ClaudeMods
☰
EN
● 0 online · Views 0 times
SponsorsSubmit a project
GitHub repositories · by marcsstevenson

better-recap

A Claude Code plugin that replaces /recap with a structured recap (Goal / Done / Open / Next) rendered as a card with session name, model and context-use bar.

marcsstevenson@marcsstevenson

marcsstevenson/claude-mods/tree/main/src/better-recap

Translated

About this mod

claude-mods is a collection of Claude Code plugins built with the engine's hooks API in TypeScript. The better-recap mod replaces the /recap command with a structured summary (Goal / Done / Open / Next) drawn as a card headed by the session name, model and a context-use bar, and also prefixes the automatic "recap:" line shown after being away with the same facts. Each mod lives in its own folder under src/ and can be loaded for a single session via claude --plugin-dir path/to/claude-mods/src/better-recap, or for every session by listing it in CLAUDE_CODE_PLUGIN_DIRS in the env block of ~/.claude/settings.json. Loaded folders are watched and reload on file save. Mods are validated with claude plugin validate, tested with claude plugin test, and type-checked with npx tsc.

Installation

Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.

claude plugin marketplace add marcsstevenson/claude-mods
claude plugin install better-recap
Original text / README

claude-mods

Mods for Claude Code: plugins of function hooks that change what Claude Code does and draws, written in TypeScript against the engine's hooks API (early access, Claude Code 2.1.289+).

Mods

| Mod | What it does | | --- | --- | | better-recap | Replaces /recap with a structured recap (Goal / Done / Open / Next) drawn as a card headed by the session name, the model and a context-use bar. Prefixes the automatic "recap:" line shown after being away with the same facts. |

Using a mod

Each folder under src/ is a self-contained mod. Load one for a single session:

claude --plugin-dir path/to/claude-mods/src/better-recap

Or load it in every session by naming it in CLAUDE_CODE_PLUGIN_DIRS, in the env block of ~/.claude/settings.json. Separate several folders with the platform's path separator (; on Windows, : elsewhere):

{
  "env": {
    "CLAUDE_CODE_PLUGIN_DIRS": "D:\\git\\claude-mods\\src\\better-recap"
  }
}

A folder loaded either way is watched: saving a file reloads the mod.

Layout of a mod

src/<mod>/
  .claude-plugin/plugin.json   manifest: name, version, description, types
  hooks/hooks.json             { "modules": ["./register.tsx"] }
  hooks/register.tsx           the hooks module: export const register: Register = on => { ... }
  hooks/*.test.ts              tests, run by `claude plugin test`
  types/index.d.ts             the mod's $.state contract, when it keeps state
  tsconfig.json                extends the types Claude Code lays in .claude-plugin/types/

.claude-plugin/types/ is written by Claude Code each time it loads the mod and is not committed.

Checking a mod

claude plugin validate src/<mod>   # what the engine would load or refuse
claude plugin test src/<mod>       # runs hooks/*.test.ts against the engine
npx tsc -p src/<mod>               # type-check, once the mod has loaded once

Similar projects