Maintains a persistent, file-based knowledge graph for project context. Organizes components, decisions, data models, and infrastructure into navigable entities with typed relationships. Unlike session-resilience (ephemeral session state), this is permanent project knowledge that survives across all sessions.
From context-graphnpx claudepluginhub nbkm8y5/claude-plugins --plugin context-graphThis skill uses the workspace's default tool permissions.
references/entity_schema.mdreferences/graph_conventions.mdreferences/navigation_patterns.mdProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Retrieves current documentation, API references, and code examples for libraries, frameworks, SDKs, CLIs, and services via Context7 CLI. Ideal for API syntax, configs, migrations, and setup queries.
This skill manages a persistent knowledge graph stored as markdown files under .claude/context-graph/. It captures architectural knowledge, component relationships, design decisions, and infrastructure details in a structured, navigable format.
The context graph is a directory of interconnected entity files. Each entity represents a meaningful unit of project knowledge (a component, a data model, a decision, an integration, etc.) and declares typed relationships to other entities using [[link]] syntax. An index.md file at the root provides a table of contents.
.claude/context-graph/
index.md # Table of contents: all entities by type
schema.md # Entity types and relation types used
map.mermaid # Visual graph (generated by /context-map)
entities/
auth-service.md # Type: component
user-model.md # Type: data-model
adopt-jwt-tokens.md # Type: decision
postgres-primary.md # Type: infrastructure
stripe-integration.md # Type: integration
project-overview.md # Type: project-context
| Aspect | Session Resilience | Context Graph |
|---|---|---|
| Scope | Single session state | Permanent project knowledge |
| Lifetime | One session (survives compression) | All sessions (survives forever) |
| Content | Decisions, tasks, next steps for this session | Components, models, architecture, relations |
| Trigger | PreCompact, /checkpoint | /context-bootstrap, /context-add, PreCompact |
| Growth | Replaced each session | Accumulated over project lifetime |
| Location | .claude/session-state.md | .claude/context-graph/ directory |
They are complementary: session-resilience tracks "what am I doing right now," while the context graph tracks "what does this project look like."
Every entity is a markdown file in .claude/context-graph/entities/ that follows the schema defined in references/entity_schema.md.
| Type | Purpose | Examples |
|---|---|---|
component | A module, service, or subsystem | auth-service, payment-processor, api-gateway |
data-model | A database table, schema, or data structure | user-model, order-schema, event-payload |
decision | An architectural or design decision | adopt-jwt-tokens, use-postgres, monorepo-structure |
infrastructure | A deployment, hosting, or ops resource | postgres-primary, redis-cache, k8s-cluster |
integration | An external service or API integration | stripe-integration, sendgrid-email, github-webhooks |
project-context | High-level project info, conventions, constraints | project-overview, coding-standards, team-structure |
| Relation | Meaning | Example |
|---|---|---|
depends-on | Requires this entity to function | auth-service depends-on user-model |
consumed-by | This entity is used by another | user-model consumed-by auth-service |
decided-by | Governed by this decision entity | auth-service decided-by adopt-jwt-tokens |
replaces | Supersedes a deprecated entity | jwt-auth replaces session-cookies |
implements | Realizes this specification or design | auth-service implements oauth2-spec |
tested-by | Has associated test coverage | auth-service tested-by auth-integration-tests |
Create a new entity when:
Do NOT create entities for:
Update an existing entity when:
See references/navigation_patterns.md for full traversal strategies. The short version:
index.md — find the entity by name or type[[links]] — traverse to related entities for contextmap.mermaid — see the visual dependency graph.claude/context-graph/.claude/context-graph/entities/.claude/context-graph/index.md.claude/context-graph/schema.md.claude/context-graph/map.mermaidAlways use these canonical paths. Do not create entity files outside the entities/ directory.
Entity names use kebab-case. The filename is the entity identifier: auth-service.md is entity auth-service. See references/graph_conventions.md.
Links use double-bracket syntax. Reference other entities as [[entity-name]]. The validator checks that linked entities exist.
Every entity has a Type field. Must be one of the six defined types. The PostToolUse hook validates this on every write.
Relations are bidirectional in intent. If A depends-on B, then B should have a consumed-by A relation. Keep both sides in sync.
The index must stay current. After adding, renaming, or removing entities, update index.md to reflect the change.
Prune stale entities. Use /context-prune periodically to identify entities whose referenced files no longer exist or that have no inbound relations.