3 minutes

29. Claude Code as workspace development harness

Date: 2026-10-04

Status

Accepted

Context

The Unicorn workspace groups five git repos (unicorn-frontend, unicorn-backend, archi-agentic-toolset, plus the workspace harness itself and the Hugo site). The backend is a Dapr-based distributed system with three services; the agentic toolset adds a fourth. Onboarding a new developer — or resuming a session after a break — previously required mental reconstruction of port assignments, component names, smoke test procedures, and IcePanel conventions. There was no single place that held all of that operational knowledge, and no enforced link between the architecture model (IcePanel C4) and the day-to-day coding loop.

The team needed a lightweight harness that could: (a) encode workspace knowledge durably, (b) enforce runtime invariants (no Docker, no secrets in code), (c) reduce bootstrap time for a new machine to a handful of commands, and (d) let an AI coding assistant operate safely and usefully without human supervision for routine tasks.

Decision

We will use Claude Code (Anthropic’s CLI agent) as the primary development harness for the workspace, with the following concrete setup:

  • CLAUDE.md files at workspace root and in each repo encode service maps, port tables, runtime rules, and known gaps. These are the agent’s first read in any session.
  • A project-scoped .claude/settings.json registers five slash commands as named skills: /discover (derives dapr.yaml, local Dapr components, and smoke tests from the live repo state), /local-up, /smoke, /new-adr, and /arch-check.
  • A protect-files.sh hook blocks the agent from writing any .env file; secrets are created out-of-band by the operator.
  • An IcePanel MCP server is registered so the agent can read and propose updates to the live C4 model without leaving the coding session.
  • Makefile targets (make up, make down, make check, make smoke, make smoke-clean) provide a stable, human-facing interface that wraps Dapr and Podman commands.
  • scripts/smoke.sh and scripts/smoke-clean.sh exercise the full pub/sub → Gemini RAG → GitHub push pipeline and clean up test artefacts afterwards.

Rejected alternatives:

  • Plain shell scripts + wiki: low ceremony but no enforcement, and knowledge drifts from reality quickly.
  • Dev containers / Codespaces: heavier; conflicts with the Podman-only constraint and the need to mount local Dapr state.
  • Cursor / Copilot Workspace: no CLI agent API that could be scripted into Makefile targets or slash commands; no hook mechanism for secrets protection.

Consequences

Easier

  • Bootstrapping a new machine: git clone, make bootstrap, create .env files, make up.
  • /discover produces dapr.yaml and local component YAML in one pass; subsequent sessions read CLAUDE.md rather than re-deriving structure.
  • The protect-files.sh hook gives a hard guarantee that secrets never enter the agent’s tool calls or session history.
  • /new-adr and /arch-check keep ADRs and the IcePanel C4 model in sync with code changes without a separate documentation step.
  • Dapr component-name parity (Redis locally, Service Bus/Cosmos DB on Azure) is an explicit CLAUDE.md rule the agent checks before editing any component file.

Harder / watch-outs

  • The harness is opinionated about Podman + Dapr self-hosted. A Docker-based environment needs CLAUDE.md edits and Makefile overrides before the agent can be trusted to run commands safely.
  • All API keys (Gemini, Pusher, Auth0, GitHub PAT) must exist in .env files before make up; missing secrets cause module-load failures at service startup, not deferred errors.
  • Claude Code sessions consume API tokens; long /discover or /smoke runs on a cold repo can be expensive. Cache dapr.yaml and component files in version control once stable.

Follow-up

  • Replace the TODO(ADR_DIR) placeholder in the workspace CLAUDE.md — done; path set to ../unicorn-hugo-website/content/adr.
  • Add the Hugo site repo to the workspace once it is imported; extend CLAUDE.md and the /discover skill accordingly.
  • When IcePanel becomes the authoritative C4 source (superseding the Archi export), update the RAG ingestion path described in ADR 0026.