agentleFS
sjain-stanfordsjain-stanford/claude-workspace/CLAUDE.md

claude-workspace

CLAUDE.md2 starsChanged 21 days agoApache-2.0View on GitHub

Meta workspace for Claude Code and Codex-assisted development across multiple repositories. Each subdirectory under projects/ is an independent git repository. Sub-repos are gitignored in the meta workspace repo and are cloned locally for development and/or context. - projects/rocm-systems/ - Canonical public checkout, tracking ROCm/rocm-systems develop - Active project: emulation/rocjitsu/ - Resolve NPI development, qualification, and PR routing from LOCAL_CONTEXT.md; the public checkout and base do not apply to NPI work. - rocjitsu is a C++20 AMD GPU emulation toolkit with…

  • Commits and pushes

The file

Show its rules and text

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

44 rules. About 0 are common, 20 are distinctive, and 24 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 24

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read emulation/rocjitsu/CONTRIBUTING.md and the relevant project docs before editing.

    line 15
  2. Very specific:

    Before adding, changing, or reviewing rocjitsu code, read and follow emulation/rocjitsu/docs/style.md in the active checkout or task …

    line 17
  3. Distinctive:

    Treat it as authoritative over generic workspace C++ style guidance.

    line 19
  4. Very specific:

    Use skills/rocjitsu-build-test/ for local builds, including compressed debug information for fresh build directories.

    line 20
  5. Distinctive:

    Use the ROCR runtime source to verify HSA runtime, libhsakmt, topology, queue, event, and KFD-facing behavior.

    line 26
  6. Distinctive:

    Use as source context for rocjitsu debugger integration, GPU breakpoints, stepping, wave/register inspection, and debugger launch or resume …

    line 30
  7. Very specific:

    Start with README-ROCM.md and gdb/.

    line 32
  8. Very specific:

    Create debugger implementation worktrees under projects/worktrees/rocgdb/

    line 34
  9. Distinctive:

    Use as reference but expect Claude/Codex is launched from a dev-container already

    line 37
  10. Distinctive:

    Use for Triton development and upstream compiler context

    line 39
  11. Very specific:

    Create implementation worktrees under projects/worktrees/triton/

    line 40
  12. Distinctive:

    Create per-task worktrees here instead of editing the main checkout for feature work

    line 43
  13. Very specific:

    Create EMU development worktrees only under projects-emu/worktrees/<organization>/<repository>/<task>/

    line 46
  14. Distinctive:

    Never copy, commit, quote, attach, upload, or otherwise transfer EMU source, diffs, logs, repository names, or derived implementation …

    line 48
  15. Very specific:

    Before any public publish operation, verify that the proposed content and commit history contain no material derived from projects-emu/

    line 52
  16. Distinctive:

    Follow its routing to relevant pages as needed.

    line 75
  17. Distinctive:

    If the file is absent, continue with the tracked project instructions.

    line 76
  18. Distinctive:

    Keep private source names, paths, contents, and derived details in gitignored local files.

    line 78
  19. Very specific:

    Keep the review workflows distinct.

    line 104
  20. Very specific:

    All three workflows must read skills/review-criteria.md and any applicable project-specific instructions before assessing changes.

    line 109
  21. Very specific:

    When creating a new development branch in this workspace or any sub-repo, prefer users/sambhav/<short-descriptive-feature>, for example …

    line 114
  22. Very specific:

    Run git commands from the relevant repository directory.

    line 120
  23. Very specific:

    Run peanut-review from the same branch-backed task worktree under projects/worktrees/<repo>/ that is used to develop the change.

    line 124
  24. Distinctive:

    When the PR branch exists only as a remote-tracking branch, explicitly create and track a local branch:

    line 143
  25. Very specific:

    Run peanut-review start from inside that worktree so $PWD identifies the intended checkout.

    line 153
  26. Distinctive:

    If git push or any other remote-write command is denied by permissions, stop and ask the user how to proceed.

    line 160
  27. Very specific:

    Use concise, descriptive branch features, for example users/sambhav/rocjitsu-waitcnt-semantics.

    line 182
  28. Distinctive:

    Run build, test, lint, commit, and PR commands from the worktree directory.

    line 186
  29. Distinctive:

    Default to one to three short prose paragraphs, including for non-trivial changes.

    line 197
  30. Distinctive:

    After a plan is written, create Beads epics/tasks from it.

    line 211
  31. Very specific:

    Start: Run br ready to find actionable work

    line 247
  32. Very specific:

    Inspect: Run br show <id> and read any referenced plan file

    line 248
  33. Very specific:

    Claim: Use br update <id> --claim for atomic assignment

    line 249
  34. Very specific:

    Isolate: Create a git worktree under projects/worktrees/<repo>/...

    line 250
  35. Distinctive:

    Handoff: Add a Bead comment or notes with branch/worktree path, verification, and next steps

    line 252
  36. Very specific:

    Complete: Use br close <id> --reason="Completed" only after the work is pushed and a PR exists, unless the user explicitly says local …

    line 253
  37. Very specific:

    Sync: Always run br sync --flush-only at session end

    line 256
  38. Very specific:

    Check br ready at session start to find available work

    line 268
  39. Distinctive:

    Use one worktree per independent implementation task

    line 270
  40. Very specific:

    Create new issues with br create when you discover tasks

    line 271
  41. Distinctive:

    Use descriptive titles and set appropriate priority/type

    line 272
  42. Very specific:

    Keep Beads focused on executable state.

    line 273
  43. Distinctive:

    Do not close implementation Beads while code is only present as uncommitted or unpushed local work.

    line 274
  44. Distinctive:

    Always sync before ending session

    line 276

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

Claude Workspace

Meta workspace for Claude Code and Codex-assisted development across multiple repositories.

Workspace Structure

Each subdirectory under projects/ is an independent git repository. Sub-repos are gitignored in the meta workspace repo and are cloned locally for development and/or context.

  • projects/rocm-systems/ - Canonical public checkout, tracking ROCm/rocm-systems develop
    • Active project: emulation/rocjitsu/
    • Resolve NPI development, qualification, and PR routing from LOCAL_CONTEXT.md; the public checkout and base do not apply to NPI work.
    • rocjitsu is a C++20 AMD GPU emulation toolkit with full-system simulation, dynamic binary translation (DBT), and dynamic binary instrumentation (DBI)
    • Read emulation/rocjitsu/CONTRIBUTING.md and the relevant project docs before editing; use skills/rocjitsu-project/ for architecture and practice
    • Before adding, changing, or reviewing rocjitsu code, read and follow emulation/rocjitsu/docs/style.md in the active checkout or task worktree. Treat it as authoritative over generic workspace C++ style guidance.
    • Use skills/rocjitsu-build-test/ for local builds, including compressed debug information for fresh build directories. Reviewers should reuse the prepared build for the same revision and configuration.
    • The useful sparse-checkout context is emulation/rocjitsu/, projects/rocr-runtime/, shared/machine-readable-isa/isa/, and .github/.
    • Runtime source context: projects/rocr-runtime/ (ROCR and libhsakmt) Use the ROCR runtime source to verify HSA runtime, libhsakmt, topology, queue, event, and KFD-facing behavior; it is source context for rocjitsu, not an instruction to modify ROCR as part of ordinary rocjitsu work.
  • projects/rocgdb/ - ROCm debugger source, tracking ROCm/ROCgdb amd-staging
    • Use as source context for rocjitsu debugger integration, GPU breakpoints, stepping, wave/register inspection, and debugger launch or resume issues
    • Start with README-ROCM.md and gdb/; the rocjitsu skill's technical map lists the AMD debugger integration files and ROCm tests
    • Create debugger implementation worktrees under projects/worktrees/rocgdb/
  • projects/docker/ - Docker for ML compiler development environment
    • This is the unified development docker for all builds and tests
    • Use as reference but expect Claude/Codex is launched from a dev-container already
  • projects/triton/ - Upstream triton-lang/triton compiler checkout
    • Use for Triton development and upstream compiler context
    • Create implementation worktrees under projects/worktrees/triton/
  • projects/worktrees/ - Local git worktrees for parallel agent work
    • This directory is intentionally gitignored by projects/*
    • Create per-task worktrees here instead of editing the main checkout for feature work
  • projects-emu/ - Internal EMU repositories; local-only and gitignored
    • Organize canonical checkouts as projects-emu/<organization>/<repository>/
    • Create EMU development worktrees only under projects-emu/worktrees/<organization>/<repository>/<task>/
    • Never copy, commit, quote, attach, upload, or otherwise transfer EMU source, diffs, logs, repository names, or derived implementation details into public repositories, public issues or pull requests, public gists, or other public artifacts
    • Before any public publish operation, verify that the proposed content and commit history contain no material derived from projects-emu/
  • plans/ - Saved implementation plans from plan mode (gitignored contents, tracked directory)
  • reviews/ - Saved PR and self-review outputs (gitignored contents, tracked directory)
  • skills/ - Project-specific skills and shared references
  • tools/ - Workspace-owned tools, including the local peanut-review port
  • .agents/ - Agent configuration; includes skills -> ../skills symlink for Codex skill discovery
  • .claude/ - Claude Code configuration; includes settings and skills -> ../skills symlink
  • .codex/ - Codex local configuration and rules
  • .cursor/ - Cursor local configuration
  • .cache/ - Local caches for workspace tooling and docker/dependency artifacts (gitignored)
  • .beads/ - Local issue tracker state for this workspace
  • CLAUDE.md - Top-level context for Claude Code
  • AGENTS.md - Top-level instructions shared with agents (symlink to CLAUDE.md)
  • README.md - Human-facing workspace overview and setup guide

Optional Local Context

At task start, read LOCAL_CONTEXT.md once if present, resolving the path from this workspace root even when working in a sub-repo or worktree. It describes available local knowledge sources and repository/branch routing. Its task-specific routing takes precedence over generic public-checkout examples below, including development bases, worktree roots, and PR targets. Follow its routing to relevant pages as needed; do not preload the collection. If the file is absent, continue with the tracked project instructions.

Keep private source names, paths, contents, and derived details in gitignored local files. Do not copy them into tracked instructions, skills, examples, public artifacts, or external searches. Public work requires independently established public evidence; removing names does not make private material public. The existing projects-emu/ confidentiality rules apply to all local references.

Skills

  • skills/rocjitsu-project/ - rocjitsu architecture, subsystem ownership, and engineering practices
  • skills/rocjitsu-build-test/ - Risk-based rocjitsu build, test, formatting, sanitizer, and corpus verification
  • skills/gh-address-comments/ - Use when addressing GitHub PR or issue comments on the current branch
  • skills/gh-fix-ci/ - Use when debugging and fixing failing GitHub Actions checks for a PR
  • skills/find-security-vulnerabilities/ - Use for requested security audits and exploitability assessments
  • skills/peanut-review/ - Use for explicit multi-agent review sessions, personas, curation, the review web UI, or GitHub review publishing
  • skills/pr-create/ - Use when asked to create a PR (enforces succinct descriptions)
  • skills/pr-review/ - Use when asked to review a PR from GitHub
  • skills/self-review/ - Use when asked to self-review local branch changes (before creating a PR)
  • skills/stage-and-commit/ - Use when asked to commit local changes (enforces Signed-off-by trailers)
  • skills/sync-repos/ - Fetch canonical clones' default branches and fast-forward local defaults while preserving pinned worktrees; supports fetch-only mode
  • skills/cleanup-worktrees/ - Remove idle worktrees and retire peanut-review sessions for landed, stale, or abandoned work, with preview and recovery records
  • skills/review-criteria.md - Shared review checklist and standards (used by pr-review and self-review)
  • skills/llvm-coding-standards.md - LLVM C++ reference used only when the target project adopts it

Note: Skills are symlinked from agent-specific config directories (.claude/skills -> ../skills, .agents/skills -> ../skills) so local agents can discover them while keeping the source files at the repo root for easier editing.

Keep the review workflows distinct. pr-review and self-review are focused single-agent reviews that save Markdown reports under reviews/. peanut-review is the explicit multi-agent workflow with persistent sessions, personas, curation, a web UI, and optional GitHub publishing. Do not escalate an ordinary review into peanut-review unless the user requests those capabilities. All three workflows must read skills/review-criteria.md and any applicable project-specific instructions before assessing changes.

Sub-Repo Git Usage

When creating a new development branch in this workspace or any sub-repo, prefer users/sambhav/<short-descriptive-feature>, for example users/sambhav/rocjitsu-waitcnt-semantics. Follow this convention unless the user requests another name or the target repository requires a different pattern. Preserve existing branch names when resuming work or checking out a PR.

Run git commands from the relevant repository directory. For sub-repos under projects/, set the command working directory to projects/<repo> or its task worktree and use plain git commands.

The canonical checkouts under projects/<repo>/ are for reading, planning, debugging, and gathering context. Before making implementation edits, create or switch to a task-specific worktree under projects/worktrees/<repo>/... and do the edits, build, test, lint, commit, and PR work there. Only edit a canonical checkout directly when the user explicitly asks for that exact checkout to be modified.

Run peanut-review from the same branch-backed task worktree under projects/worktrees/<repo>/ that is used to develop the change. Do not create a separate detached or review-only worktree under .cache/peanut-review/. Name sessions <repo>-pr-<number>-<change>. The shared config at .cache/peanut-review/.peanut-review.json resolves the current worktree from $PWD and stores only session data under .cache/peanut-review/sessions/.

Reuse an existing development worktree when one owns the PR branch. If none exists, create a normal branch-backed task worktree under projects/worktrees/<repo>/, then use that checkout for both review and any subsequent fixes. Run these commands from the claude-workspace root. When the local PR branch already exists and is not checked out elsewhere, use:

git -C projects/<repo> worktree add \
  ../worktrees/<repo>/<task>-<change> \
  <local-pr-branch>

When the PR branch exists only as a remote-tracking branch, explicitly create and track a local branch:

git -C projects/<repo> worktree add \
  --track -b <local-pr-branch> \
  ../worktrees/<repo>/<task>-<change> \
  <remote>/<remote-pr-branch>

Run peanut-review start from inside that worktree so $PWD identifies the intended checkout. Before launching reviewers, verify that its committed HEAD is the snapshot to review. Preserve any local changes; never discard or overwrite them to synchronize a review session. Because peanut-review pins a commit range, commit intended review changes first or use the local-review workflow when reviewing work that is not yet represented by the GitHub PR.

If git push or any other remote-write command is denied by permissions, stop and ask the user how to proceed. Do not bypass the denial with alternate remote mutation paths such as gh api, GitHub REST/GraphQL calls, gh pr edit, direct ref updates, contents API writes, or any other tool that changes remote repository, branch, PR, release, workflow, or gist state. Treat permission denial for one remote-write mechanism as denial for all equivalent remote-write mechanisms unless the user explicitly approves a specific alternative.

Parallel Agent Worktrees

Use git worktrees for autonomous feature work so independent agents do not share one mutable checkout. The canonical checkouts under projects/<repo>/ are for reading, planning, review, and context only unless the user explicitly directs otherwise. For Bead-driven implementation, create a task worktree under projects/worktrees/<repo>/<bead-id>-<short-slug>/ before modifying files.

Recommended pattern for public repositories, after resolving the target base:

cd projects/<repo>
git fetch <base-remote> <base-branch>
git worktree add \
  ../worktrees/<repo>/<bead-id>-<short-slug> \
  -b users/sambhav/<feature> <base-remote>/<base-branch>

Use concise, descriptive branch features, for example users/sambhav/rocjitsu-waitcnt-semantics. Confirm the target repository's actual base branch instead of assuming main; public rocjitsu uses develop, while NPI rocjitsu follows LOCAL_CONTEXT.md for its base and PR target. Run build, test, lint, commit, and PR commands from the worktree directory. At handoff, leave the Bead with the worktree path, branch name, commit/PR state, verification performed, and any remaining follow-up. Remove completed worktrees only after the branch/PR no longer needs local follow-up.

PR Preferences

  • Resolve the base repository and branch from task-specific routing in LOCAL_CONTEXT.md before creating a PR. NPI rocjitsu PRs must use its designated internal target, even if the repository default differs.
  • Default to one to three short prose paragraphs, including for non-trivial changes. Explain the problem, the resulting behavior, and relevant validation concisely. Do not use headings, subheadings, or bold section labels in PR descriptions, even when the repository template contains them. Answer relevant template prompts in prose; include investigation details only when needed to assess the change.
  • Include validation and any manual testing needed beyond CI in the prose; do not add a "Test Plan" section.
  • Omit agent attribution footers from pull request descriptions and commit messages.

Plans

Save implementation plans created during plan mode to plans/ at claude-workspace root. These provide the durable design record for non-trivial work and are mandatory for larger feature efforts before workers fan out.

After a plan is written, create Beads epics/tasks from it. Each task should reference the plan file and relevant section, include dependencies, acceptance criteria, expected repo/worktree, likely file areas, and verification commands. Workers should read the referenced plan context before claiming a task.

Reviews

Save PR reviews and self-review outputs to reviews/ at claude-workspace root. These provide a record of findings, review context, and follow-up decisions for reviewed changes.

Beads Workflow Integration

This project uses beads_rust (br) for issue tracking. A single central .beads/ in claude-workspace tracks work across all sub-repos — there are no per-repo .beads/ directories. Prefix bead titles with [repo-name] (e.g. [rocm-systems], [docker]) to indicate which sub-repo the work relates to. CRITICAL: NEVER MENTION BEADS IN CODE. Beads persist locally for work tracking and session handoff, but are not shared project records. Use proper TODOs or GitHub issues for references that must travel with source code. Track most workspace work in Beads.

.beads/ is intentionally local-only and gitignored because all agents run on this one machine. Do not change .gitignore to track Beads state unless the workflow explicitly moves to multiple machines.

Essential Commands

# View ready issues (unblocked, not deferred)
br ready

# List and search
br list --status=open # All open issues
br show <id>          # Full issue details with dependencies
br search "keyword"   # Full-text search

# Create and update
br create --title="[repo] Title..." --description="..." --type=task --priority=2
br update <id> --claim
br close <id> --reason="Completed"
br close <id1> <id2>  # Close multiple issues at once

Workflow Pattern

  1. Start: Run br ready to find actionable work
  2. Inspect: Run br show <id> and read any referenced plan file
  3. Claim: Use br update <id> --claim for atomic assignment
  4. Isolate: Create a git worktree under projects/worktrees/<repo>/... for implementation tasks
  5. Work: Implement the task, adding new Beads for discovered follow-up
  6. Handoff: Add a Bead comment or notes with branch/worktree path, verification, and next steps
  7. Complete: Use br close <id> --reason="Completed" only after the work is pushed and a PR exists, unless the user explicitly says local worktree state is enough to close it
  8. Sync: Always run br sync --flush-only at session end

Key Concepts

  • Dependencies: Issues can block other issues. br ready shows only unblocked work.
  • Priority: P0=critical, P1=high, P2=medium, P3=low, P4=backlog (use numbers 0-4, not words)
  • Types: task, bug, feature, epic, chore, docs, question
  • Blocking: br dep add <issue> <depends-on> to add dependencies
  • Claiming: br update <id> --claim prevents two parallel agents from taking the same ready task. Persistent agent names are optional; disposable session identity is fine.

Best Practices

  • Check br ready at session start to find available work
  • Claim with br update <id> --claim before editing
  • Use one worktree per independent implementation task
  • Create new issues with br create when you discover tasks
  • Use descriptive titles and set appropriate priority/type
  • Keep Beads focused on executable state; keep durable design in plans/
  • Do not close implementation Beads while code is only present as uncommitted or unpushed local work; leave them open/in progress with handoff notes
  • Always sync before ending session

Download now (ZIP)

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.