Files
NixOsConfig/CLAUDE.md
T
Claude 41cd2f1e65 Update CLAUDE.md overview for the dendritic layout; implementer effort xhigh
The Repository overview now describes the flake-parts + import-tree
structure, the Gitea remote and the new secrets. In the orchestration
policy only the mao-implementer effort cell changes (max -> xhigh), to
match the agent frontmatter.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JZ16yf4acmaSiHq81vyQ6Z
2026-10-12 20:58:09 +00:00

108 lines
5.2 KiB
Markdown

# CLAUDE.md
## Repository overview
NixOS flake for the `desktop` host (user `faumaray`) in the dendritic layout:
every `.nix` file under `modules/` is a flake-parts module, imported by
import-tree. Features ("aspects") are `flake.modules.nixos.<name>` and
`flake.modules.homeManager.<name>`; a host imports the aspects it wants.
Stack: flake-parts, home-manager (NixOS module), agenix, disko, lanzaboote
(Secure Boot), Hyprland (own flake and overlay) + Noctalia, Stylix theming,
WezTerm, Neovim, Steam + Proton, proxy-suite, Docker and a Gitea runner,
Claude Code with MCP servers, full AMD support.
The canonical remote is Gitea (https://git.faumaray.com/faumaray/NixOsConfig);
GitHub is a secondary remote. Pull requests and issues are handled through the
Gitea MCP tools.
- `flake.nix`: inputs and `nixConfig`; `outputs` is flake-parts over import-tree
of `modules/`.
- `modules/flake/`: glue: systems, `meta` (shared data), host construction
(`configurations.nixos`), overlays, packages, apps, dev shell, formatter, checks.
- `modules/users/`: `meta.owner`, the user identity every aspect reads.
- `modules/core/`: the `core` aspect every host imports (nix, nixpkgs, boot,
locale, networking, users, home-manager, facts for install-system; agenix
joins it from `modules/security/secrets.nix`).
- `modules/<area>/`: aspects (`boot`, `hardware`, `security`, `network`, `dev`,
`desktop`, `theme`, `cli`, `ai`, `gaming`); one file can define the NixOS and
the home-manager half of a feature.
- `modules/hosts/<name>/`: a host: aspect lists and host-only values
(`modules/hosts/desktop/host.nix`, plus `hardware.nix` and `disks.nix`).
- `modules/installer/`: the installer ISO.
- `hosts/<name>/`: files install-system writes (`hardware-configuration.nix`,
`disk-ids.json`); not modules.
- `pkgs/`: install, key and secret helpers (`nix run .#<app>`; the apps are
declared in `modules/flake/apps.nix`).
- `secrets/`: `secrets.nix` (recipients) and encrypted `*.age` files, all
optional (login password, SSH keys, `secrets/gitea-runner-token.age`,
`secrets/tg-ws-proxy-secret.age`). Never commit plaintext or `keys/`.
Conventions: format with `nix fmt` (nixfmt). New behaviour is a new aspect,
not an `enable` option: importing an aspect enables it. Shared values come from
`config.meta`, bound in a `let` before any NixOS/home-manager module;
home-manager halves read the system through `osConfig`. Theming goes through
`modules/theme/stylix.nix`. Keep host files small.
Checks: `nix flake check --no-build` and
`nix eval .#nixosConfigurations.desktop.config.system.build.toplevel.drvPath`.
## Multi-agent orchestration policy
**Scope:** this section applies **only to the main session**. Subagents
perform the role they were assigned (see `.claude/agents/*.md`) and do **not**
re-delegate it or act as orchestrators.
### Roles
| Agent | Model / effort | Purpose |
|---|---|---|
| main session | `fable` / `max` (see `.claude/settings.json`) | Orchestrator |
| `mao-designer` | opus / max | Designs, acceptance criteria, escalations |
| `mao-implementer` | sonnet / xhigh | Implements, tests, self-reviews |
| `mao-sonnet-reviewer` | sonnet / max | Independent implementation review |
| `mao-opus-reviewer` | opus / max | Final independent review |
| `mao-helper` | haiku | Searches, summaries, routine git |
### Orchestrator duties
1. The main session **orchestrates**. It decomposes work, delegates, tracks
progress and attempt counts, resolves escalations, and reports results.
It delegates implementation, investigation, testing and review to agents
rather than doing them itself.
2. Before delegating, define for each task: **objective, scope, acceptance
criteria, relevant files, and the expected report**.
3. Use **named agents** (the `mao-*` agents above) so collaborators can
address each other.
4. **Parallelize independent work only.** Never have two agents edit the same
files at the same time.
5. The implementer runs the relevant checks and self-reviews before reporting.
6. Use a **fresh `mao-sonnet-reviewer`** for an independent implementation
review.
7. Use a **fresh `mao-opus-reviewer`** for the final independent review of
substantive code changes. Never reuse the design agent's conversation for
this review.
### Attempts and escalation
- Track failed attempts **per task**. An *attempt* is a proposed solution that
was checked against the acceptance criteria. It is not one tool call.
- After **3 unsuccessful implementation attempts**, stop Sonnet retries and
escalate to `mao-designer` (Opus) with the evidence.
- After **3 unsuccessful design/correction attempts by Opus**, escalate to the
main orchestrator.
- The orchestrator must then **change the approach, narrow the task, or
request necessary user input**. Do not reset the counters and repeat the
same loop.
### Communication
- Use `SendMessage` for direct agent-to-agent communication when it is
available.
- Use `ListAgents` only if it is actually exposed in the session. Otherwise
use the known agent names, or relay through the orchestrator.
### Reports
Every agent report must include: **result, changed files, checks actually
run (with real outcomes), unresolved issues, and attempt count**. Report
unavailable agents, models or tools, and any fallback used, explicitly.