Skip to content

contrib-tools: document repo-local tmp/ as preferred scratch location over /tmp #4398

Description

@myitcv

Is your feature request related to a problem? Please describe.

The cueckoo common guidance (served by the cueckoo MCP server and
imported into each CUE repo's CLAUDE.md) has no convention for where
temporary or scratch working files should be created. As a result, AI
assistants and contributors default inconsistently — often to the
system /tmp — for things like scratch .txtar reproductions,
intermediate output, and other transient working state.

/tmp is a poor default for repo work: the files are detached from the
repository they belong to, harder to locate later, and more easily lost
(system cleanup, reboots) than files kept alongside the checkout.

Describe the solution you'd like

Add a short section to the common guidance establishing that temporary
and scratch files should be created in a tmp/ directory at the
repository root, in preference to the system /tmp. Rationale: a
repo-local location keeps working state associated with the repo it
belongs to, makes it easier to find, and makes accidental loss less
likely / recovery easier. The directory must be gitignored so its
contents never pollute the working tree's untracked-file status or get
staged by accident.

Suggested wording:

Temporary and scratch files

When creating temporary files, scratch reproductions, or other
working state, prefer a tmp/ directory at the repository root over
the system /tmp. Repo-local working state stays associated with the
repo it belongs to, is easier to find, and is less likely to be lost
than files in the system temporary area. Ensure tmp/ is gitignored
so its contents never pollute the working tree's untracked-file
status or get staged by accident.

This mirrors the existing "Git worktrees" section, which already
establishes a repo-local, gitignored location (.claude/worktrees/)
and the rule that it be gitignored.

Describe alternatives you've considered

  • Folding the rule into the existing "Git worktrees" section rather
    than adding a standalone section, since both are "repo-local,
    gitignored location" rules. A standalone section seems clearer given
    the different purpose.
  • Leaving the choice to /tmp. Rejected for the recoverability and
    locality reasons above.

Additional context

The "Testing and Reproductions" section instructs contributors to
create standalone .txtar reproduction files but never says where to
put them — that section is a natural place to cross-reference the new
convention.

Separately, the contrib-tools repo itself currently has no .gitignore
at all, so the existing worktree rule ("Ensure .claude/worktrees/ is
gitignored") is not actually satisfied there. A .gitignore covering
tmp/ and .claude/worktrees/ would be worth adding alongside this
change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestNew feature or requestTriageRequires triage/attention

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions