Skip to content
Back to search

claude-work-mode

MarketplaceWorks with Claude CodeGitHub

Session work modes for Claude Code: auto, out, wrap

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked yesterday
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/danyuchn--claude-work-mode/badge.svg)](/listings/danyuchn--claude-work-mode)

HTML

<a href="/listings/danyuchn--claude-work-mode"><img src="/api/listings/danyuchn--claude-work-mode/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

/plugin install work-mode --marketplace danyuchn/claude-work-mode

Answer `y` to add the marketplace, then pick a scope. Optional gates:

/plugin install work-mode-gates --marketplace danyuchn/claude-work-mode

Requirements: Claude Code with function-hook plugins (2.1.314 or later). The gates need `bash`, `jq`, `git` and `python3`.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 17 lines
  1. {
  2. "name": "claude-work-mode",
  3. "owner": { "name": "Dustin Yuchen Teng" },
  4. "description": "Session work modes for Claude Code: auto, out, wrap",
  5. "plugins": [
  6. {
  7. "name": "work-mode",
  8. "source": "./plugins/work-mode",
  9. "description": "/work-mode auto | out | wrap | off, plus a delegation nudge"
  10. },
  11. {
  12. "name": "work-mode-gates",
  13. "source": "./plugins/work-mode-gates",
  14. "description": "Optional PreToolUse and Stop gates that read the work-mode state"
  15. }
  16. ]
  17. }
README.md · README · 110 lines
  1. # claude-work-mode
  2. [繁體中文](README.zh-TW.md)
  3. Session work modes for [Claude Code](https://claude.com/claude-code), switched with one slash command:
  4. | Mode | What the model is told |
  5. | --- | --- |
  6. | `auto` | Do not stop to ask about internal, reversible steps (local files, local commits, tests). Hard stops (outgoing messages, installs, secrets, unrecoverable deletes, payments, permission changes, production changes) go to a pending list reported once at the end. Calls that will raise a confirmation prompt are run last, back to back. |
  7. | `out` | Delegate batch work a checker or spot check can verify (extraction, classification, summaries, reviews) to a background subagent or an external CLI; the main thread verifies. A one-time nudge fires when the main thread has read a lot of raw output in one turn without delegating, and past that point further reads are refused until the model delegates or declares in one line why it reads on (the read gate, below). |
  8. | `wrap` | Converge: open no new branches, finish what is open, list only new or changed decisions, each with a label and a recommendation. |
  9. | `off` | Back to normal. |
  10. Modes are per session, combine freely (`/work-mode auto wrap`), and `out wrap` together delegates only the work already open: delegated jobs count as open until their results are verified, so wrap's close waits for them. A bare `/work-mode` opens a multi-select picker. The mode text reaches the model once (with the next tool result or prompt) and again only after a compaction or resume, so it does not bloat every turn; a one-line reminder rides with every eighth prompt (`reminderEveryTurns`) so a long session does not drift off the modes.
  11. ### The read gate (`out`)
  12. A reminder alone is easy to read past, so `out` also changes the default. Once the main thread has read `nudgeThresholdChars` of raw output in one turn with nothing delegated, the next `Read`, `Grep` or reader `Bash` call (`cat`, `sed`, `jq`, `grep`...) is refused with a how-to. The model then either delegates (any call matching `commandPattern`, or an Agent call when `subagentsDelegate` is on) or runs a no-op Bash declaring why it reads inline:
  13. ```
  14. : # work-mode: inline the file is being edited next
  15. ```
  16. Reads then pass for the rest of the turn, and the reason is appended to `~/.claude/state/tempo-inline/<session_id>.jsonl` for the next review. `WebFetch` counts as reading too. With `subagentsDelegate: false`, an Agent call is refused the same way until the prompt opens with `why-claude: <reason>` (edits, MCP or credentials, judgement, context already read here); the reason is logged. Paths matching `dispatch.corpusPattern` (transcripts, dumps, logs) are refused on their first read, before any count. Subagents are never gated. `dispatch.readGate: false` turns the gate off and keeps the nudge.
  17. ## Demo (60s Walkthrough)
  18. [![Claude Work Mode Demo](promo/demo-poster-en.png)](promo/claude-work-mode-demo-en.mp4)
  19. > [!TIP]
  20. > Click the preview above to play the 60-second walkthrough video demonstrating behavioral changes across all three modes.
  21. ## Install
  22. ```
  23. /plugin install work-mode --marketplace danyuchn/claude-work-mode
  24. ```
  25. Answer `y` to add the marketplace, then pick a scope. Optional gates:
  26. ```
  27. /plugin install work-mode-gates --marketplace danyuchn/claude-work-mode
  28. ```
  29. Requirements: Claude Code with function-hook plugins (2.1.314 or later). The gates need `bash`, `jq`, `git` and `python3`.
  30. ## The optional gates (`work-mode-gates`)
  31. The modes are written to `~/.claude/state/tempo/<session_id>` so shell hooks can read them. `hooks/lib/tempo-auto.sh` gives a gate two helpers: `tempo_auto_on "$INPUT"` and `tempo_deny "<reason>"`. Under `auto`, a gate that would ask denies instead, with a reason telling the model what to do, so work continues without a prompt. The plugin ships three gates:
  32. | Gate | Event | Normally | Under `auto` |
  33. | --- | --- | --- | --- |
  34. | `scratch-doc-guard.sh` | PreToolUse `Write` | asks before creating a new `SUMMARY*/REPORT*/NOTES*/FINDINGS*/ANALYSIS*.md` | denies: update the existing doc, use a scratch dir, or answer in the reply |
  35. | `git-safe-commit-gate.sh` | PreToolUse `Bash` | asks on `git commit` with paths (with or without `--`) and on `git add <file>...` when a file already had unstaged edits | denies: use `git add -p`, then a plain `git commit` |
  36. | `decision-label-guard.py` | Stop | blocks a reply whose decisions section holds an unlabeled item, or a tradeoff item that does not state what each side gains | under `auto`, also blocks a reply whose closing lines offer to do something and ask first ("Shall I go ahead and...?", "say the word and I'll..."): an internal step is done, a hard stop goes on the pending list as a labeled item. Under `wrap`, also blocks a decisions section whose every item was already shown unchanged in one of the last six replies (read from the transcript tail), except in a final report or when asked to relist |
  37. Use `tempo-auto.sh` in your own gates for anything you want converted. Keep real hard stops (secrets, force pushes, deploys) out of it: they should ask in every mode.
  38. ## Configuration (optional)
  39. Everything works with no config. Language follows, in order: `WORK_MODE_LOCALE`, the Claude Code `language` setting (anything mentioning Chinese picks Traditional Chinese), then `LC_ALL` / `LANG`; English otherwise.
  40. To personalise, create `~/.config/work-mode/config.json` (or point `WORK_MODE_CONFIG` at a file). See [`examples/config.example.json`](examples/config.example.json). Every field is optional:
  41. | Field | Default | Meaning |
  42. | --- | --- | --- |
  43. | `locale` | detected | `en` or `zh-TW` |
  44. | `userName` / `pronouns` | `the user` / `they` | how the mode texts refer to you (`they`, `he`, `she`) |
  45. | `autonomous.extraRules` | `[]` | extra lines for the `auto` text |
  46. | `dispatch.pickerHint` | `subagents / external CLI` | shown in the picker and the switch reply |
  47. | `dispatch.instructions` | built in | replaces the whole `out` text, one line per entry |
  48. | `dispatch.commandPattern` | `codex exec`, `gemini`, `claude -p` | a Bash command matching this regex counts as delegating |
  49. | `dispatch.nudgeThresholdChars` | `20000` | raw output read before the nudge fires (env `DISPATCH_NUDGE_CHARS` overrides) |
  50. | `dispatch.nudgeTemplate` | built in | nudge text; `{chars}` is filled in |
  51. | `dispatch.readGate` | `true` | past the nudge threshold, reads are refused until the model delegates or declares why it reads on |
  52. | `dispatch.corpusPattern` | none | regex of paths that are batch material: their first read is refused under `out` |
  53. | `dispatch.gateTemplate` | built in | the gate's refusal text; `{chars}` and `{hint}` are filled in |
  54. | `reminderEveryTurns` | `8` | every N prompts while a mode is on, a one-line reminder of the modes; `0` turns it off |
  55. | `dispatch.subagentsDelegate` | `true` | `false` when Claude subagents spend the same quota you want to save: spawning one no longer counts as delegating, and what they read counts toward the nudge (shown to the main thread) |
  56. | `dispatch.quotaFile` / `poolRouting` | none | optional quota table (see below) |
  57. | `converge.sectionHeading` | `Decisions Needed` / `待你決定` | heading for decision items |
  58. | `converge.enforcement` | `block` | `next-turn` lets a reply with label or repost slips through and hands the note to the model with the next prompt, so format fixes cost no extra turn (the auto-mode offer check always blocks) |
  59. | `converge.decisionLabels` / `tradeoffLabel` | `outbound payment delete permission tradeoff` | labels each decision must start with |
  60. | `converge.autoCloseCommand` | `null` | a command the model runs on its own when nothing is open, e.g. a session-closing skill |
  61. The decision-label gate reads the same file for its heading and labels; without one it accepts both the English and the Chinese label sets.
  62. ### Quota-aware routing
  63. If you track usage of external model pools, point `dispatch.quotaFile` at a JSON array like
  64. `[{"pool":"agy","gemini_5h_used":40,"gemini_7d_used":12,"route":"open"},{"pool":"codex","5h_used":97,"7d_used":15,"route":"floor_5h","route_used":97,"route_reset_ts":1767225600,"route_reset_in":"0h45m"}]`.
  65. With `out` on, the model then gets one line saying which pool is past its floor, worded by `poolRouting`, and it is repeated only when the table changes (reset times are shown in whole hours or days, so it changes at most hourly).
  66. The line also says which pool to spend first: among the open pools with a current weekly reading (`7d_reset_ts`, `gemini_7d_reset_ts` or `period_reset_ts`) and under 90% used, the one furthest behind its own clock, i.e. the lowest percent used minus percent of the week already gone (the usual over-pace rule), because its quota is the likeliest to expire unused (`poolRouting.prefer`, with `{pool}`, `{used}`, `{reset}` and `{pace}`). A row named `claude-sub` is the main model's own quota and ranks with the rest; when it comes first the line uses `poolRouting.claudeSoon` instead, meant for sending the batch to a built-in subagent, and it stays the last fallback when the other pools fail.
  67. ## Embedding in another mod
  68. `tempo.ts` exports `setTempoStatusSink(label => line)`. A mod that joins several parts into one status line can register these hooks itself and pass a function that takes the work-mode label and returns the whole line to show.
  69. ## Development
  70. ```
  71. ./check.sh
  72. ```
  73. type-checks the plugin, validates the marketplace and both plugins, and runs the plugin tests, the decision-label self-test and the gate tests. It needs `tsc` and the Claude Code API types (written when the plugin-authoring skill loads; or set `CLAUDE_CODE_TYPES` to a `claude-code.d.ts`).
  74. ## License
  75. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.