agentleFS
hmanshmans/beans/CLAUDE.md

beans

CLAUDE.md951 starsChanged 10 months agoApache-2.0View on GitHub

Beans is an agentic-first issue tracker. Issues ("beans") live as markdown files in a .beans/ directory inside a project repo. The system has three interfaces: The Beans UI is the primary development focus. It includes a backlog board, per-bean agent chat (spawning Claude Code processes), git worktree management, file change diffs, and terminal sessions. Key packages:

We split this CLAUDE.md into the rules it gives an agent

16 rules. About 0 are common, 7 are distinctive, and 9 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.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use conventional commit messages ("feat", "fix", "chore", etc.) when making commits.

    line 13
  2. Distinctive:

    When making commits, provide a meaningful commit message.

    line 16
  3. Distinctive:

    When we're working in a PR branch, make separate commits, and update the PR description to reflect the changes made.

    line 20
  4. Very specific:

    When making changes to the GraphQL schema (internal/graph/schema.graphqls), run mise codegen to regenerate both backend (generated.go) and …

    line 38
  5. Very specific:

    When adding or changing frontend GraphQL operations (queries, mutations, subscriptions), update frontend/src/lib/graphql/operations.graphql …

    line 39
  6. Very specific:

    All CLI commands that interact with beans should internally use GraphQL queries/mutations against the local server.

    line 40
  7. Very specific:

    When a mutation removes or clears state (e.g., deleting a session), the subscription resolver must still send an explicit "empty" payload …

    line 50
  8. Distinctive:

    When a PR merges and the bean file lands on main, the main watcher picks it up and the dirty flag clears.

    line 59
  9. Very specific:

    Use the idea tag for ideas and proposals.

    line 69
  10. Distinctive:

    Always write or update tests for the changes you make.

    line 73
  11. Very specific:

    Run all tests: mise test

    line 77
  12. Very specific:

    Run specific package: go test ./internal/bean/

    line 78
  13. Distinctive:

    Use table-driven tests following Go conventions

    line 79
  14. Distinctive:

    Write or update Playwright e2e tests for any web UI changes.

    line 83
  15. Very specific:

    Run e2e tests: mise test:e2e

    line 84
  16. Very specific:

    When testing read-only functionality, feel free to use this project's own .beans/ directory.

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 25,680 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

What we're building

Beans is an agentic-first issue tracker. Issues ("beans") live as markdown files in a .beans/ directory inside a project repo. The system has three interfaces:

  • CLI (beans binary) — create, list, update, and query beans from the terminal
  • Terminal TUI — Bubbletea-based interactive interface
  • Beans UI (beans serve) — SvelteKit SPA served by an embedded Go HTTP server, communicating via GraphQL (queries, mutations, subscriptions over WebSocket)

The Beans UI is the primary development focus. It includes a backlog board, per-bean agent chat (spawning Claude Code processes), git worktree management, file change diffs, and terminal sessions.

Commits

  • Use conventional commit messages ("feat", "fix", "chore", etc.) when making commits.
  • Include the relevant bean ID(s) in the commit message (please follow conventional commit conventions, e.g. Refs: bean-xxxx).
  • Mark commits as "breaking" using the ! notation when applicable (e.g., feat!: ...).
  • When making commits, provide a meaningful commit message. The description should be a concise bullet point list of changes made.

Pull Requests

  • When we're working in a PR branch, make separate commits, and update the PR description to reflect the changes made.
  • Include the relevant bean ID(s) in the PR title (please follow conventional commit conventions, e.g. Refs: bean-xxxx).

Project Structure

Key packages:

  • pkg/bean/ — Bean data model, parsing, sorting, validation (no I/O)
  • pkg/beancore/ — Core engine: disk I/O, file watching, search indexing, worktree watching
  • internal/graph/ — GraphQL schema and resolvers (the API layer for both Beans UI and CLI)
  • internal/agent/ — Agent session manager: spawns Claude Code processes, parses JSONL output, pub/sub for real-time updates
  • internal/worktree/ — Git worktree lifecycle management
  • internal/terminal/ — PTY session management for embedded terminals
  • internal/commands/ — CLI command implementations (Cobra)
  • frontend/ — SvelteKit SPA (embedded into the Go binary via //go:embed)

GraphQL

  • When making changes to the GraphQL schema (internal/graph/schema.graphqls), run mise codegen to regenerate both backend (generated.go) and frontend (frontend/src/lib/graphql/generated.ts) types.
  • When adding or changing frontend GraphQL operations (queries, mutations, subscriptions), update frontend/src/lib/graphql/operations.graphql and run mise codegen. Do NOT use inline gql strings — all operations must go through codegen for type safety.
  • All CLI commands that interact with beans should internally use GraphQL queries/mutations against the local server.
  • Subscriptions use WebSocket transport. The beanChanged subscription supports includeInitial: true to send a full snapshot on connect, avoiding race conditions between initial load and live updates.

Build

  • mise build to build a ./beans executable
  • The frontend is built and embedded into the Go binary at compile time

GraphQL Subscriptions

  • When a mutation removes or clears state (e.g., deleting a session), the subscription resolver must still send an explicit "empty" payload to the frontend. Never skip nil results with continue — the frontend needs to know the state changed.

Worktree State Architecture

  • Git worktrees are created outside the main repo, in ~/.beans/worktrees/<project-name>/. This avoids nested repo confusion and accidental tool/search interference. The location is configurable via worktree.path in .beans.yml.
  • beans-serve holds runtime state as the authoritative view of all beans. It initializes from main repo disk, then merges in changes from worktrees and the GraphQL API.
  • The CLI in a worktree uses the worktree's local .beans/ directory — it does NOT redirect to the main repo. This means worktree agents' bean changes travel with their PR.
  • beans-serve watches active worktrees' .beans/ dirs and merges file changes into runtime state as "dirty" (not persisted to main disk).
  • The startWork mutation uses WithPersist(false) — status changes are runtime-only until the PR merges.
  • When a PR merges and the bean file lands on main, the main watcher picks it up and the dirty flag clears.
  • Each worktree has a metadata file (<id>.meta.json) stored as a sibling in the worktree root directory (e.g. ~/.beans/worktrees/<project>/<id>.meta.json). This file persists per-worktree state that must survive server restarts: name, description, allocated port, and last-active timestamp. Use worktree.Manager.SavePort/GetPort etc. to read and write fields — don't access the file directly.

Agent Architecture

  • The central (main workspace) agent session uses ID __central__ (defined as CentralSessionID in internal/graph/resolver.go and MAIN_WORKSPACE_ID in frontend/src/lib/worktrees.svelte.ts). These must stay in sync — the backend uses this ID to determine work directory and system prompt.
  • Worktree agent sessions use the worktree ID as their session ID.

Extra rules for our own beans/issues

  • Use the idea tag for ideas and proposals.

Testing

  • Always write or update tests for the changes you make.

Unit Tests

  • Run all tests: mise test
  • Run specific package: go test ./internal/bean/
  • Use table-driven tests following Go conventions

E2E Tests

  • Write or update Playwright e2e tests for any web UI changes.
  • Run e2e tests: mise test:e2e
  • See frontend/e2e/ for fixtures, page objects, and specs.

Manual CLI Testing

  • mise beans will compile and run the beans CLI. Use it instead of building and running ./beans manually.
  • When testing read-only functionality, feel free to use this project's own .beans/ directory. But for anything that modifies data, create a separate test project directory. All commands support the --beans-path flag to specify a custom path.

Download now (ZIP)

  • In this repositoryOne other file it gives its agents.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.