Skip to content

Release: v7.12.0 — flow claude check: Claude Code environment health#474

Merged
Data-Wise merged 30 commits into
mainfrom
dev
Jun 19, 2026
Merged

Release: v7.12.0 — flow claude check: Claude Code environment health#474
Data-Wise merged 30 commits into
mainfrom
dev

Conversation

@Data-Wise

Copy link
Copy Markdown
Owner

Summary

  • flow claude check (C1–C6): new flow claude subcommand for Claude Code environment health (commands/claude.zsh)
    • C1 Settings parity — settings.json env block vs zshrc exports
    • C2 Hook health — post-compact-reinject.sh exists, executable, shellcheck clean
    • C3 Memory index drift — .md file count vs MEMORY.md entry count per project
    • C4 CLAUDE.md length — warns when > 100 lines
    • C5 Shell env parity — CLAUDE_AUTOCOMPACT_PCT_OVERRIDE exported
    • C6 Output token limit — warns when CLAUDE_CODE_MAX_OUTPUT_TOKENS unset or ≤ 8192
  • flow claude check --fix: auto-repairs C1 and C6 mismatches in zshrc
  • Tutorial 49, docs/commands/claude.md, docs/troubleshooting/CLAUDE-CODE-ENVIRONMENT.md
  • Man page: man/man1/flow-claude.1
  • 66/66 test suites passing (added test-flow-claude.zsh to run-all.sh)

Fixes

  • C3 ZSH glob (/N) qualifier to prevent "no matches found" errors
  • ZSH stdout leak in C1 (while-loop) and C3 (for-loop): hoisted local declarations above loop bodies

Test plan

  • ./tests/run-all.sh — 66 passed, 0 failed, 1 skipped (e2e-em-dispatcher)
  • zsh tests/test-flow-claude.zsh — all tests pass
  • zsh tests/test-manpage-version-sync.zsh — man page versions aligned
  • Version grep confirms no stale 7.11.0 refs (except intentional "since" annotations)

🤖 Generated with Claude Code

Test User and others added 30 commits June 17, 2026 22:49
…+ Homebrew]

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The global var has highest priority and overrides per-task subagent routing
(craft orchestrator-v2 does haiku-for-reads/sonnet-for-writes), forcing cheap
haiku agents up to sonnet (~5x). Let subagents self-route; pass model: per spawn.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…s 4-6)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat(at): completions + help/man for atlas v0.9.3 flags (items 4-6)
Grilled design decisions: new top-level `flow claude` subcommand,
5 checks (settings parity, hook health, memory index drift,
CLAUDE.md length, shell env parity), --fix updates zshrc only,
settings.json is canonical source of truth.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zshrc: bump AUTOCOMPACT 55→65 to match settings.json (canonical),
add doc comment for opusplan model setting.
concepts.json: prettier array formatting (no data change).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…validator

project-detector.zsh validates .branches.draft and .branches.production but
the config used git.draft_branch / git.production_branch — a schema mismatch
that caused two ✗ errors in `work flow-cli` output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…g config validator

branches.draft / branches.production were the only accepted keys, but the
git.draft_branch / git.production_branch schema (used by some existing configs)
is equally valid. Now accepts either form before emitting a validation error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Validator now accepts git.draft_branch / git.production_branch directly,
so the branches: alias added as a workaround is no longer needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Validator now accepts either branches.draft/branches.production or
git.draft_branch/git.production_branch. Updated TEACH-CONFIG-SCHEMA.md
Required Fields and TEACHING-WORKFLOW.md to reflect both accepted forms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tor.zsh (#468)

* docs: bump ATLAS-CONTRACT.md to v1.1.0 + fix two OOS doctor.zsh calls

ATLAS-CONTRACT.md (v1.0.0 → v1.1.0):
- Add Version Compatibility row: flow-cli v7.10.x ↔ atlas v0.9.3
- Document 5 new contracted flags (session status --format, project list
  --count, project list --suggest, inbox --count, trail --limit)
- Add `atlas session status` to Warm Path Commands table
- Replace universal --format claim with per-command support matrix
  (project list: table|json|names; project show: +shell; session status:
  table|json; stats: table|json|text|md; session export: ical|json)
- Add contract sections for each new flag with exact output semantics
- Update Parties line to v7.10.x / v0.9.3

commands/doctor.zsh (OOS-1, OOS-2):
- OOS-1: replace `atlas config get backend` (non-existent subcommand)
  with `atlas config show | jq '.storage'` (with grep/sed fallback)
- OOS-2: replace `atlas mcp status` (non-existent subcommand) with
  `command -v atlas-mcp` (atlas-mcp is a separate binary declared in
  atlas package.json bin, not an atlas subcommand)

Co-Authored-By: Claude (scheduled agent) <noreply@anthropic.com>

* fix(doctor): gate atlas 'connected' on real response + harden backend parse; document config show

Addresses the adversarial review of the atlas-contract-v1.1 changes. Verified
against atlas source (bin/atlas.js:1122 — config show emits JSON.stringify(cfg,
null, 2); package.json bin — atlas-mcp is a separate binary), so the OOS-1/OOS-2
fixes are confirmed correct. Remaining issues fixed:

- doctor.zsh: '✓ connected' fired whenever 'command -v atlas' succeeded, so a
  broken/half-installed atlas (e.g. bad interpreter shebang) was reported as
  connected. Now gated on 'atlas config show' actually returning output; a
  non-responding atlas shows '⚠ installed but not responding'. Verified against
  the local broken atlas.
- doctor.zsh: anchored the no-jq .storage parse on the "storage" key so it
  doesn't greedily capture the last quoted value (wrong for compact JSON).
- ATLAS-CONTRACT.md: documented 'atlas config show' (which doctor.zsh depends on)
  — full config as pretty JSON, '.storage' is the backend (filesystem|sqlite),
  no 'atlas config get' subcommand exists.
- tests/test-doctor-atlas-calls.zsh: static spec-compliance regression guard
  (no working-atlas/jq dependency); registered in run-all.sh.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Test User <test@example.com>
…update testing

- 6 → 7 required hot-path commands (atlas inbox --count was added)
- Add --- dividers before the four v0.9.3 contract detail sections
- Testing section now lists both test files with their distinct roles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New command reference page, QUICK-REFERENCE section, MASTER-DISPATCHER-GUIDE
section, mkdocs nav entry, and troubleshooting pointer for the flow claude
check subcommand (C1–C6 checks + --fix). Docs written against finalized spec
ahead of feature/flow-claude worktree merge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers all 6 checks (C1–C6), --fix behavior, exit codes, and manual
remediation steps for the two unfixable checks (hook health, memory drift).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds `flow claude check` (alias: `flow claude doctor`) — a health checker
for the Claude Code environment. Runs 5 checks:

- C1 Settings parity: settings.json env block vs zshrc exports (auto-fixable with --fix)
- C2 Hook health: post-compact-reinject.sh exists, executable, shellcheck clean
- C3 Memory index drift: .md file count vs MEMORY.md entry count per project
- C4 CLAUDE.md length: warns when > 100 lines
- C5 Shell env parity: CLAUDE_AUTOCOMPACT_PCT_OVERRIDE reported informational

Exit codes: 0=all pass, 1=any ERROR, 2=any WARN (no ERROR).
Paths injectable via FLOW_CLAUDE_HOME / FLOW_CLAUDE_ZSHRC for testing.

Files: commands/claude.zsh (new), man/man1/flow-claude.1 (new),
tests/test-flow-claude.zsh (new, 17 tests), plus wiring in commands/flow.zsh,
completions/_flow, docs/help/QUICK-REFERENCE.md, CLAUDE.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds C6 check to `flow claude check` that warns when
CLAUDE_CODE_MAX_OUTPUT_TOKENS is unset or ≤ 8192 (the default cap).
Reads from settings.json env block first (via jq), falls back to zshrc
grep. Auto-fixable with --fix (delegates to _flow_claude_fix_c1).

Also fixes a latent C3 bug: the glob `"$memory_dir"/*/memory` throws
a ZSH `no matches found` fatal error when projects/ exists but is
empty. Changed to `(/N)` (directory-only + null-glob) to suppress.

Test suite: 21 tests, 65/65 suites passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: add flow claude check subcommand
…E cleanup

- Add Unreleased CHANGELOG entry for flow claude check (C1–C6, --fix, C3 glob fix, docs)
- Add _flow_claude_check / _flow_claude_fix_c1 / _flow_claude_fix_c6 / _flow_claude_help to MASTER-API-REFERENCE
- Update test counts: 217 files, 66 suites, 65 passed (3 locations in TESTING.md + CLAUDE.md)
- Delete ORCHESTRATE-flow-claude.md (post-merge worktree artifact cleanup)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…out leak

ZSH prints a variable's old value to stdout when `local var` re-declares
an already-local variable inside a loop. Hoisting `key`, `val`, `zshrc_val`
(C1 while-loop) and `memory_md`, `file_count`, `entry_count`, `proj_name`
(C3 for-loop) above their respective loops eliminates the leak.

Also includes zsh/.zshrc: export CLAUDE_CODE_MAX_OUTPUT_TOKENS=32000 (from
`flow claude check --fix` dogfood run).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace `sed -i ''` (BSD-only) with a temp-file redirect so the
in-place update works on both macOS (BSD sed) and Linux CI (GNU sed).
GNU sed treats the separate empty-string arg as the sed expression,
silently leaving the file unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Data-Wise Data-Wise merged commit 518f1f0 into main Jun 19, 2026
4 checks passed
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