Skip to content

feat(llm-assistants): enrich subagent config with effort, memory, and team presets#65

Merged
hakula139 merged 2 commits intomainfrom
feat/subagent-config
Apr 14, 2026
Merged

feat(llm-assistants): enrich subagent config with effort, memory, and team presets#65
hakula139 merged 2 commits intomainfrom
feat/subagent-config

Conversation

@hakula139
Copy link
Copy Markdown
Owner

Summary

  • Add six new frontmatter parameters (effort, memory, permissionMode, background, maxTurns, isolation) to all Claude Code subagent definitions, enabling cost-aware model routing, persistent cross-session knowledge, and formal read-only enforcement
  • Assign per-agent effort levels based on task complexity: high for deep-reasoning agents (architect, reviewer, debugger, implementer), medium for balanced agents (tester, usability-reviewer), low for speed-oriented agents (researcher, codex-worker)
  • Enable persistent local memory on all seven agent roles so each accumulates project-specific institutional knowledge across sessions (architectural patterns, recurring issues, file maps, coding conventions, test patterns, debugging dead ends)
  • Formalize read-only enforcement via permissionMode: plan on the four agents that were previously read-only by behavioral convention only (architect, researcher, reviewer, usability-reviewer)
  • Set background: true on researcher and codex-worker as default non-blocking execution for exploratory tasks
  • Add maxTurns: 30 safety cap on codex-worker to prevent runaway haiku-tier delegation loops
  • DRY up the frontmatter renderer with a declarative renderField helper that reduces 8 repetitive lib.optional lines to a single concatMap over a field spec list, making new fields a one-liner addition
  • Switch tools rendering from YAML list to comma-separated format (tools: Read, Grep, Glob) matching Anthropic's docs style, applied to both the renderer and codex-worker.md
  • Merge "Coordination Patterns" and "Team Presets" in CLAUDE.md instructions into a single section with inline mode annotations (Subagents vs Agent Team), eliminating duplication between the previous three overlapping sections
  • Add persistent memory prompts to all seven agent role definitions, instructing each to consult and update its agent memory with role-appropriate knowledge

Architecture

  • Why effort per agent: The blog post and Anthropic docs describe effort as a cost-quality lever orthogonal to model selection. A haiku researcher at low effort returns fast lookups cheaply; an opus architect at high effort produces thorough analysis. Combined with model choice, this gives fine-grained control over cost per delegation.
  • Why memory: local: Local scope (.claude/agent-memory-local/) keeps agent knowledge project-specific without adding files to version control. All agents benefit from accumulated knowledge — the debugger remembers failed approaches, the implementer remembers codebase conventions, the researcher remembers file locations. The cost is a directory on disk; the benefit compounds over sessions.
  • Why permissionMode: plan over disallowedTools: The four read-only agents were previously constrained by prompt instructions alone. permissionMode: plan formalizes this at the runtime level while still allowing boundary exceptions when genuinely needed (unlike a hard tool denylist).
  • Why merge coordination patterns and team presets: The previous structure had three overlapping sections describing the same workflows at different granularity (abstract patterns, concrete team compositions, detailed step-by-step). Merging into a single list with mode annotations (Subagents / Agent Team) per entry eliminates duplication while preserving all information.
  • Why renderField helper: The previous 8 lib.optional lines followed an identical pattern differing only in field name and formatter. The declarative spec list makes the field set scannable, and adding a new field is a one-liner. String entries default to toString (works for strings and ints); only background needs lib.boolToString.

Test plan

  • nix fmt passes on all modified Nix files
  • statix check passes (no anti-patterns)
  • deadnix --fail passes (no unused bindings)
  • Pre-commit hooks all pass
  • nix build '.#homeConfigurations.hakula-linux.activationPackage' --dry-run succeeds
  • nix eval '.#nixosConfigurations.us-4.config.system.build.toplevel.drvPath' succeeds

… team presets

Add frontmatter parameters (effort, memory, permissionMode, background,
maxTurns, isolation) to all Claude Code subagent definitions for
cost-aware model routing and persistent cross-session knowledge. DRY up
the frontmatter renderer with a declarative renderField helper. Add
named coordination patterns (feature-dev, parallel-review, investigation,
research-swarm) to CLAUDE.md instructions with subagent-vs-team mode
annotations, de-duplicating the previous separate sections. Add
persistent memory prompts to all seven agent roles.
@hakula139 hakula139 self-assigned this Apr 14, 2026
@hakula139 hakula139 added the enhancement New feature or request label Apr 14, 2026
@hakula139 hakula139 merged commit 3abe142 into main Apr 14, 2026
13 checks passed
@hakula139 hakula139 deleted the feat/subagent-config branch April 14, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant