[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110593":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":23,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":14,"starSnapshotCount":14,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},110593,"claude-work-mode","danyuchn\u002Fclaude-work-mode","danyuchn","Session work modes for Claude Code: \u002Fwork-mode auto | out | wrap, with optional gates",null,"TypeScript",178,12,75,0,1,104,53.84,"MIT License",false,"main",true,[],"2026-11-16 17:38:51","2026-11-20 15:38:39","# claude-work-mode\n\n[繁體中文](README.zh-TW.md)\n\nSession work modes for [Claude Code](https:\u002F\u002Fclaude.com\u002Fclaude-code), switched with one slash command:\n\n| Mode | What the model is told |\n| --- | --- |\n| `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. |\n| `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. |\n| `wrap` | Converge: open no new branches, finish what is open, list only new or changed decisions, each with a label and a recommendation. |\n| `off` | Back to normal. |\n\nModes are per session, combine freely (`\u002Fwork-mode auto wrap`), and `wrap` wins over `out` when both are typed. A bare `\u002Fwork-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.\n\n## Demo (60s Walkthrough)\n\n[![Claude Work Mode Demo](promo\u002Fdemo-poster-en.png)](promo\u002Fclaude-work-mode-demo-en.mp4)\n\n> [!TIP]\n> Click the preview above to play the 60-second walkthrough video demonstrating behavioral changes across all three modes.\n\n## Install\n\n```\n\u002Fplugin install work-mode --marketplace danyuchn\u002Fclaude-work-mode\n```\n\nAnswer `y` to add the marketplace, then pick a scope. Optional gates:\n\n```\n\u002Fplugin install work-mode-gates --marketplace danyuchn\u002Fclaude-work-mode\n```\n\nRequirements: Claude Code with function-hook plugins (2.1.314 or later). The gates need `bash`, `jq`, `git` and `python3`.\n\n## The optional gates (`work-mode-gates`)\n\nThe modes are written to `~\u002F.claude\u002Fstate\u002Ftempo\u002F\u003Csession_id>` so shell hooks can read them. `hooks\u002Flib\u002Ftempo-auto.sh` gives a gate two helpers: `tempo_auto_on \"$INPUT\"` and `tempo_deny \"\u003Creason>\"`. 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:\n\n| Gate | Event | Normally | Under `auto` |\n| --- | --- | --- | --- |\n| `scratch-doc-guard.sh` | PreToolUse `Write` | asks before creating a new `SUMMARY*\u002FREPORT*\u002FNOTES*\u002FFINDINGS*\u002FANALYSIS*.md` | denies: update the existing doc, use a scratch dir, or answer in the reply |\n| `git-safe-commit-gate.sh` | PreToolUse `Bash` | asks on `git commit` with paths (with or without `--`) and on `git add \u003Cfile>...` when a file already had unstaged edits | denies: use `git add -p`, then a plain `git commit` |\n| `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 | same |\n\nUse `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.\n\n## Configuration (optional)\n\nEverything 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` \u002F `LANG`; English otherwise.\n\nTo personalise, create `~\u002F.config\u002Fwork-mode\u002Fconfig.json` (or point `WORK_MODE_CONFIG` at a file). See [`examples\u002Fconfig.example.json`](examples\u002Fconfig.example.json). Every field is optional:\n\n| Field | Default | Meaning |\n| --- | --- | --- |\n| `locale` | detected | `en` or `zh-TW` |\n| `userName` \u002F `pronouns` | `the user` \u002F `they` | how the mode texts refer to you (`they`, `he`, `she`) |\n| `autonomous.extraRules` | `[]` | extra lines for the `auto` text |\n| `dispatch.pickerHint` | `subagents \u002F external CLI` | shown in the picker and the switch reply |\n| `dispatch.instructions` | built in | replaces the whole `out` text, one line per entry |\n| `dispatch.commandPattern` | `codex exec`, `gemini`, `claude -p` | a Bash command matching this regex counts as delegating |\n| `dispatch.nudgeThresholdChars` | `20000` | raw output read before the nudge fires (env `DISPATCH_NUDGE_CHARS` overrides) |\n| `dispatch.nudgeTemplate` | built in | nudge text; `{chars}` is filled in |\n| `dispatch.quotaFile` \u002F `poolRouting` | none | optional quota table (see below) |\n| `converge.sectionHeading` | `Decisions Needed` \u002F `待你決定` | heading for decision items |\n| `converge.decisionLabels` \u002F `tradeoffLabel` | `outbound payment delete permission tradeoff` | labels each decision must start with |\n| `converge.autoCloseCommand` | `null` | a command the model runs on its own when nothing is open, e.g. a session-closing skill |\n\nThe decision-label gate reads the same file for its heading and labels; without one it accepts both the English and the Chinese label sets.\n\n### Quota-aware routing\n\nIf you track usage of external model pools, point `dispatch.quotaFile` at a JSON array like\n`[{\"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\"}]`.\nWith `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.\n\n## Embedding in another mod\n\n`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.\n\n## Development\n\n```\n.\u002Fcheck.sh\n```\n\ntype-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`).\n\n## License\n\nMIT\n","这是一个为 Claude Code 设计的会话工作模式插件，通过 `\u002Fwork-mode` 命令动态切换 AI 编程助手的行为策略。支持 auto（自动处理可逆操作、延迟硬停操作）、out（委托批处理任务并由主流程校验）、wrap（收敛式决策、关闭分支、结构化输出）三种核心模式，可组合使用且具备轻量状态管理机制。插件采用 TypeScript 开发，依赖 Claude Code 2.1.314+ 的函数钩子能力，并可选配基于 shell\u002FPython 的执行门控（gates），在不中断会话的前提下实现细粒度安全约束。适用于需要提升代码协作效率、增强本地开发可控性及保障关键操作安全性的工程师与团队。",2,"2026-11-24 04:39:24","CREATED_QUERY"]