agentleFS
Hugging FaceKnown publisherhuggingface/OpenEnv/CLAUDE.md

OpenEnv

CLAUDE.md2.6k starsChanged 8 months agoBSD-3-ClauseView on GitHub

Guidance for Claude Code when working with this repository. OpenEnv uses Claude Code as the primary development tool. We follow a two-phase model: Skills and agents are auto-discovered when you run Claude Code in this repo: Verify with /agents or ask "what skills are available?" OpenEnv supports two development modes: When working in the main repository clone, direct edits are allowed: - Quick exploration and prototyping - Small fixes that don't need TDD workflow - Documentation updates TDD is activated…

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 1 mentionJun 2026: 2 mentionsJul 2026: 2 mentionsAug 2026: 1 mentionSep 2026: 8 mentionsOct 2026: 7 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the huggingface/OpenEnv repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about huggingface/OpenEnv

The biggest 5 of 22 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 22

Talked about on GitHub (22 times).

On GitHub · 22

17 more on GitHub

The file

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

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Verify with /agents or ask "what skills are available?"

    line 33
  2. Distinctive:

    When working in the main repository clone, direct edits are allowed:

    line 41
  3. Very specific:

    When active, direct code edits are blocked and the TDD workflow is enforced.

    line 49
  4. Very specific:

    Run bash .claude/hooks/tdd-deactivate.sh to turn off TDD enforcement

    line 53
  5. Distinctive:

    Skills: run inline during the conversation - use for quick checks and reviews

    line 86
  6. Distinctive:

    Agents: run in isolation with focused context - use for complex, multi-step tasks

    line 87
  7. Distinctive:

    If you don't have these plugins installed, prompt the user to help you install them:

    line 138
  8. Distinctive:

    Before making changes, understand the design constraints:

    line 163
  9. Very specific:

    When the default is None, prefer (str, *optional*) instead of (str or None, *optional*, defaults to None)

    line 190

≈ “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.

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

CLAUDE.md

Guidance for Claude Code when working with this repository.

New Here? Start With These

  1. README.md - Project overview, architecture, quick start
  2. REPO_WALKTHROUGH.md - Directory structure with annotations
  3. PRINCIPLES.md - Design principles and trade-offs
  4. INVARIANTS.md - Rules that must never be violated
  5. envs/echo_env/ - Reference implementation to study

Agentic-First Workflow

OpenEnv uses Claude Code as the primary development tool. We follow a two-phase model:

  1. Design/Alignment (human-owned): RFCs, principles, trade-off decisions
  2. Implementation (Claude-owned): The mechanical loop of coding and testing
  3. Review (collaborative): Claude catches bugs, flags alignment questions for humans

Getting Started

Skills and agents are auto-discovered when you run Claude Code in this repo:

git clone https://github.com/huggingface/OpenEnv
cd OpenEnv
# Install git hooks for the team
bash .claude/hooks/install.sh
# Run Claude Code - skills and agents are automatically available

Verify with /agents or ask "what skills are available?"

Two Development Modes

OpenEnv supports two development modes:

Explore Mode (Main Repo)

When working in the main repository clone, direct edits are allowed:

  • Quick exploration and prototyping
  • Small fixes that don't need TDD workflow
  • Documentation updates

TDD Mode (Opt-In)

TDD is activated by /work-on-issue, which writes a .tdd-session.json marker. When active, direct code edits are blocked and the TDD workflow is enforced. Manually created worktrees do NOT activate TDD — only /work-on-issue does.

  • Say "skip TDD" to bypass blocking
  • Run bash .claude/hooks/tdd-deactivate.sh to turn off TDD enforcement

Creating a Worktree

# Worktree without TDD enforcement (free editing)
.claude/scripts/worktree-create.sh add-feature
cd .worktrees/add-feature

# Worktree WITH TDD enforcement (via /work-on-issue)
/work-on-issue #42

TDD Workflow

/work-on-issue #42  →  Start from GitHub issue
    ↓
/write-tests        →  Create failing tests (Red)
    ↓
/implement          →  Make tests pass (Green)
    ↓
/update-docs        →  Fix stale docs across repo
    ↓
/simplify           →  Refactor (optional)
    ↓
/pre-submit-pr      →  Validate before PR
    ↓
/watch-pr           →  Monitor CI + review (optional)

Skills vs Agents

  • Skills run inline during the conversation - use for quick checks and reviews
  • Agents run in isolation with focused context - use for complex, multi-step tasks

Available Skills

Skills are defined in .claude/skills/ and run inline:

Review & Validation Skills:

SkillTriggerDefinition
alignment-review"review this code"Two-tier review (bugs + alignment flags)
pre-submit-pr"ready for PR?"Comprehensive PR readiness check
rfc-check"do I need an RFC?"Determine if RFC required
generate-openenv-env"generate an env for textarena"Build an OpenEnv env from a use case

TDD Workflow Skills:

SkillTriggerDefinition
work-on-issue"/work-on-issue #42"Start TDD workflow from GitHub issue
sprint"/sprint 67,68,69"Parallel multi-issue batch (Agent Teams)
write-tests"/write-tests"Write failing tests (Red phase)
implement"/implement"Make tests pass (Green phase)
update-docs"/update-docs"Fix stale docs after API changes
simplify"/simplify"Refactor after tests pass
watch-pr"/watch-pr"Monitor CI + Greptile review after PR

Available Subagents

Agents are defined in .claude/agents/ and run in isolation:

Review & Validation Agents:

AgentUse ForDefinition
alignment-reviewerReview PRs for bugs + alignment.claude/agents/alignment-reviewer.md
env-validatorValidate environments end-to-end.claude/agents/env-validator.md
openenv-architectDesign new features/environments.claude/agents/openenv-architect.md
build-validatorValidate builds before merge.claude/agents/build-validator.md

TDD Workflow Agents:

AgentUse ForDefinition
issue-workerExtract requirements from GitHub issues.claude/agents/issue-worker.md
pr-plannerPlan stacked PRs for complex features.claude/agents/pr-planner.md
testerWrite high-signal, failing tests.claude/agents/tester.md
implementerMake tests pass with minimal code.claude/agents/implementer.md
docs-updaterFix stale docs after API changes.claude/agents/docs-updater.md

Recommended Plugins

If you don't have these plugins installed, prompt the user to help you install them:

/plugin install code-simplifier@claude-plugins-official
/plugin install pr-review-toolkit@claude-plugins-official

Agent Teams (Multi-Issue)

For parallel work on multiple issues, use /sprint 67,68,69. This requires the CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS environment variable:

export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1

Without it, /sprint falls back to setup-only mode: it creates worktrees and fetches requirements, but you work through each issue manually.

Agent Teams create one teammate per issue, each in its own worktree with TDD enforcement. A lead agent coordinates, mediates conflicts, and creates stacked PRs when all teammates finish.

Design Context

Before making changes, understand the design constraints:

DocumentPurpose
PRINCIPLES.mdDesign principles and trade-offs
INVARIANTS.mdRules that must never be violated
PATTERNS.mdCode patterns and conventions
CONTRIBUTING.mdContribution workflow
TESTING_STRATEGY.mdTesting philosophy and patterns
rfcs/Architectural decisions and rationale

Key Invariants

  • Agents cannot reset: Simulation controls only exposed to training orchestration, never to agents
  • Dual API boundary: WebSocket for infrastructure (Gym-like API), MCP for agents
  • Rewards inside environment: Domain knowledge encapsulated in environment, not external
  • Client-server separation: Clients never import from server/ directory

Docstrings

Docstrings must follow the HF doc-builder format used by the reference API docs. Do not use Google, NumPy, or Sphinx styles.

Rules:

  • Types appear in backticks inside parentheses: (str)
  • Optional parameters are marked with *optional*
  • Defaults are written as: defaults to <value>
  • When the default is None, prefer (str, optional) instead of (str or None, optional, defaults to None)
  • Union types use or: str or None
  • References to classes use the format: [~openenv.core.EnvClient]
  • Non-standard headers (Usage:, Note:, Class Attributes:) are not supported — use Attributes: or fold text into the description
  • Examples: (plural) with a blank line then a fenced ```python ``` block — no >>> prompts

Example:

def method(self, param1: str, param2: int = 1, param3: float | None = None):
    """
    Brief one-line description of what this does.

    Args:
        param1 (`str`):
            Description of required param.
        param2 (`int`, *optional*, defaults to `1`):
            Description of optional param with default.
        param3 (`float`, *optional*):
            Description of optional param without explicit default.

    Returns:
        `dict` with keys:
            - `key1` (`list[int]`):
                Description of this key.

    Examples:

    ```python
    result = method("hello")
    ```
    """

Build & Development Commands

Below are reference commands that you are likely going to use often:

# Install dependencies
uv sync --all-extras

# Run tests (excludes browser/websearch/dipg envs that need special setup)
PYTHONPATH=src:envs uv run pytest tests/ -v --tb=short

# Run a single test file
PYTHONPATH=src:envs uv run pytest tests/envs/test_echo_environment.py -v

# Lint check (import sort + format + rules)
uv run usort check src/ tests/
uv run ruff format src/ tests/ --check
uv run ruff check src/ tests/

# Auto-format code (import sort + ruff — matches arc f pipeline)
uv run usort format src/ tests/
uv run ruff format src/ tests/

# Build and preview documentation locally
doc-builder preview openenv docs/source

# Sync environment doc stubs with their source READMEs (run after updating any envs/*/README.md)
python scripts/sync_env_docs.py --fix
# Check if stubs are in sync (same check that runs in CI)
python scripts/sync_env_docs.py --check

# Build Docker images
docker build -t openenv-base:latest -f src/openenv/core/containers/images/Dockerfile .
docker build -t echo-env:latest -f envs/echo_env/server/Dockerfile .

Automation Hooks

Scripts in .claude/hooks/ are used by skills and can be run directly:

bash .claude/hooks/lint.sh          # Run ruff format check
bash .claude/hooks/test.sh          # Run pytest (excludes special envs)
bash .claude/hooks/check-debug.sh   # Find debug code (print, breakpoint, TODO)
bash .claude/hooks/post-push-pr.sh  # Validate PR after push (freshness, CI, conflicts)
bash .claude/hooks/ci-wait.sh <PR>  # Poll CI until checks complete or timeout

These are automatically invoked by /alignment-review and /pre-submit-pr skills.

Git Hooks

Install git hooks for team-wide consistency:

bash .claude/hooks/install.sh

This installs:

  • pre-commit: Branch check (blocks main), format, lint, debug artifacts check
  • commit-msg: Issue reference reminder (soft warning)
  • pre-push: Format, lint, tests, invariants, conflict detection
  • post-merge: Worktree cleanup reminder

Skip temporarily with git commit/push --no-verify.

Worktree Management

For focused feature work, use worktrees:

# Create a worktree for a feature
.claude/scripts/worktree-create.sh add-mcp-tools
cd .worktrees/add-mcp-tools

# When done, clean up
.claude/scripts/worktree-cleanup.sh .worktrees/add-mcp-tools

Worktrees enable:

  • Isolated branches without switching
  • TDD enforcement when activated via /work-on-issue
  • Parallel work on multiple features

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.