codbash
CLAUDE.md270 starsChanged 4 months agoMITView on GitHub
Codbash (codbash-app on npm) is a zero-dependency Node.js browser dashboard for managing AI coding agent sessions. Supports 7 agents: Claude Code, Codex, Cursor, OpenCode, Kiro CLI, Kilo CLI, Copilot Chat. Single npm i -g codbash-app && codbash run opens a local web UI. It ships in two channels from one codebase: the npm CLI (browser UI) and a signed + notarized macOS desktop app (Electron shell in desktop/ wrapping the unmodified server). Latest release: 7.14.7. The dashboard has grown into…
- Installs packages
- Commits and pushes
The file
We split this CLAUDE.md into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 133
mainbranch is protected: All changes go through feature branches + pull requests. - Very specific: line 156
Commit messages: Use conventional format: feat:, fix:, chore:, docs:, perf:.
- Distinctive: line 160
Keep PRs small and focused — one feature/fix per PR
- Distinctive: line 173
Before bumping minor/major, ask: "Does this really warrant a version bump, or can it go in the next patch?"
≈ “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
Codbash
What is this
Codbash (codbash-app on npm) is a zero-dependency Node.js browser dashboard for managing AI coding agent sessions. Supports 7 agents: Claude Code, Codex, Cursor, OpenCode, Kiro CLI, Kilo CLI, Copilot Chat. Single npm i -g codbash-app && codbash run opens a local web UI.
It ships in two channels from one codebase: the npm CLI (browser UI) and a signed + notarized macOS desktop app (Electron shell in desktop/ wrapping the unmodified server). Latest release: 7.14.7.
The dashboard has grown into a "super-app": an Overview landing view (headline stats + recent sessions + live terminals grouped by project) and an in-browser Workspace / Terminal (xterm.js + optional @lydell/node-pty over a hand-rolled WebSocket) with tabs, 1–4 splits, saved layouts, and per-project spawning.
Project structure
bin/cli.js CLI entry point (run/list/stats/search/show/handoff/convert/export/import/update/restart/stop)
src/
server.js HTTP server + all API routes + terminal WebSocket
data.js Session loading, search index, cost calculation, active detection for all agents
terminals.js Native terminal detection (iTerm2/Terminal.app/Warp/Kitty/cmux) + launch/focus
terminal.js Browser-terminal pty session (spawn/resolveCwd) for the Workspace view
workspace-layouts.js Saved Workspace layouts (panes: cmd/prefill/cwd) persisted to disk
workspace-commands.js Saved Workspace quick-commands
shell-path.js Repairs a stripped PATH from the login shell (GUI-launch agent detection)
agents-detect.js Detects which agent CLIs are installed
projects.js Project launcher registry (add/list/remove)
html.js Assembles HTML by inlining CSS+JS into template
migrate.js Export/import sessions as tar.gz (merges history, never overwrites)
convert.js Cross-agent session conversion (Claude <-> Codex)
handoff.js Generate context documents for session handoff between agents
changelog.js In-app changelog data
frontend/
index.html HTML template with {{STYLES}} and {{SCRIPT}} placeholders
styles.css All CSS including dark/light/monokai themes
app.js Core frontend JS (routing, cards, delete, keyboard nav) — plain browser JS
overview.js Overview landing view (default): stats + recent sessions + live terminals
workspace.js In-browser Workspace/Terminal (xterm.js, tabs, splits, layouts, running tree)
calendar.js Calendar/heatmap sidebar + view routing
(analytics/detail/cloud/leaderboard/recommended/heatmap/sidebar-config).js
desktop/ Electron desktop app (signed + notarized macOS DMG)
main.js Electron main: spawns the unmodified server as a Node child + IPC
preload.js contextBridge -> window.codbashDesktop (isDesktop, pickFolder)
scripts/notarize.js afterSign notarization hook (keychain profile or APPLE_* env)
RELEASE.md Signed-release build/notarize runbook (READ before cutting a DMG)
docs/
README_RU.md Russian translation
README_ZH.md Chinese translation
ARCHITECTURE.md Data flow, file formats, diagramsSupported agents and data sources
| Agent | Storage | Location | Format |
| Claude Code | JSONL | ~/.claude/projects/*/, ~/.claude/history.jsonl | {type, message, timestamp} |
| Codex CLI | JSONL | ~/.codex/sessions/, ~/.codex/history.jsonl | {type: "response_item", payload} |
| Cursor | JSONL | ~/.cursor/projects/*/agent-transcripts/ | {role, message: {content}} |
| OpenCode | SQLite | ~/.local/share/opencode/opencode.db | tables: session, message, part |
| Kiro CLI | SQLite | ~/Library/Application Support/kiro-cli/data.sqlite3 | table: conversations_v2 |
| Kilo CLI | SQLite | ~/.local/share/kilo/kilo.db | tables: session, message, part, project |
| Copilot Chat | JSON/JSONL | ~/.config/Code/User/workspaceStorage/*/chatSessions/ | {version, requests: [{message, response}]} |
Key architecture decisions
- Zero dependencies for the core — dashboard/CLI use only Node.js stdlib + system
sqlite3CLI for SQLite agents. The optional browser terminal (Workspace) is the sole exception: it lazily loads@lydell/node-pty(declared inoptionalDependencies, prebuilt-only, never runs node-gyp). If it is absent the dashboard still runs and the terminal reports itself disabled. Do NOT add core dependencies. - Node >= 18 — minimum supported version
- Single process — server + static HTML in one process
- Template injection —
html.jsreads CSS/JS files and injects viasplit/join(notString.replacewhich breaks on$characters in JS code) - Project key encoding — Claude paths encoded as
path.replace(/[\/\.]/g, '-')— both slashes AND dots replaced with dashes - Search index — built in-memory on first query, cached 60 seconds. Do NOT remove the search index.
- Cost calculation — uses real
usagedata from assistant messages (input_tokens, output_tokens, cache_creation_input_tokens, cache_read_input_tokens) with per-model pricing inMODEL_PRICINGobject - Active session detection — reads Claude PID files + scans
psfor all agent processes (claude, codex, opencode, kiro-cli, cursor-agent) - Cursor sessions — always show "Open in Cursor" button, never "Focus Terminal". Check tool type BEFORE active status.
- cmux support — walks parent process chain (up to 6 levels) to detect cmux, then activates via AppleScript
- Crash-safety — every HTTP route dispatch is wrapped in try/catch → 500 (one bad session never takes down the server);
findSessionFilelooks up its index withObject.prototype.hasOwnProperty.call(...)to avoid prototype-pollution DoS; delete / bulk-delete validateSAFE_SESSION_ID - Desktop app is a thin shell —
desktop/main.jsspawns the unmodified server as a Node child and points aBrowserWindowat it. Keep the server desktop-agnostic; desktop-only capabilities are exposed throughpreload.js(window.codbashDesktop) and detected at runtime in the frontend (e.g. the native folder picker is only wired up whenwindow.codbashDesktop.pickFolderexists) - View-aware chrome —
render()stampsdocument.bodywithdata-view; the session toolbar is hidden in Overview/Workspace viabody[data-view="workspace"|"overview"] .toolbar { display:none } - Running-agents sidebar tree (persistent, in the main sidebar — not just Workspace) is built from
activeSessions, a liveps-scan-backed map (GET /api/active, polled every 5s), so a truly-exited agent simply isn't in it — no "ghost" filtering needed. It shows every currently-running agent, both inside codbash and in external native terminals, as a 3-level tree:_wsRunningTree(mode)(workspace.js) nests project → agent → sessions (mode:'project', default) or the mirror agent → project → sessions (mode:'agent') — user-toggleable via the compact segmented control in the tree header, persisted tolocalStorage['codedash-running-group']. A project+agent pair with exactly one live session collapses to a single leaf row (no redundant 1-child nesting); 2+ sessions get one leaf row each, labeled via_wsSessionLeafLabel(pane name if local and matched, else session-id prefix, else pid) so same-project/same-agent sessions read as distinct. Top-level (L1) groups are an accordion, collapsed by default —_wsRunExpanded(in-memory, resets on reload) tracks open/closed permode|groupKey;_wsToggleRunGroupflips acollapsedclass directly on the group's wrapper DOM node rather than forcing a full rebuild, and a later rebuild re-reads_wsRunExpandedso open/closed choices survive it. Because the L1 header's click means "toggle", it does NOT jump to a session — that action lives entirely on leaf rows (.ws-run-l2.ws-run-leaf/.ws-run-l3).getActiveSessions()tags each agent withlocal(true = descends from a codbash browser-pty pane, false = external); rows are colored by where they run (blue = inside codbash, orange = external; dimmed = idle, not gone). Clicking a leaf dispatches onlocal: local →jumpToWorkspacePane(found by matchingcwdagainst live panes); external →POST /api/focus(focusTerminalByPid) to raise the real window. It must NEVER spawn a blank in-app terminal as a stand-in (an empty shell isn't the agent, andclaude --continueon a live agent would fork a second instance). Seedocs/design/running-agents-external.md. - Saved layouts round-trip the full pane —
sanitizePanepreservescmd+prefill+cwd(not justcmd); dropping any of these silently loses the user's launch command on restore - No
window.promptin Electron — usecodbashPrompt()(app.js) for any text input; the native prompt is a no-op in the desktop shell - Two update paths, mutually exclusive — the npm CLI self-updates via
POST /api/update(npm i -g codbash-app@latest+ restart). The desktop app updates in-place viaelectron-updater(download-on-click → restart, driven by the frontend banner overwindow.codbashDesktop.updaterIPC andmain.js).desktop/main.jssetsCODBASH_DESKTOP=1so the server refuses/api/update(400) — runningnpm i -ginside the signed, read-only app bundle would update an unrelated global copy and the restart would land back on the bundled old version. macOS in-place update needs the.ziptarget +latest-mac.yml(Squirrel.Mac can't apply a DMG) and a signed build; on failure the banner falls back to opening the releases page (codbash:open-releases). Seedesktop/RELEASE.md§4.
API routes
GET / Dashboard HTML
GET /favicon.ico SVG favicon
GET /api/sessions All sessions (all 5 agents)
GET /api/session/:id Full session messages
GET /api/preview/:id First N messages (lightweight)
GET /api/replay/:id Messages with timestamps for replay
GET /api/cost/:id Real cost from token usage
GET /api/analytics/cost Aggregated cost analytics (supports ?from=&to= date filters)
GET /api/active Running sessions (all agents — PID, CPU, memory, status)
GET /api/terminals Available terminal apps
GET /api/git-commits Git commits in time range
GET /api/search?q= Full-text search across all sessions
GET /api/version Current + latest npm version
GET /api/changelog Changelog data
GET /api/handoff/:id Generate handoff markdown document
POST /api/launch Open session in terminal
POST /api/focus Focus terminal window by PID
POST /api/open-ide Open project in Cursor/VS Code
POST /api/convert Convert session between agents
POST /api/bulk-delete Delete multiple sessions
DELETE /api/session/:id Delete single session
GET /api/session/:id/export Download session as Markdown
# Workspace / browser terminal
WS /ws/terminal Browser-terminal pty (hand-rolled upgrade, no `ws` dep; token-gated)
GET /api/terminal/status Terminal availability + per-process WS token
GET/POST/DELETE /api/terminal/layouts[/:id] Saved Workspace layouts (panes: cmd/prefill/cwd)
GET/POST/DELETE /api/terminal/commands[/:id] Saved Workspace quick-commands
# Projects launcher
GET/POST/DELETE /api/projects/manual[/:id] Manually-added project folders
POST /api/projects/clone git clone into a project folder
# Misc (added this line)
GET /api/agents/installed Which agent CLIs are installed
GET /api/settings Read/write user settings
# (auth, cloud sync, github, leaderboard, repo-refresh route groups also exist)Important conventions
- Frontend JS is plain browser JavaScript — no modules, no build step, no ES6 imports
- CSS themes via
[data-theme="light"]and[data-theme="monokai"]attribute overrides - localStorage keys:
codedash-stars,codedash-tags,codedash-terminal,codedash-theme,codedash-layout,codedash-last-version - System messages from Codex/Kiro (AGENTS.md, permissions, exit) are filtered via
isSystemMessage() - Cursor
<user_query>wrappers are stripped inloadCursorDetail() - GUI-launch PATH repair — when the desktop app opens from Finder/Dock macOS hands it a stripped
PATH, so installed agent CLIs go undetected.src/shell-path.jsre-derivesPATHfrom the user's login shell on startup (opt out:CODBASH_NO_PATH_REPAIR=1) - Session cards carry a native-terminal launch button (resume the agent's last project session; Cursor cards open in Cursor; hidden for copilot-chat)
Git workflow
main branch is protected. All changes go through feature branches + pull requests.
# 1. Create a feature branch
git checkout -b feat/my-feature # or fix/bug-name, chore/cleanup
# 2. Make changes, commit
git add <files> && git commit -m "feat: description"
# 3. Push and create PR
git push -u origin feat/my-feature
gh pr create --title "feat: description" --body "..."
# 4. After review/approval, merge via GitHub
gh pr merge <number> --squashBranch naming:
feat/— new featuresfix/— bug fixeschore/— refactoring, docs, CIrelease/— version bumps + publish
Commit messages: Use conventional format: feat:, fix:, chore:, docs:, perf:.
PR rules:
- 1 approval required to merge into main
- Keep PRs small and focused — one feature/fix per PR
- Large PRs touching 5+ files should be split
Versioning rules
IMPORTANT: Do not bump versions aggressively.
- Patch (7.14.x): bug fixes, small CSS tweaks, typos — most changes go here
- Minor (7.x.0): new features that don't break existing functionality — new views, new CLI commands, new agent support
- Major (x.0.0): breaking changes only — changed API format, removed features, Node version bump, major rewrites
Group multiple small fixes into ONE patch release instead of publishing each fix separately. Aim for 1-3 releases per work session, not 20+.
Before bumping minor/major, ask: "Does this really warrant a version bump, or can it go in the next patch?"
Publishing
Two independent channels, one codebase. Bump the version once (in package.json, desktop/package.json, and src/changelog.js) on a release/ branch → PR → merge to main, then publish each channel.
npm CLI:
git checkout main && git pull
npm publish --access public.github/workflows/publish.yml is manual (workflow_dispatch), NOT auto-on-release — it fails early if NPM_TOKEN is missing. Never persist the npm publish token: write a transient .npmrc, publish, delete it.
macOS desktop (signed + notarized DMG) — follow desktop/RELEASE.md. Key gotchas:
- Sign with Developer ID (team A933C2TJXU); notarize via the macOS keychain profile
codbash-notary(notarize.jsreadsAPPLE_KEYCHAIN_PROFILE). Do NOT store Apple credentials in the repo (public) — keychain only. - Timestamp gotcha:
codesign --timestampignoresHTTPS_PROXY(uses the system network stack), so a corporate proxy blockstimestamp.apple.com→ "The timestamp service is not available". Build over VPN with proxy env unset (env -u HTTPS_PROXY -u HTTP_PROXY -u ALL_PROXY …). Apple's TSA also rate-limits per-IP under burst — switch VPN endpoint or wait if throttled. - electron-builder: the CLI target arg overrides the config
archarray — pass--arm64 --x64explicitly.identitymust be WITHOUT theDeveloper ID Application:prefix. - Notarize +
stapler stapleeach DMG after signing; stapling mutates the DMG, so regenerate blockmaps +latest-mac.ymlafterward.spctl -a -t openon a raw DMG is a false negative (the container isn't code-signed) — verify with a quarantined mount instead.
Package name: codbash-app, binary name: codbash (legacy alias codedash also works)
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.

