Skip to content

Domain Context for Claude Code

Make Claude Code natively aware of your project's domain knowledge.

AI coding agents write syntactically correct but semantically wrong code because they lack business context. They don’t know your domain model, your business rules, your regulatory constraints, or why your architecture looks the way it does.

Existing tools solve parts of this — AGENTS.md tells agents how to work in your codebase, and SDD frameworks like GSD tell agents what to build next — but nothing tells them why the system works the way it does.

ConcernContentSolved by
The HowBuild commands, code style, workflowAGENTS.md, CLAUDE.md
The WhatFeature specs, task plans, roadmapsGSD, Spec Kit, BMAD
The WhyDomain model, business rules, ADRs, constraintsDomain Context

Domain Context fills that gap. It defines a pattern for codifying domain knowledge — committing it to version control alongside code, reviewing it in PRs, tracking it for freshness, and structuring it for AI consumption.

This tool (domain-context-cc) automates that pattern for Claude Code. The Domain Context specification defines the format; this tool provides the slash commands, hooks, and automation that make working with it fast and practical.

Terminal window
npx domain-context-cc

Initialize

Scaffold .context/ directories, wire AGENTS.md and CLAUDE.md.

Explore

Browse domain knowledge with freshness tracking and keyword search.

Validate

Detect broken links, orphan files, and stale entries.

Add

Create domain concepts, architecture decisions, and constraints.

Refresh

Review stale entries and update them against current code.

Extract

Promote knowledge from GSD planning artifacts into permanent context.

  • Skills — six slash commands for managing domain context (/dc:init, /dc:explore, /dc:validate, /dc:add, /dc:refresh, /dc:extract)
  • Hooks — session-start freshness warnings, edit-time CONTEXT.md reminders
  • Agent — domain validator for checking code against business rules
  • Rules — formatting guidance when editing .context/ files
  • Templates — scaffolding files used by /dc:init