Claude Code Harness

Every engineer gets style enforcement, language-aware context, and automated quality gates out of the box.

Source Tweet Artifacts

The .claude/ directory configures Claude Code for the Dedalus monorepo. Auto mode is default; a classifier reviews each action and blocks anything risky.

Claude Tag is the team-surface extension of the Claude Code direction: Claude moves into Slack channels as a shared teammate with scoped memory, tools, data, codebases, and future-task planning. Keep it distinct from terminal-first Claude Code setup; the useful connection is the same harness moving from private repo sessions into multiplayer org work. Source: Anthropic, 2026-06-23; Source: X/@karpathy, 2026-06-23

How It Works

System Prompts Itself

The June 2026 Google Cloud talk reframed effective Claude Code work as system design, not better one-off prompts: put the recurring judgement in files, hooks, skills, subagents, and verification loops, then let that system keep prompting Claude with the right context. The local video artifact is only the conference-stage clip; the durable source is the YouTube transcript and self-thread. This supports the same operating model as Kevin's wiki harness: CLAUDE.md/AGENTS.md should be routing indexes, not giant context dumps, and repeated workflows should become skills or doctors. Source: YouTube "Building with Claude on Google Cloud", 2026-06-06 Source: X/@eng_khairallah1, 2026-06-06

Rules (Automatic)

Rules in .claude/rules/ load based on what files are being edited. Touch a .py file and the Python style guide appears. Touch .rs and the Rust guide appears. The ethos.md rule loads on every session. After context compaction, a SessionStart hook re-injects core ethos.

Hooks (Enforcement)

  1. PreToolUse (pre-format.py): Before any Write/Edit to .py, runs ruff format and ruff check --fix.
  2. PostToolUse (check-style.py): After Write/Edit, checks function length >70 lines, file length >500, nesting >3, args >5, bare exceptions, forbidden types.
  3. Stop (agent hook): A haiku-model agent reviews the diff against STYLE.md for taste-based issues.

Skills (On-Demand)

Skills load when relevant. Claude sees descriptions at session start (low context cost) and loads full content only when needed. Invoked manually (/style-guide) or auto-detected from task context.

Subagents

The style-reviewer runs Sonnet with the style-guide skill, reviewing for taste-based issues. The code-reviewer hunts for bugs with confidence scoring (only reports >= 80% confidence).

Auto Mode

Local operations auto-approved. Risky operations (prod deploys, force pushes) blocked or prompt for confirmation. Trusted infrastructure: GitHub dedalus-labs, AWS 089042446622 (dev/preview only), ghcr.io/dedalus-labs.

Power Skills

/simplify: Dispatches parallel agents to review for quality, efficiency, and compliance. /batch: Dispatches isolated worktree agents for parallel migrations, each producing its own PR under 200 LOC.

Memory Architecture

Claude Code maintains persistent memory through three layers, confirmed by reverse-engineering of the source code (March 2026):

Three-layer design (bandwidth-aware):

  1. Index (always loaded): CLAUDE.md is pointers (~150 chars/line), not storage. Always in context.
  2. Topic files (on-demand): Skills and domain knowledge fetched only when needed.
  3. Transcripts (never read, only grep'd): Session history searched but never loaded wholesale.

Key architectural decisions:

  • Write discipline: Write to file → then update index. Never dump content into the index. Prevents entropy and context pollution.
  • Background memory rewriting (autoDream): Runs in a forked subagent with limited tools. Merges, dedupes, removes contradictions, converts vague → absolute, aggressively prunes. Memory is continuously edited, not appended.
  • Staleness is first-class: If memory ≠ reality, memory is wrong. Code-derived facts are never stored. If it's derivable, don't persist it.
  • Retrieval is skeptical: Memory is a hint, not truth. The model must verify before using.

Auto-compaction (autoCompact.ts): Triggers at ~167K tokens. Keeps 5 files (capped at 5K tokens each), compresses everything else into a single 50K-token summary, discards all intermediate reasoning. Override: keep each phase under 5 files, commit separately, delete dead code before starting.

Leaked-Source Checklist, Not A Bypass

The March 2026 leaked-source analyses are useful as a harness-audit checklist, but not as a runtime bypass. The viral employee-mode thread should be read through Claude Code Source Leak: USER_TYPE === 'ant' is a build-time constant in distributed builds, so a local CLAUDE.md cannot activate internal branches that are absent from the package. The practical lesson is to add explicit verification, chunked reads, scoped searches, and stable memory files to your own harness. Source: X/@iamfakeguru, 2026-03-31; Source: Claude Code Source Leak, 2026-06-30

  • Post-edit verification: The relevant invariant is "did the edit compile and pass checks?", not only "did bytes hit disk?" Override: add project-specific verification to CLAUDE.md/AGENTS.md, hooks, or doctors, for example npx tsc --noEmit && npx eslint . --quiet in the right package.
  • Brevity mandate: Directives in constants/prompts.ts - "Try the simplest approach first," "Three similar lines of code is better than a premature abstraction." Override: "What would a senior, experienced, perfectionist dev reject in code review? Fix all of it."
  • 2,000-line blind spot: Each file read is hard-capped at 2,000 lines / 25K tokens. Everything past that is silently truncated. Override: Read files over 500 LOC in chunks using offset and limit parameters.
  • Tool result truncation: Results exceeding 50K characters get replaced with a 2K-byte preview. The agent doesn't know results were truncated. Override: Scope searches narrowly, re-run by directory if results look suspiciously small.
  • No semantic code understanding: GrepTool is raw text pattern matching, not AST-aware. Override: On any rename, force separate searches for direct calls, type references, string literals, dynamic imports, require() calls, re-exports, barrel files, and test mocks.

Token Optimization

The "caveman" pattern (compressed output style that preserves technical accuracy) reportedly cuts large amounts of output tokens. Three intensity levels: lite (drops filler, keeps grammar), full (drops articles, full grunt mode), ultra (maximum compression, telegraphic). The current reference implementation is Caveman Token Skill (JuliusBrussee/caveman): multi-harness install paths, latest release v1.9.0, pinned/integrity-checked installer artifacts, and Brin caution verdicts pending deep scan. Evaluate for long sessions where context window pressure is high, but do not default-install until the supply-chain scan clears. Source: X/@om_patel5, 2026-04-06; Source: GitHub and Brin API, 2026-07-03

Community Skills Ecosystem

Beyond project-level skills, a growing ecosystem exists at Skills.sh - Agent Skills Registry:

  • Anthropic/Claude Code skill portfolio: library and API reference, product verification, data fetching and analysis, business process and team automation, code scaffolding and templates, code quality and review, CI/CD and deployment, runbooks, and infrastructure operations. Treat this as a bundle coverage checklist, not as package/version authority; the official docs establish the runtime shape as on-demand folders of instructions, scripts, templates, and resources. See Agent Skill Bundles. Source: X/@om_patel5, 2026-03-18; Source: Anthropic Agent Skills docs, 2026-07-04
  • Superpowers plugin (obra/superpowers): meta-skill system that adds brainstorming, TDD, debugging, code review, and parallel dispatch skills - activated via a using-superpowers bootstrap skill
  • UI Skills (ui-skills.com): pre-built component generation skills by @ibelick
  • Token compression skills: caveman-style output compression for long sessions
  • Hermes Agent (NousResearch): packages Karpathy's LLM-Wiki pattern for creating knowledge bases and research vaults with Obsidian. Command: hermes update/llm-wiki

Defensive security context

Anthropic Project Glasswing (Project Glasswing) deploys Claude Mythos Preview for vulnerability discovery in critical software, with up to $100M usage credits for partners. Not a Claude Code harness feature, but sets the bar for agent-assisted security reviews that complement Security and Review Skills and local harness hooks. Source: anthropic.com/glasswing, 2026-04-07

  • NickSpisak "Second Brain" recipe: raw/ + wiki/ + outputs/ folders, qmd for search, agent-browser for source collection, monthly health checks. Free skill available.

Adding a New Language

  1. Create .claude/rules/<language>.md with paths frontmatter.
  2. If the guide exceeds ~500 lines, create a skill instead.
  3. Add language-specific checks to hooks/checkers/.
  4. Update hooks/check-style.py's CHECKER_MAP.

Timeline

54 pages link here

Agent Client ProtocolToolsAgent Config SyncMetaAgent EthosConceptsAgent HarnessConceptsAgent Harness ArchitectureArchitectureAgent Harness CapsulesConceptsAgent LoopingConceptsAgent MachinesProjectsAgent Operating SystemArchitectureAgent Skill BundlesConceptsAgent SystemArchitectureAI SDK HarnessAgentToolsAI-Native Design PatternsDesignAndrej Karpathy's LLM Coding SkillsToolsArchitecture System MapArchitectureBrain CapsulesMetaCaveman Token SkillToolsClaude Code /goal CommandToolsClaude Code Compact Config SignalToolsClaude Code Dynamic WorkflowsToolsClaude Code Memory Architecture (Reverse-Engineered)ToolsClaude Code RulesToolsClaude Code SetupToolsClaude Code Source LeakConceptsClaude Fable 5ToolsClaude Managed AgentsToolsClaude Prompting PrinciplesConceptsClaude TagToolsClaude-MemToolsCodex Harness (OpenAI)ArchitectureCoTCodec Harness ArchitectureArchitectureCross-Agent Harness PortabilityMetaCursor HarnessArchitectureCursor Orchestrate SkillToolsCursor SDKToolsEverything Claude Code - Agent Harness Performance SystemToolsGitlawb ZeroToolsGolf - MCP Agent SecurityToolsHarness EngineeringConceptsHermes Harness (Nous Research)ArchitectureLearn Harness EngineeringToolsLocal Coding AgentsConceptsMatt Van HornPeopleOpenClaw HarnessArchitectureOpenCodeToolsPonytailToolsProject GlasswingToolsSkill ResolverSkill ResolverSource Compile Automation SetupMetaSpawn AgentToolsT3 CodeToolsVercel AI SDKToolsX Bookmarks: AI Agents & Tools (Jan 2025 – Jun 2026)ToolsX Bookmarks: Dev Tools (Mar–Jun 2026)Tools