Skip to content

docs(claude): audit the agent workflow against the Claude Code best practices - #1640

Merged
drsnuggles8 merged 5 commits into
masterfrom
feature/claude-workflow-audit
Oct 20, 2026
Merged

drsnuggles8 merged 5 commits into
masterfrom
feature/claude-workflow-audit

Conversation

@drsnuggles8

Copy link
Copy Markdown
Owner

Brings the agent workflow (task picking, worktrees, the task loop, CLAUDE.md and the agent-rules corpus) in line with Anthropic's Claude Code best practices and the memory, skills, subagents, worktrees and /goal pages behind it. The theme is context cost: a worker session used to be told to read CLAUDE.md, a 155 KB index and six guides totalling ~220 KB before starting.

What changed

Workflow commands → manual-only skills (.claude/skills/{start-work,cleanup-worktree,resume-worktrees}), each with disable-model-invocation: true because they create/delete worktrees, comment on issues and kill processes.

  • Deterministic steps are scripts now: .claude/scripts/worktree_status.py (one read-only completed/incomplete gate shared by cleanup and resume, now also covering detached and non-feature/* worktrees), start-work/scripts/new-task-worktree.sh, resume-worktrees/scripts/open-vscode-folders.ps1.
  • /start-work 41 KB → ~15 KB; the model rubric moves to model-rubric.md.
  • The per-worktree memory junction is gone: Claude Code derives auto memory from the git repository, so worktrees already share the base store.
  • /goal is the default kickoff; /resume-worktrees resumes the earlier session instead of re-priming from a stale HANDOVER.

Subagents (.claude/agents/), each wired into its task-loop phase: ci-triage (5b), spec-reviewer (3, requirement gaps only), live-verifier (2b), rules-lookup (0).

Context budget

  • CLAUDE.md 247 lines / 14.8 KB → 185 lines / 10.7 KB. Per-subsystem sections move to nine path-scoped rules in .claude/rules/ that load only when a matching file is touched. Adds compaction instructions. For other agents moves to AGENTS.md.
  • docs/agent-rules/README.md 155 KB → 46 KB (one sentence per guide); Part B moves to failure-modes.md.
  • The 79 guides over the 10 KB house limit (1.87 MB) are split: <name>.md is the rules (≤10 KB each, ~600 KB total), each linking to its section in <name>-details.md, which is the original text unchanged.

task-loop.md: Phase 0 proves the olo-* mods are loaded; the Phase 2 build snippet goes through build-lock on build-cached; phases hand capture, spec review and CI triage to the subagents.

Found and fixed

  • 4860d81 fix(claude): the build-lock hook's no-Python fallback denied commands carrying OLO_NOT_A_BUILD / OLO_BUILD_LOCK_OVERRIDE. Reproduced by running the fallback; now accepts all three markers.
  • c5508f4: the /start-work §5c /goal block ran prose into the goal condition; cleanup-worktree's trap paragraph cited check (b) for check (c); neither cleanup nor resume could classify a detached or bot-branch worktree.
  • 2b3c054: task-loop Phase 2's build snippet bypassed build-lock (the hook blocks it), used the msvc tree and /tmp; CLAUDE.md's test command pointed at the msvc tree.
  • 67ec559: .gitignore ignores .claude/* except a whitelist, so .claude/rules/ and .claude/agents/ would never have been committed.
  • Not a repo change: the seven olo-* mods had never been installed on the maintainer box since they landed (2026-10-10), so none of their guards ran. Installed; Phase 0 and claude-code-mods.md now say how to verify.

Filed, not fixed

None. ci-triage's test run found three deterministic failures in the AMD nightly; they were already tracked, so the triage went to #1516 as a comment (fixing them needs the AMD runner).

Review guide

Where I'd look hardest

  1. .claude/rules/*.md: the paths: globs decide when each rule loads. Each glob was checked to match real files; a wrong one fails silently.
  2. .claude/scripts/worktree_status.py: it decides what /cleanup-worktree deletes. A gh query failure raises rather than reading as "no PR".
  3. The 79 docs/agent-rules/<name>.md rule files were written by Sonnet subagents from the details files under a fixed brief. Content cannot be lost (the details files are byte-identical to the originals apart from a back-link and retargeted anchors), but a rule summary can be worded worse than its source.

What I verified, and how

  • worktree_status.py against the four live worktrees: classified the dirty feature/* at master's commit as incomplete-dirty (the trap), the detached baseline as completed, the renovate branch as incomplete-open-pr.
  • new-task-worktree.sh end to end on a throwaway slug (created with no upstream, then removed); its guards refuse a bad slug and an existing path.
  • A fresh claude -p session in this worktree, with no junction: its auto-memory dir was the base store and MEMORY.md was loaded; all four agents load; the three workflow skills are hidden from the model.
  • ci-triage on PR chore(deps): update ocornut/imgui digest to d88f238 #1639 (correctly found no current-head failures) and on run 39351974689 (three real failures with quoted log lines).
  • olo-command-guards refusal and olo-output-truth annotation both reach an Agent-tool subagent.
  • Build-lock fallback run directly with four commands: both markers and build-lock allowed, a bare cmake --build denied.
  • claude plugin test .claude/mods/olo-known-traps: 4/4.
  • Split integrity: a script compared every details file with git show HEAD:<name>.md; all 79 rule files are ≤10,000 bytes and end with the details link; README/failure-modes keep every link of the old index (multiset compare).
  • pre-commit run --all-files passes, including docs-consistency with 0 errors.

Verification matrix: single path. This changes agent configuration and documentation only; no engine, shader or build code.

Least confident about
spec-reviewer, live-verifier and rules-lookup were checked to load but not exercised on a real task; their first uses in a worker session are the test. live-verifier also has not yet confirmed that olo-evidence records captures made inside a subagent (the mod mechanism is the same one verified above).

🤖 Generated with Claude Code

drsnuggles8 and others added 5 commits October 20, 2026 12:21
Four project subagents in .claude/agents/, each for a step of the worker loop that
otherwise floods the main session's context or needs a fresh pair of eyes:

- ci-triage: classifies failed CI jobs (infra / flake / real / known issue) from the job
  logs and the CI memory notes; read-only.
- spec-reviewer: checks a branch against HANDOVER.md, the issue's acceptance criteria, the
  verification matrix, Phase 1a bug accounting and ECS cross-binding touch-points; reports
  requirement gaps only.
- live-verifier: drives a live editor over the MCP server for one matrix cell or A/B and
  returns measurements, PNG paths and log checks.
- rules-lookup: Haiku lookup of the agent rules that apply to some files or a symptom.

.gitignore whitelists .claude/agents/ and .claude/rules/ (the whole .claude/ tree is
ignored by default, so neither would have been committed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ripts

/start-work, /cleanup-worktree and /resume-worktrees move from .claude/commands/ to
.claude/skills/<name>/SKILL.md with disable-model-invocation: true: they create and delete
worktrees, post issue comments and kill processes, so only the user starts them.

Deterministic steps move out of prose into scripts:
- .claude/scripts/worktree_status.py: the one completed/incomplete gate both cleanup and
  resume use (read-only). It also classifies detached and non-feature/* worktrees, which
  neither command handled.
- start-work/scripts/new-task-worktree.sh: path validation + `worktree add --no-track`
  from Bash (the PowerShell tool mangles that command's arguments).
- resume-worktrees/scripts/open-vscode-folders.ps1: the EnumWindows window detection.

/start-work drops from 41 KB to ~15 KB: the model rubric moves to model-rubric.md, the
per-worktree memory junction is deleted (Claude Code derives auto memory from the git
repository, so worktrees already share the base store; verified with a fresh worktree
session), /goal becomes the default kickoff (the old block ran prose into the condition),
and the HANDOVER points at CLAUDE.md's guardrails instead of quoting them.
/resume-worktrees tells the user to resume the earlier session rather than re-prime from a
stale HANDOVER. cleanup-worktree's trap paragraph cited check (b) for what is check (c).

The Codex wrappers, docs/README.md and an olo-known-traps advice line follow the move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ale allow rules

The no-Python fallback of the build-lock PreToolUse hook only recognised the legacy
OLO_BUILD_LOCK_BYPASS, so a command correctly marked OLO_NOT_A_BUILD or
OLO_BUILD_LOCK_OVERRIDE was denied (reproduced by running the fallback directly). It now
accepts all three, and its deny message names OLO_NOT_A_BUILD.

The allow list loses four rules for the retired D:/repos checkout and a one-off gtest
filter, and gains the build-cached test binary (the default preset's tree) and
worktree_status.py. _comment names the current markers and notes that the olo-* mods are
installed per machine, not enabled by this file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he index by symptom

79 guides were over the house limit of ~10 KB (1.87 MB together; rhi-abstraction-boundary
alone was 206 KB), and agents read them in full before touching a subsystem.

Each one is now two files:
- <name>-details.md: the complete original text, unchanged apart from a back-link line and
  retargeted anchors (checked by script against HEAD).
- <name>.md: the guide's rules, rule first, each linking to its section in the details file;
  under 10 KB each, ~600 KB for all 79.

The index README.md (155 KB) keeps Part A, one sentence per guide (46 KB); Part B moves to
failure-modes.md. Every link of both parts is kept. "Adding a doc here" describes the
rules/details layout.

Inbound links whose anchor moved to a details file are retargeted, and the one contract doc
that was split (vulkan-command-ordered-buffer-writes) keeps its details file under the
docs-consistency contract-name check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… loop that uses them

CLAUDE.md loads into every session and had grown to 247 lines / 14.8 KB, telling every
session to read six guides (~220 KB) regardless of subsystem. It is now 185 lines /
10.7 KB: the per-subsystem sections move to nine path-scoped rules in .claude/rules/
(shaders, renderer verification, ECS components, tests, gameplay scheduler, assets,
dependencies, docs, Claude configuration) that load only when a matching file is touched.
It gains a compaction section, and its test command points at the default build-cached tree.
"For other agents" moves to AGENTS.md, which Claude Code does not read when CLAUDE.md
exists; AGENTS.md now also tells other agents to read the matching .claude/rules files.

task-loop.md:
- Phase 0 no longer re-reads CLAUDE.md or the whole index; it asks rules-lookup, and it
  proves the olo-* mods are loaded with a positive control (they were never installed on the
  maintainer box for ten days while the docs described them as enforcing).
- Phase 2's build snippet went around build-lock (the hook blocks it), used the msvc tree
  and wrote to /tmp; it now goes through the lock on build-cached and checks the log.
- Phases 2b, 3 and 5b hand capture, spec review and CI log triage to the new subagents.
- Turns normally run under the /goal kickoff; MEMORY.md guidance names its 200-line /
  25 KB load limit; the memory-junction text is gone.

claude-code-mods.md gives the full per-machine install and how to verify it, and records
that the mods fire inside subagents too (verified with a refusal and an output-truth note).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 201 files, which is 101 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration
  • Configuration used: Repository YAML (base), Repository UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c4546168-b610-48eb-bac4-f0146cbd1cd6
📥 Commits

Reviewing files that changed from the base of the PR and between 3d0fa1d and 2b3c054.

📒 Files selected for processing: 201
  • .claude/.markdownlint-cli2.jsonc
  • .claude/agents/ci-triage.md
  • .claude/agents/live-verifier.md
  • .claude/agents/rules-lookup.md
  • .claude/agents/spec-reviewer.md
  • .claude/commands/cleanup-worktree.md
  • .claude/commands/resume-worktrees.md
  • .claude/commands/start-work.md
  • .claude/mods/olo-known-traps/hooks/traps.ts
  • .claude/rules/assets.md
  • .claude/rules/claude-config.md
  • .claude/rules/dependencies.md
  • .claude/rules/ecs-components.md
  • .claude/rules/gameplay-scheduler.md
  • .claude/rules/renderer-verification.md
  • .claude/rules/shaders.md
  • .claude/rules/tests.md
  • .claude/rules/writing-docs.md
  • .claude/scripts/worktree_status.py
  • .claude/settings.json
  • .claude/skills/cleanup-worktree/SKILL.md
  • .claude/skills/resume-worktrees/SKILL.md
  • .claude/skills/resume-worktrees/scripts/open-vscode-folders.ps1
  • .claude/skills/run-oloengine/SKILL.md
  • .claude/skills/start-work/SKILL.md
  • .claude/skills/start-work/model-rubric.md
  • .claude/skills/start-work/scripts/new-task-worktree.sh
  • .codex/skills/cleanup-worktree/SKILL.md
  • .codex/skills/start-work/SKILL.md
  • .gitignore
  • AGENTS.md
  • CLAUDE.md
  • docs/README.md
  • docs/agent-rules/README.md
  • docs/agent-rules/actions-cache-budget-details.md
  • docs/agent-rules/actions-cache-budget.md
  • docs/agent-rules/audio-voice-budget-details.md
  • docs/agent-rules/audio-voice-budget.md
  • docs/agent-rules/baked-lightmap-pipeline-details.md
  • docs/agent-rules/baked-lightmap-pipeline.md
  • docs/agent-rules/binary-greedy-voxel-meshing-details.md
  • docs/agent-rules/binary-greedy-voxel-meshing.md
  • docs/agent-rules/build-memory-per-tu-details.md
  • docs/agent-rules/build-memory-per-tu.md
  • docs/agent-rules/build-trees-and-windows-asan-details.md
  • docs/agent-rules/build-trees-and-windows-asan.md
  • docs/agent-rules/camera-relative-rendering-details.md
  • docs/agent-rules/camera-relative-rendering.md
  • docs/agent-rules/ci-cache-that-looks-alive-details.md
  • docs/agent-rules/ci-cache-that-looks-alive.md
  • docs/agent-rules/claude-code-mods.md
  • docs/agent-rules/cluster-lod-simplification-details.md
  • docs/agent-rules/cluster-lod-simplification.md
  • docs/agent-rules/component-serializer-codegen-details.md
  • docs/agent-rules/component-serializer-codegen.md
  • docs/agent-rules/cpp-coding-quality-details.md
  • docs/agent-rules/cpp-coding-quality.md
  • docs/agent-rules/cpu-gpu-surface-parity-details.md
  • docs/agent-rules/cpu-gpu-surface-parity.md
  • docs/agent-rules/cross-test-renderer-state-details.md
  • docs/agent-rules/cross-test-renderer-state.md
  • docs/agent-rules/ddgi-probe-cascades-and-sparsity-details.md
  • docs/agent-rules/ddgi-probe-cascades-and-sparsity.md
  • docs/agent-rules/deformed-surfaces-in-acceleration-structures-details.md
  • docs/agent-rules/deformed-surfaces-in-acceleration-structures.md
  • docs/agent-rules/failure-modes.md
  • docs/agent-rules/floating-origin-rebase-subsystems-details.md
  • docs/agent-rules/floating-origin-rebase-subsystems.md
  • docs/agent-rules/follow-camera-and-character-query-seams-details.md
  • docs/agent-rules/follow-camera-and-character-query-seams.md
  • docs/agent-rules/force-model-vehicles-details.md
  • docs/agent-rules/force-model-vehicles.md
  • docs/agent-rules/gl-global-setter-resets-indexed-state-details.md
  • docs/agent-rules/gl-global-setter-resets-indexed-state.md
  • docs/agent-rules/glsl-shaders-details.md
  • docs/agent-rules/glsl-shaders.md
  • docs/agent-rules/gpu-debug-draws-details.md
  • docs/agent-rules/gpu-debug-draws.md
  • docs/agent-rules/gpu-path-tracer-details.md
  • docs/agent-rules/gpu-path-tracer.md
  • docs/agent-rules/gpu-readback-stats-channel-details.md
  • docs/agent-rules/gpu-readback-stats-channel.md
  • docs/agent-rules/gpu-scan-compaction-details.md
  • docs/agent-rules/gpu-scan-compaction.md
  • docs/agent-rules/gpu-scene-record-contract-details.md
  • docs/agent-rules/gpu-scene-record-contract.md
  • docs/agent-rules/groom-card-coverage-details.md
  • docs/agent-rules/groom-card-coverage.md
  • docs/agent-rules/groom-coat-self-shadowing-details.md
  • docs/agent-rules/groom-coat-self-shadowing.md
  • docs/agent-rules/groom-deformed-coat-self-shadowing-details.md
  • docs/agent-rules/groom-deformed-coat-self-shadowing.md
  • docs/agent-rules/groom-guide-simulation-details.md
  • docs/agent-rules/groom-guide-simulation.md
  • docs/agent-rules/groom-into-the-shadow-techniques-details.md
  • docs/agent-rules/groom-into-the-shadow-techniques.md
  • docs/agent-rules/groom-representation-lod-details.md
  • docs/agent-rules/groom-representation-lod.md
  • docs/agent-rules/groom-strand-visibility-details.md
  • docs/agent-rules/groom-strand-visibility.md
  • docs/agent-rules/groom-surface-binding-details.md
  • docs/agent-rules/groom-surface-binding.md
  • docs/agent-rules/lazy-static-release-ownership-details.md
  • docs/agent-rules/lazy-static-release-ownership.md
  • docs/agent-rules/lighting-signal-contract-details.md
  • docs/agent-rules/lighting-signal-contract.md
  • docs/agent-rules/lightmap-receiver-identity-details.md
  • docs/agent-rules/lightmap-receiver-identity.md
  • docs/agent-rules/live-verification-noise-floor-details.md
  • docs/agent-rules/live-verification-noise-floor.md
  • docs/agent-rules/mcp-protocol-eras-details.md
  • docs/agent-rules/mcp-protocol-eras.md
  • docs/agent-rules/multi-animal-scheduling-budgets-details.md
  • docs/agent-rules/multi-animal-scheduling-budgets.md
  • docs/agent-rules/multi-mode-block-format-encoders-details.md
  • docs/agent-rules/multi-mode-block-format-encoders.md
  • docs/agent-rules/non-recursive-lock-self-locking-helper-details.md
  • docs/agent-rules/non-recursive-lock-self-locking-helper.md
  • docs/agent-rules/notes-audio-animation-sim-details.md
  • docs/agent-rules/notes-audio-animation-sim.md
  • docs/agent-rules/notes-core-and-threading-details.md
  • docs/agent-rules/notes-core-and-threading.md
  • docs/agent-rules/notes-editor-and-assets-details.md
  • docs/agent-rules/notes-editor-and-assets.md
  • docs/agent-rules/notes-gameplay-physics-nav-details.md
  • docs/agent-rules/notes-gameplay-physics-nav.md
  • docs/agent-rules/notes-mcp-tool-authoring-details.md
  • docs/agent-rules/notes-mcp-tool-authoring.md
  • docs/agent-rules/notes-renderer-details.md
  • docs/agent-rules/notes-renderer.md
  • docs/agent-rules/observer-camera-details.md
  • docs/agent-rules/observer-camera.md
  • docs/agent-rules/persistent-world-space-fields-details.md
  • docs/agent-rules/persistent-world-space-fields.md
  • docs/agent-rules/pixel-error-mesh-lod-details.md
  • docs/agent-rules/pixel-error-mesh-lod.md
  • docs/agent-rules/reference-path-tracer-details.md
  • docs/agent-rules/reference-path-tracer.md
  • docs/agent-rules/render-graph-setup-declaration-gates.md
  • docs/agent-rules/render-graph-transient-aliasing-details.md
  • docs/agent-rules/render-graph-transient-aliasing.md
  • docs/agent-rules/render-pipeline-caches-details.md
  • docs/agent-rules/render-pipeline-caches.md
  • docs/agent-rules/rhi-abstraction-boundary-details.md
  • docs/agent-rules/rhi-abstraction-boundary.md
  • docs/agent-rules/screen-space-denoiser-chain-details.md
  • docs/agent-rules/screen-space-denoiser-chain.md
  • docs/agent-rules/script-structural-command-safe-point-details.md
  • docs/agent-rules/script-structural-command-safe-point.md
  • docs/agent-rules/server-authoritative-networking-loop-details.md
  • docs/agent-rules/server-authoritative-networking-loop.md
  • docs/agent-rules/shared-atlas-allocator-details.md
  • docs/agent-rules/shared-atlas-allocator.md
  • docs/agent-rules/shared-temp-dir-test-isolation-details.md
  • docs/agent-rules/shared-temp-dir-test-isolation.md
  • docs/agent-rules/sonarqube-review-alignment-details.md
  • docs/agent-rules/sonarqube-review-alignment.md
  • docs/agent-rules/steamworks-platform-integration-details.md
  • docs/agent-rules/steamworks-platform-integration.md
  • docs/agent-rules/stochastic-sampling-and-temporal-resolve-details.md
  • docs/agent-rules/stochastic-sampling-and-temporal-resolve.md
  • docs/agent-rules/structural-collapse-details.md
  • docs/agent-rules/structural-collapse.md
  • docs/agent-rules/substituted-seams-compound-details.md
  • docs/agent-rules/substituted-seams-compound.md
  • docs/agent-rules/temporal-reactivity-separation-details.md
  • docs/agent-rules/temporal-reactivity-separation.md
  • docs/agent-rules/terrain-gpu-lod-quadtree-details.md
  • docs/agent-rules/terrain-gpu-lod-quadtree.md
  • docs/agent-rules/terrain-tile-meets-ocean-details.md
  • docs/agent-rules/terrain-tile-meets-ocean.md
  • docs/agent-rules/terrain-virtual-texturing-details.md
  • docs/agent-rules/terrain-virtual-texturing.md
  • docs/agent-rules/testing-architecture-details.md
  • docs/agent-rules/testing-architecture.md
  • docs/agent-rules/variable-rate-compute-shading-details.md
  • docs/agent-rules/variable-rate-compute-shading.md
  • docs/agent-rules/vcpkg-dependency-management-details.md
  • docs/agent-rules/vcpkg-dependency-management.md
  • docs/agent-rules/vendor-golden-baseline-crosscheck-details.md
  • docs/agent-rules/vendor-golden-baseline-crosscheck.md
  • docs/agent-rules/virtual-shadow-map-page-cache-details.md
  • docs/agent-rules/virtual-shadow-map-page-cache.md
  • docs/agent-rules/volumetric-cloud-debugging-details.md
  • docs/agent-rules/volumetric-cloud-debugging.md
  • docs/agent-rules/vulkan-command-ordered-buffer-writes-details.md
  • docs/agent-rules/vulkan-command-ordered-buffer-writes.md
  • docs/agent-rules/vulkan-parallel-pass-audit-details.md
  • docs/agent-rules/vulkan-parallel-pass-audit.md
  • docs/agent-rules/vulkan-parallel-recording-details.md
  • docs/agent-rules/vulkan-parallel-recording.md
  • docs/agent-rules/vulkan-ray-tracing-acceleration-structures-details.md
  • docs/agent-rules/vulkan-ray-tracing-acceleration-structures.md
  • docs/agent-rules/vulkan-shader-heap-indexing-details.md
  • docs/agent-rules/vulkan-shader-heap-indexing.md
  • docs/agent-rules/windows-sccache-warm-reuse.md
  • docs/agent-rules/worktree-shared-build-outputs.md
  • docs/analysis/sonarqube-rules.md
  • docs/guides/renderer-support-matrix.md
  • docs/process/task-loop.md
  • scripts/check_docs_consistency.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@drsnuggles8
drsnuggles8 merged commit e181ef9 into master Oct 20, 2026
19 of 22 checks passed
@drsnuggles8
drsnuggles8 deleted the feature/claude-workflow-audit branch October 20, 2026 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant