✳ClaudeModsClaude Code 模組目錄
☰
● 0 人在線上 · 瀏覽 0 次
+ 提交作品
← 返回作品集
GitHub 儲存庫 · 多代理與協作 / Git 與程式碼審查 / 儀表板與 HUD / 提示詞與輸入強化 / 工具與整合 / 工作流程與 CI

CodeCraft:Minecraft 風格 Claude Code HUD

CodeCraft 是一個 Minecraft 風格的 Claude Code HUD 外掛:心形代表剩餘上下文、護甲代表測試/提交/推送等安全網、經驗條只獎勵驗證過的工作,對話像遊戲聊天室,並有 60 個跨工作階段保存的成就。

mmkpvishnu@mkpvishnu
CodeCraft:Minecraft 風格 Claude Code HUD圖片1
已翻譯

關於這個 mod

CodeCraft 是一個 Minecraft 風格的 Claude Code HUD 外掛。提示列上方依次顯示護甲、心形(剩餘上下文視窗,過低時提示 /compact)、右側食物(五小時用量剩餘)、下方經驗條(綠測試、紅轉綠、綠測試下提交才給經驗,普通工具呼叫不給)以及回合執行時顯示的快捷欄。快捷欄按工具類型映射物品:鎬=搜尋、書=讀取檔案、磚=編輯寫入檔案、紅石=shell、指南針=網頁搜尋、綠寶石=子智慧代理、附魔書=技能、儲物箱=MCP 工具、紙=待辦、石頭=其他;執行超過 5 秒的 shell 命令會顯示 boss bar。對話渲染成遊戲聊天:CODECRAFT 標題、玩家頭像、工具呼叫灰字、失敗變紅並給死亡訊息、技能與 MCP 帶附魔標記、成就按遊戲風格播報,頁尾把權限模式顯示為遊戲模式(Survival/Creative/Adventure/Spectator/Hardcore)。共 60 個成就,分五個分頁(Story、Nether、The End、Adventure、Husbandry),跨工作階段保存,6 個隱藏;/advancements 開啟成就樹介面(1-5 切換分頁、n/p 移動、金色已獲得/石色可獲取/深色鎖定,方塊=任務、圓角=目標、尖刺=挑戰並給額外經驗),/inventory 以文字印出等級、驗證狀態、護甲、編輯檔案與已獲成就。圖示為遊戲原生解析度精靈圖。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

/plugin marketplace add mkpishnu/claude-mods
/plugin install codecraft@claude-mods
原文 / README

CodeCraft

A Minecraft-inspired HUD for Claude Code. The hearts are your context window, the armor is how safe your work is, the XP bar fills only for verified work, and the conversation reads like in-game chat. Each piece of the screen shows something real about the session, so you can read the state of your work the way you read a game screen.

The HUD icons, hotbar items, player heads and advancement icons

Not an official Minecraft product. Not approved by or associated with Mojang or Microsoft.

Install

You need Claude Code 2.1.288 or later. In Claude Code, run:

/plugin marketplace add mkpvishnu/claude-mods
/plugin install codecraft@claude-mods

Start a new session and the HUD appears above the prompt. Nothing else is needed. The status line is an optional extra, described below.

The HUD

The band above the prompt is laid out like the game's: armor over the hearts, food on the right, the XP bar underneath, and the hotbar while a turn runs.

| Element | What it shows | |---|---| | Hearts | Context window left. Ten full hearts is a fresh session. When health runs low, a warning suggests /compact. | | Food | Your five-hour usage limit left. | | Armor | Safety nets, out of 10 points: tests green since your last edit (4), work committed (3), commits pushed (3). Shown only inside a git repository. | | Level and XP bar | Experience for verified work: green test runs, turning a red run green, commits made with the tests green. Plain tool calls earn nothing. Resets each session. | | Hotbar | While a turn runs, one slot per tool used in that turn with its call count. The tool in hand has a white frame. Subagents show as villagers. | | Boss bar | A shell command that has run for 5 seconds, draining toward its timeout. |

Each kind of tool has its own item in the hotbar:

| Item | Tool | |---|---| | Pickaxe | Searching code and finding files | | Book | Reading files | | Bricks | Editing and writing files | | Redstone | Shell commands | | Compass | Web search and fetch | | Emerald | Subagents | | Enchanted book | Skills | | Chest | MCP tools | | Paper | The to-do list | | Stone | Anything else |

The chat

The conversation reads like a game server's chat:

  • The CODECRAFT title, in stone letters on a strip of grass, sits above your first prompt, with a splash line and <you> joined the game.
  • Your prompts appear under <your name> beside the player's head, and replies under <Claude> beside Claude's block head.
  • Tool calls are short gray lines such as [Claude: ran pytest -q] or [Claude: edited src/app.py]. A failed call turns red and gets a death message.
  • Skill and MCP tool lines carry an enchantment mark (✦).
  • Advancements are announced the way the game does it: <your name> has made the advancement [Stone Age].
  • The footer names the permission mode as a game mode: Survival (default), Creative (accept edits), Adventure (auto), Spectator (plan) and Hardcore (bypass permissions).

Advancements

There are 60 advancements across five tabs modelled on the game's, earned by real work and saved across sessions. Six are hidden until you earn them.

| Tab | What it covers | Examples | |---|---|---| | Story | Building and verifying | Stone Age (edit a file), Diamonds! (commit with the tests green), A Furious Cocktail (tests, checks and build all green) | | Nether | Subagents and git history | We Need to Go Deeper (send out a subagent), Hidden in the Depths (find a bad commit with git bisect) | | The End | Pull requests and releases | The End? (open a pull request), Free the End (merge one), The City at the End of the Game (cut a release) | | Adventure | Testing and exploring | Monster Hunter (turn a red test run green), Bullseye (green on the first run 10 times in a row), Is It a Bird? (search the web) | | Husbandry | Habits over days | A Seedy Place (write a new test file and see it pass), Homesteader (work 7 days in a row), Old Growth (30 days in a row) |

Run /advancements to open the advancements screen. Each tab is drawn as the game's tree, with every advancement joined by a line to the one it comes after:

The Story and Adventure tabs of the advancements screen

  • Frame colour: gold means earned, stone means open, and dark means locked until the advancement before it is earned.
  • Frame shape: square for a task, rounded for a goal, spiked for a challenge. Challenges also give bonus XP.
  • Moving around: keys 1 to 5 switch tabs, n and p move the white marker, and the line above the tree says what the marked advancement asks for. Pointing at an icon with the mouse shows that one instead.

/inventory prints your level, verification state, armor, edited files and earned advancements as text.

Terminals

The icons are image sprites at the game's own resolution. They need a terminal that can show images, such as kitty or Ghostty. On other terminals with true colour the mod draws the same things as block art made of text, and on a narrow terminal it falls back to plain symbols. Nothing needs configuring: the mod checks the terminal at the start of each session.

Status line

The mod ships a status line (scripts/statusline.sh, needs jq) showing the directory, git branch and changes, model, exact context and usage figures, and the time.

A mod cannot replace your status line by itself, so your own status line script has to hand over to it. Put this at the top of your script, right after it reads its input into $input:

if [ -n "$CODECRAFT_STATUSLINE" ] && [ -x "$CODECRAFT_STATUSLINE" ]; then
    printf '%s' "$input" | "$CODECRAFT_STATUSLINE"
    exit
fi

The mod sets CODECRAFT_STATUSLINE only in sessions where it is loaded, so your own status line comes back when the mod is off. Without this step everything else still works.

Privacy and what it runs

The mod makes no network requests and sends nothing anywhere. It never changes or blocks a tool call; it only watches them to spot test runs, commits and failures. Outside of drawing, it does four things:

  • Runs read-only git commands in your working directory to find the repository root and whether your work is committed and pushed. This feeds the armor bar.
  • Saves your levels and advancements in the plugin's own store file under ~/.claude/plugins/store/.
  • Reads the USER environment variable for the name on your chat lines, and TERM, TERM_PROGRAM and KITTY_WINDOW_ID to tell whether the terminal can show images.
  • Sets the CODECRAFT_STATUSLINE environment variable for the session, used by the status line step above.

Develop

Clone the repository and run Claude Code with the mod loaded from your checkout. It reloads when you save a file.

git clone https://github.com/mkpvishnu/claude-mods
cd claude-mods
claude --plugin-dir ./codecraft

| Task | Command | |---|---| | Type check | npx -p typescript@5 tsc -p codecraft | | Validate the plugin | claude plugin validate --strict ./codecraft | | Run the tests | cd codecraft && claude plugin test | | Redraw the sprites | python3 codecraft/tools/sprites.py (needs Pillow) |

The code is in hooks/: register.tsx holds the hooks and the drawing, and lore.ts holds the pure helpers such as the advancement list, levels, chat wording and the advancement tree layout. The sprites in assets/ are generated from the letter art in tools/sprites.py, so edit that file and rerun it to change one.

License

MIT

查看原始來源 ↗

更多類似作品