claudepot-app
AGENTS.md122 starsChanged 4 months agoISCView on GitHub
Control center for Claude Code and Claude Desktop. Tauri 2 + Rust + React: accounts, projects, sessions, API keys, third-party providers, agents, memory files, usage and cost, updates, notifications and a LAN remote panel, under one shell with tray and menubar. The domain model is five nouns — account, cli, desktop, project, agent. Every other surface is a presentation layer or a behaviour over those nouns and over CC's filesystem. Do not add a noun casually (.claude/rules/architecture.md); that limit is…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 85
Every gate was written after a failure that had already shipped green, and each can be forced to fail (:self-test, --self-test, or a …
- Distinctive: line 193
It can inject a prompt and nothing else: No interrupt, exit or restart exists.
- Very specific: line 267
Restore-default removes the key: Never write the documented default, and never treat "" as unset.
- Very specific: line 280
Never join .claude.json by hand.
- Very specific: line 300
Use a labelKey or a lazy get label().
- Very specific: line 301
Locale preference
Nonemeans follow the OS: Never write a resolved locale back into preferences.json. - Very specific: line 303
Run pnpm check:catalogs after touching a catalog.
- Very specific: line 326
Install hooks with
scripts/install-hooks.sh: Never hand-symlink into .git/hooks/ — a global core.hooksPath makes git ignore it.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.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
Claudepot
Control center for Claude Code and Claude Desktop. Tauri 2 + Rust + React: accounts, projects, sessions, API keys, third-party providers, agents, memory files, usage and cost, updates, notifications and a LAN remote panel, under one shell with tray and menubar.
The domain model is five nouns — account, cli, desktop,
project, agent. Every other surface is a presentation layer or a
behaviour over those nouns and over CC's filesystem. Do not add a noun
casually (.claude/rules/architecture.md); that limit is on the domain
model, not on what the UI may expose.
How the docs are split
This file is @-included into every session, so it holds commands,
layout and the rules that must not be broken, in a line or two each.
docs/notes/ carries the reasoning: what was measured, which obvious
alternative was tried and reverted, and which shipped bug each rule was
written after. Notes are read on demand; they are not optional.
| Note | Read it before changing |
data-dir.md | anything in ~/.claudepot/ — the store inventory and each file's contract |
gui-shell.md | the Tauri shell, the section registry, the ⌘K palette, event channels, the session index |
cc-integration.md | retention, permission grants, peer messaging, CC env variables, any write to a CC settings file |
remote-control.md | claudepot-core::remote, panel/, approving from the phone |
core-modules.md | pricing, the env vault, auto-rotation, token refresh, the corpus |
i18n.md | any user-facing string or catalog |
test-gates.md | a check:* gate, and especially before relaxing one |
assets-and-release.md | icons, screenshots, git hooks, release validation |
web.md | web/ (claudepot.com) |
A rule in this file whose reasoning is in a note must not be changed from this file alone — the note holds the argument against the obvious alternative, which is what stops a decision being silently reverted.
.claude/rules/*.md are loaded into every session as well and are not
repeated here. dev-docs/ is gitignored: a pointer into it resolves only
on a machine that already has it.
Shared memory (dogfooding)
Claudepot indexes this repo's own Claude + Codex transcripts and
exposes them over MCP. The snippet below tells you which tools exist
and when to call them. It is generated — refresh with
claudepot mcp install-snippet --out .claude/claudepot-mcp-instructions.md;
never hand-edit it, and never duplicate it inline.
@.claude/claudepot-mcp-instructions.md
Build
cargo check --workspace # Rust
cargo build -p claudepot-cli # CLI binary
pnpm build # Frontend bundle
pnpm tauri dev # GUI in dev mode (hot reload)
pnpm tauri build --no-bundle # GUI release binary (no .dmg)
scripts/build-panel.sh # Remote panel → committed embed dirpanel/ has its own install and its build output is committed. Run
scripts/build-panel.sh after any change under panel/ — nothing else
notices, and the previous bundle ships with no error anywhere.
Test
cargo test --workspace # Rust
cargo xtask verify-cc-parity # CC settings-merge parity goldens (parity-harness/README.md)
cargo xtask verify-docs # README / data-dir note / event-channel / screenshot contracts
pnpm test # React (Vitest + RTL, jsdom)
pnpm test:coverage # React with coverage report
cd panel && pnpm check:render # the built remote panel actually mounts
pnpm check:classes # every className has a rule; every text field draws chrome
pnpm check:a11y # every role="switch" has an accessible name
pnpm check:motion # the reduced-motion override reaches the primitives
pnpm check:contrast # the prefers-contrast override is not lost to source order
pnpm check:catalogs # en↔zh key / placeholder / <Trans> tag parity
pnpm check:inline-flow # prose inside a flex/grid container keeps its spaces
pnpm check:envvar-layout # needs a screen; CI runs its unit half onlyEvery gate was written after a failure that had already shipped green,
and each can be forced to fail (:self-test, --self-test, or a fixture
for check:catalogs). Read test-gates.md before changing one. CI runs
core + cli tests on Linux, macOS and Windows, and the claudepot-tauri
crate's tests on macOS and Windows.
On the test host — real <user>, <host> and <password> are in the
gitignored CLAUDE.local.md:
cargo build -p claudepot-cli
scp target/debug/claudepot <user>@<host>:/tmp/claudepot
ssh <user>@<host> "security unlock-keychain -p <password> ~/Library/Keychains/login.keychain-db; /tmp/claudepot <command>"
ssh <user>@<host> "security unlock-keychain -p <password>; bash /tmp/claude-login-local.sh <email>" # set up CC login stateLayout
| Path | Role |
crates/claudepot-core | all business logic. Pure Rust, no Tauri dependency |
crates/claudepot-cli | thin clap wrapper over core |
src-tauri | the Tauri app over the same core. src/commands/ is one file per surface with no business logic; src/dto.rs holds what crosses to JS, and credentials never do |
src/ | React UI, plain CSS. api/ and types/ are sliced by domain and merged in index.ts; sections in sections/, primitives in components/primitives/ |
panel/ | the remote panel — a separate Vite app whose build output is committed into core |
crates/xtask | verify-docs, verify-cc-parity, cc-drift, verify-screenshots, screenshot-fixture |
web/ | claudepot.com — a separate Next.js app with its own install |
GUI shell
src/sections/registry.tsxis the one list of sections. Ten, in order: Accounts, Activities (idevents), Projects, Knowledge (shared-memory), Keys, Providers (third-party), Agents (automations), Config (config), Boards (boards, off by default), Settings. The palette, ⌘1..⌘9, the shortcuts modal, the launch picker and the sidebar all derive from it throughsrc/lib/optionalSections.ts. A second list of sections is a review finding. A new section is one registry entry, and that entry says what ⌘R does there.- The ⌘K palette has one ordering and one
activate(row)shared by keyboard and mouse. Add a row kind there, not at a second call site. Pane metadata (sections/settings/panes.ts,sections/global/tabs.ts) stays JSX-free so the palette can import it. - Long-running ops use the op-progress pipeline: a
*_startcommand spawns a task that emits onop-progress::<op_id>, and the modal subscribes by id.RunningOpsinsrc-tauri/src/ops.rsis the polling backstop. - Every event channel in
src-tauri/src/events.rsneeds a subscriber insrc/;verify-docsfails otherwise. A deliberate exception goes inUNSUBSCRIBED_BY_DESIGNwith its reason. - Measure before optimising. Three optimisations that look obviously
right were written, measured and reverted;
gui-shell.mdsays which. AccountStore.dbisMutex<Connection>so stores can crossawaitpoints in Tauri commands.
Data directory (~/.claudepot/)
- Resolve it through
claudepot_core::paths::claudepot_data_dir()(override:CLAUDEPOT_DATA_DIR), never a hand-built$HOME/.claudepot. - A new store needs a row in
data-dir.md.verify-docsfails when a*.db,*.jsonor*.jsonljoined onto the data dir is missing from that note. - Every database opens through
db_pragmas::apply_standard_pragmas;verify-docsfails aConnection::openthat doesn't. Per-store extras go in a second batch after the helper, never instead of it. sessions.dbandcorpus.dbare rebuildable;boards.dbis user data — migrations preserve its rows and nothing prunes it. Never put an archive insessions.db: its refresh deletes every row it cannot see.sessions.dbhas four invariants: a refresh with an empty plan takes no write lock; a per-project read scopes both sides of the diff; index-backed Tauri commands borrow the sharedSessionIndex(shared_or_open); a re-scan writes only the rows that differ.- A corrupt JSON store is never fatal at boot — it is moved aside and
the store starts empty. Four stores must also report the reset
(
load_or_recover), because a silent one reopens a door:permission-grants.json,peer-inbound-grant.json,remote-devices.json,remote-config.json. remote-key.pemandremote-ca-key.pemare private keys living in this directory. Do not sync, back up or attach it without knowing that.
Pricing
claudepot-core::pricing::PriceBook::resolve(model, day)is the only rate resolution. Rates are dated (RATE_TIERS) so a rate change does not re-score the past.src/costs.tsmirrors it, locked bycrates/claudepot-core/testdata/rate-resolution-vectors.jsonandcost-vectors.json, which both sides run. Change one, change the other, add a vector.- Usage is counted per API message, not per transcript line
(
session::usage::UsageLedger). - A family estimate is always marked
≈, never shown as a quote.
Permission grants
- A grant is a record, never a mode. It is CC's
PreToolUsehook (claudepot hook pre-tool-use) answeringallow. Do not writebypassPermissionsinto project settings — CC ignores it since 2.1.257. - The hook never writes, recovers or logs (
hook::load_readonly). A corrupt file reads as "no grant". - A grant with no hook entry is an error, not a grant.
- Hook entries go through
cc_hook_entryand point at the CLI (cc_hook_entry::hook_binary), never atcurrent_exe()blindly — from the GUI that is the desktop app.
Peer messaging
- It can inject a prompt and nothing else. No interrupt, exit or restart exists; a UI must not offer one. Slash commands arrive as literal text.
- Arrival is not delivery. The success type is
Handoff; never print "sent". - A peer cannot grant escalation. CC calls that permission laundering, and a session refusing to approve its own prompt is correct.
peerProtocol == 1is a hard pin, and both misdelivery guards stay:procStartchecked before connecting,session_idon every frame.- The inbound grant is time-boxed (
MAX_GRANT_HOURS), counts only from user scope, and checks supersession before expiry.
Remote control
- The admin password is the entire security boundary, and behind it is code execution as this user. A bearer token defends against other devices, not against local code. Do not write docs or UI implying more.
bindis an allowlist: loopback, RFC1918, link-local, Tailscale's100.64.0.0/10, and0.0.0.0(returned asExposure::EveryInterface). Anything globally routable is refused.100.xis not automatically Tailscale.- TLS is required iff the bind address is not loopback, with no downgrade switch.
- The password uses scrypt and the device token SHA-256. Do not unify them. The login throttle backs off and never locks out. TOTP is only ever a second factor.
- Every verb goes through
remote::service— CLI and GUI alike. - The server runs in-process, and the approval hook is armed only while it serves; that coupling is what makes handing a network client a permission grant acceptable. A hook that prints nothing falls through to the prompt at the machine.
- Three states, not two:
server.enabledis a preference,is_servingis the heartbeat,running_heresays whose server it is. - Panel: the transcript is masked, never scrubbed, and the UI says so; tool output never renders as markdown; there is no interrupt and no project move.
Env secret vault
- An inbound secret is zeroized on every exit path. An outbound one
crosses only through the Rust-side clipboard write and
KeyCopyReceiptDto— never rendered. .envedits touch only the target key's line, and renderer-supplied file names are validated as bare dotenv names.
Auto-rotation
- Rule logic is pure (
rotation::eval::evaluate, clock injected); the runtime bridge issrc-tauri/src/rotation_orchestrator.rs. - Confirm is the default mode; promote to auto only after watching the rule fire correctly.
Transcript retention
cleanupPeriodDaysis the only CC setting that destroys user data.0is not on the duration scale and CC rejects it since 2.1.233. There is no way to disable persistence for an interactive session, so do not offer one.- A value CC rejects suppresses cleanup entirely. The UI says "fix the value", never "restore the default", and any control that lifts suppression confirms first.
- A failed scan must never render as "nothing is scheduled for
deletion" (
TranscriptRisk::scan_incomplete). - Do not model the desktop-session exemption. Over-reporting is the safe direction.
CC env variables (Config → Files → Env variables)
- The spec is generated:
scripts/build-cc-env-spec.pywritescrates/claudepot-core/data/cc-env-spec.json, andverify-docsregenerates it byte-for-byte. Never hand-edit it. - Clearing a value is never live — CC's re-apply is additive-only — and every clear or restore confirmation says so.
- Restore-default removes the key. Never write the documented
default, and never treat
""as unset. - Build cross-check data is valid only on an exact version match; otherwise the section renders "unavailable for this version".
- "Safe to apply" is not "safe to display" —
ANTHROPIC_CUSTOM_HEADERSis pre-trust-safe and can still carryAuthorization: Bearer …. - User scope only.
CLAUDE_CONFIG_DIRis read-only here.
Locating CC's global config — one resolver
paths::global_claude_json_target() (or resolved_global_claude_json()
when "it doesn't exist" is a distinct answer) is the file CC reads.
Never join .claude.json by hand; verify-docs fails it.
Settings-file mutation boundary
claudepot-core::settings_mutex::mutate_settings_file is the only
way to read-modify-write a CC settings file. A transition that changes
two keys is one closure, and the read that decides what to write happens
inside it — deciding from a snapshot taken outside is a race by
construction. CC and a text editor do not hold this mutex, so external
writes get change-detection and a rebase retry, not exclusion.
Internationalization (en + zh-CN)
- English is the source of truth. Three catalogs:
src/locales/(React),src-tauri/i18n/(menu, tray, OS banners), and nothing inclaudepot-core. - Never localize CLI output, logs, core error
Displaytext, technical identifiers, or anything the user types or copies. Type-to-confirm phrases are the one exception. - No module-level label constants — they freeze the boot language.
Use a
labelKeyor a lazyget label(). - Locale preference
Nonemeans follow the OS. Never write a resolved locale back intopreferences.json. - Run
pnpm check:catalogsafter touching a catalog. It cannot see a key nothing references, so prune dead keys by hand.
Corpus + detectors
corpus.dbis deliberately notsessions.db. No model calls anywhere inclaudepot-core::corpus.- Vocabulary: a repetition cluster, never a "recurrence";
unresolved, never "abandoned".
Proactive token refresh
- Never the active account — that token belongs to Claude Code.
- It does not implement a refresh. It calls
services::identity::verify_account_identity; reimplementing the exchange forks the email-drift protection. - One account per tick. The five-minute cadence is the rate limit.
Release validation
- A push containing a
refs/tags/v*tag runs the Linux clippy and Windows compile gates on two validator hosts throughscripts/pre-push; branch pushes skip. Hosts are named inCLAUDE.local.md. - Install hooks with
scripts/install-hooks.sh. Never hand-symlink into.git/hooks/— a globalcore.hooksPathmakes git ignore it. - Push the branch, let CI finish, then push the tag.
--no-verifyused as a reflex is no gate at all. - An unreachable host defers to CI's green run for the same commit. A reachable host that fails never does.
Icon assets
assets/icon-set/is the only source. Generate withscripts/regen-icons.sh, notpnpm tauri icon, then runscripts/verify-icons.py.- SVG coordinates stay on 16-unit multiples of a 1024 grid.
- The bundle
.icnswants full-bleed artwork;dock_icon.rswantsicon-dock.pngwith the mask and inset already applied. Do not swap them.
Documentation screenshots
- Capture from a synthetic profile:
cargo xtask screenshot-fixture, then run the debug app withHOME=/tmp/claudepot-demo-homeandpnpm screenshots. The fake home goes to the app, not the build. - Never mask real data to take a screenshot.
- Adding a shot is two edits: a
SHOTSrow inscripts/capture-screenshots.mjsand aSCREENSHOTSrow incrates/xtask/src/verify_docs.rs.
Web (claudepot.com)
web/ is a separate Next.js app deployed by Vercel. Schema changes follow
.claude/rules/db-migrations.md — never drizzle-kit push against
production. pnpm test there discovers tests/*.test.ts; do not go back
to a hand-kept list.
Claude Code is a moving target
.claude/rules/cc-upstream-watch.md is the rule: verify CC behaviour
against the installed binary, never the source mirror, and give every
CC-facing module a row in crates/xtask/cc-upstream-watch.md.
cargo xtask cc-drift lists what moved since the pins — candidates, not
findings. Every CC version pin in this repo is dated, and a pin more than
a few weeks old is a hypothesis. dev-docs/kannon/reference.md (local,
untracked) is the long reference for CC and Desktop internals.
Conventions
- Grill reports go in
dev-docs/reports/. Never drop them at the repo root.
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.

