better-agent-terminal
CLAUDE.md515 starsChanged 7 months agoMITView on GitHub
- Installs packages
In this repository2 other files it gives its agents.
- AGENTS.mdAGENTS.md
- check-sdk-updatesSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
15 rules. About 0 are common, 7 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 6
Before committing, verify ALL existing features still work — not just the new changes.
- Very specific: line 7
Run the build (pnpm run compile) to confirm compilation succeeds.
- Distinctive: line 8
When modifying shared code (stores, IPC handlers, types), trace all consumers to ensure nothing breaks.
- Very specific: line 14
Use pnpm install --frozen-lockfile for reproducible installs.
- Very specific: line 15
Use pnpm exec <tool> instead of npx <tool>.
- Very specific: line 16
Keep pnpm-lock.yaml committed and do not reintroduce package-lock.json.
- Very specific: line 28
Frontend (renderer): Use window.batAppAPI.debug.log(...) instead of console.log().
- Distinctive: line 29
Backend (Tauri/Rust): Use the project Rust logging/debug helpers so logs are persisted.
- Very specific: line 30
Do NOT use console.log() for debugging — use the logger so logs are persisted and visible in the log file.
- Very specific: line 49
Use flushSync from react-dom for Agent/Task tool state changes (setMessages in onToolUse and onToolResult) to prevent rendering delays from …
- Very specific: line 50
Do NOT use flushSync for regular tool calls — only for state changes that affect the active tasks bar visibility.
- Distinctive: line 62
All other remote actions must be sent to the host, and the client should render the host response or host broadcast reflection.
- Distinctive: line 63
When a remote client requests a mutation, the host applies or rejects it first, then returns the result and broadcasts canonical …
- Distinctive: line 64
Avoid client-side optimistic final state for remote workflows.
- Distinctive: line 68
Do NOT auto-create a branch before committing.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md - Project Guidelines
No Regressions Policy
- NEVER break existing features when implementing new ones.
- Before committing, verify ALL existing features still work — not just the new changes.
- Run the build (
pnpm run compile) to confirm compilation succeeds. - When modifying shared code (stores, IPC handlers, types), trace all consumers to ensure nothing breaks.
Package Management
- This repository uses pnpm. Do not use
npm install,npm ci, ornpxfor project workflows. - The pinned package manager is declared in
package.json(packageManager:pnpm@10.33.2). - Use
pnpm install --frozen-lockfilefor reproducible installs. - Use
pnpm exec <tool>instead ofnpx <tool>. - Keep
pnpm-lock.yamlcommitted and do not reintroducepackage-lock.json. - pnpm v10 blocks dependency lifecycle scripts unless explicitly allowed; required build-script packages are listed under
pnpm.onlyBuiltDependenciesinpackage.json. - Standard verification commands:
pnpm exec tsc --noEmit --pretty falsepnpm run compilepnpm run test:sidecarpnpm run check:tauri-rustpnpm run test:tauri-rust- For local packaging verification without macOS signing/notarization:
pnpm run tauri:build:debug
Logging
- Frontend (renderer): Use
window.batAppAPI.debug.log(...)instead ofconsole.log(). This sends logs to the Tauri host logger, which writes to disk. - Backend (Tauri/Rust): Use the project Rust logging/debug helpers so logs are persisted.
- Do NOT use
console.log()for debugging — use the logger so logs are persisted and visible in the log file. - Log file location:
- Tauri writes renderer/Rust logs to
<app-data>/logs/debug.logand sidecar logs to<app-data>/logs/sidecar.log. - macOS fresh Tauri install:
~/Library/Application Support/com.tonyq.better-agent-terminal/logs/debug.log - macOS existing Electron migration:
~/Library/Application Support/BetterAgentTerminal/logs/debug.log - Windows fresh Tauri install:
%APPDATA%\com.tonyq.better-agent-terminal\logs\debug.log - Linux fresh Tauri install:
~/.local/share/com.tonyq.better-agent-terminal/logs/debug.logor the platform-resolved Tauri app data dir. BAT_TAURI_DATA_DIRoverrides the app data directory in dev/tests.- In the app, Settings → Open Logs Folder opens the active logs directory.
- Tauri writes renderer/Rust logs to
Sub-agent / Active Tasks Tracking
- The Claude Agent SDK does NOT reliably emit
task_started/task_progress/task_notificationsystem messages. - We track Agent/Task tools from
tool_useblocks directly insession.activeTasks(inclaude-agent-manager.ts). stopTask()falls back to usingtoolUseIdastask_idwhen no mapping exists.- Tool results for Agent/Task must clean up
activeTasksentries.
React Rendering
- Use
flushSyncfromreact-domfor Agent/Task tool state changes (setMessagesinonToolUseandonToolResult) to prevent rendering delays from React 18 batching during streaming. - Do NOT use
flushSyncfor regular tool calls — only for state changes that affect the active tasks bar visibility.
Status Line
- Our status line implementation is superior to external alternatives (e.g., ccstatusline). Do not replace it.
- 15 configurable items (see
STATUSLINE_ITEMSinrenderer/src/types/index.ts) with custom colors, zone alignment, and template-based config. - Usage polling: Chrome session key (primary, lenient rate limits) → OAuth fallback (strict rate limits).
Remote State Ownership
- Remote mode is host-owned by default. Except for purely local presentation state, clients do not own remote state.
- Message filters are client-only presentation state and may stay local because they do not change host data.
- All other remote actions must be sent to the host, and the client should render the host response or host broadcast reflection.
- When a remote client requests a mutation, the host applies or rejects it first, then returns the result and broadcasts canonical shared-state changes to every connected client.
- Avoid client-side optimistic final state for remote workflows. Loading/pending UI is fine while waiting for host confirmation.
Git Workflow
- Do NOT auto-create a branch before committing. Commit directly to the current branch (including
main) unless the user explicitly asks for a branch or PR. This overrides the default "branch first on the default branch" behavior. - Still only commit/push when the user asks.
Release
package.json與src-tauri/tauri.conf.json的 committed version 固定維持0.0.1-dev。- 發版時只建立 / push tag;不要 commit release version bump。GitHub Actions 會從 tag 注入實際 build 版本。
- 說法對應:下面每一組都是指同一個動作,直接執行,不要反問要哪一種。
- 「發布測試版」/「測試版」/「預覽版」/「發 pre」/
release a pre tag version/release new pre tag version→ 預覽版流程 - 「發布正式版」/「正式版」/「發正式」/
release a tag version/release new tag version→ 正式版流程
- 「發布測試版」/「測試版」/「預覽版」/「發 pre」/
- 正式版: 建立 tag 並 push
- 最新 tag 是正式版時:遞增 patch 版號。例:
v2.2.27→v2.2.28 - 最新 tag 是
-pre時:直接用它的版號,不要再遞增。例:v2.2.28-pre.3→v2.2.28-pre.N是「X 的預覽」,所以轉正式就是 X 本身。遞增會跳號並讓那些預覽變成從未發布過的版本。
- 最新 tag 是正式版時:遞增 patch 版號。例:
- 預覽版:
release new pre tag version→ 基於最新 tag 遞增 patch 版號,加-pre.1後綴- 例:目前
v2.2.27→ 建立v2.2.28-pre.1 - 若已有
v2.2.28-pre.1→ 建立v2.2.28-pre.2
- 例:目前
- Tag 含
-pre時 GitHub Release 自動標為 Pre-release,不更新 Homebrew tap - Tag 不含
-pre時為正式版,更新 Homebrew tap
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

