Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

CLAUDE.md: add pre-flight check to prevent agents editing main/ directly #35

@davidpoblador

Description

@davidpoblador

Problem

The CLAUDE.md key rules explain the worktree structure well (rule 1: "Never work directly in
main/", rule 2: each worktree is a full checkout, etc.), but agents still jump straight to
editing files in main/ without creating a feature worktree first.

The rules describe the structure but don't include a procedural step that triggers before the
first edit.

Suggested change

Add a rule under "Key rules" that acts as a pre-flight check:

5. **Before editing ANY file**, verify you are in a feature worktree directory, not `main/`.
   If no feature worktree exists for your current task, create one with `just wt-add <name>`
   before making any changes.

This gives agents an explicit "stop and check" step tied to the moment they're about to write
code, rather than relying on them to internalize the structural rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions