Category: Graphify

  • Pi Skills vs CLAUDE.md

    Pi Skills vs CLAUDE.md


    Pi Skills vs CLAUDE.md is not a winner-takes-all comparison. A Pi Skill packages an on-demand procedure. CLAUDE.md provides always-relevant human-written instructions for Claude Code and can also act as Pi’s fallback context file when no AGENTS.md exists. A code knowledge graph supplies current structural repository facts. Use each layer for the job its lifecycle can support.

    The title hides an important nuance: CLAUDE.md is not unreadable to Pi. Pi selects one recognized context file per directory and prefers AGENTS.md, but it falls back to CLAUDE.md. The tools still interpret files and permission semantics differently, so shared readability is not shared enforcement.

    This comparison was checked against Pi v0.82.0 and current Claude Code documentation on July 24, 2026. It focuses on layer ownership, not the cross-tool file-layout tutorial covered in the separate sharing guide.

    Pi stores conversations as JSONL session trees and compacts older turns when needed; that session history is not organization-wide shared memory. Claude Code keeps CLAUDE.md, Skills, and auto memory as separate context surfaces, so tool-specific rules must remain distinct from repository facts.

    Quick Verdict

    Pi Skills vs CLAUDE.md is a lifecycle decision: load reusable procedures on demand, keep broadly applicable instructions persistent, and query changing code relationships from current evidence.

    Use an always-loaded instruction file for stable facts every task needs: repository purpose, approved commands, generated-code rules, security constraints, and links to authoritative documents.

    Use a Skill for a reusable workflow that should load on demand: repository analysis, migration review, incident triage, release checks, or an evidence schema with supporting references.

    Use a code knowledge graph or another source-attributed index for volatile structural facts: modules, symbols, calls, registrations, schemas, event flows, generated sources, and tests at a specific commit.

    Keep task plans and intermediate reasoning in the task or session. Keep proof in current source and executable tests. No context layer should validate itself.

    What Pi Skills Are Best For

    A code knowledge graph complements Pi Skills by supplying revision-bound relationships that the procedure can query and verify instead of hard-coding.

    Pi Skills follow the Agent Skills standard. Pi scans names and descriptions at startup, then reads the full SKILL.md when selected. A user can explicitly invoke a Skill with /skill:name. The package can include references or scripts that support a specialized procedure.

    A good repository-analysis Skill defines:

    • task inputs and stop conditions;
    • read-only tools or adapter commands;
    • required module, caller, test, and risk fields;
    • provenance and revision checks;
    • how to report unknown or conflicting evidence;
    • review and escalation rules.

    That procedure stays useful when individual code relationships change. The Skill asks the current repository layer for facts rather than hard-coding an inventory of callers.

    Pi warns about duplicate Skill names and keeps the first discovered instance. This is a discovery rule, not semantic conflict resolution. Two differently named Skills can still contradict each other. Give every shared Skill an owner, version, fixture test, and review trigger.

    Queries such as Pi coding agent web UI can surface third-party or package-based interfaces. Do not transfer their behavior into core Pi. The first-party harness is terminal-oriented and extensible; evaluate any web UI or extension as a separate component with its own permissions and update path.

    What CLAUDE.md Is Best For

    A Pi coding agent web UI is a separate integration surface and should not be treated as the authority for either Pi's first-party context loading or Claude Code's CLAUDE.md behavior.

    CLAUDE.md is Claude Code’s persistent human-written instruction file. It can define commands, conventions, architecture guidance, and project constraints that should be available across sessions. Claude Code supports nested files, rules, and imports.

    Keep it concise. Every always-loaded instruction competes for context and can become stale. Anthropic recommends putting stable, broadly applicable guidance in CLAUDE.md and moving specialized procedures into Skills.

    For Pi, CLAUDE.md is a fallback context candidate. If AGENTS.md exists in the same directory, Pi selects AGENTS.md first. That means a team should not assume Pi loads both and reconciles differences. If the repository serves several tools, make neutral instructions canonical in AGENTS.md and use Claude’s documented import pattern.

    CLAUDE.md also is not hard enforcement. A sentence that says “never edit migrations” is guidance. Back it with repository permissions, review rules, CI, and generated-file checks where the constraint matters.

    What Code Knowledge Graphs Add

    Instruction and procedure files explain how the team wants work performed. They do not continuously derive what the system currently connects.

    A graph can model:

    • repository, module, file, symbol, schema, service, test, and decision nodes;
    • defines, imports, calls, registers, generates, publishes, consumes, tests, owns, and constrains edges;
    • source locations, indexed commit, extraction method, confidence, and coverage gaps.

    This enables task-shaped queries: “Which consumers depend on this schema?” or “Which tests cover paths from this entry point?” The result should be a bounded evidence shortlist, not a replacement for source inspection.

    Graph facts can drift. Dynamic dispatch and runtime configuration can remain unresolved. Access controls can leak cross-repository structure. Keep the graph read-only for ordinary agents, filter by identity, and require current-source verification for material edges.

    The graph is external to both Pi and Claude Code unless your team integrates it. Claude can use MCP or a CLI. Pi needs a CLI or extension/package because built-in MCP is not documented.

    Used by both harnesses, the code knowledge graph is a shared external layer for model-independent structural queries with revision-aware provenance.

    On-demand procedure querying current structural facts under persistent project rules

    How the Three Layers Fit Large Projects

    Use the layers in sequence:

    1. The instruction layer establishes stable constraints and approved commands.
    2. The Skill receives the task and selects a repeatable analysis procedure.
    3. The graph or index returns relationship evidence for the pinned commit.
    4. The agent verifies high-impact paths in current source.
    5. Tests and review validate the planned or implemented change.
    6. Reusable workflow improvements update the Skill; repository changes refresh the graph; stable policy changes update instructions.

    Do not promote every solved task into always-loaded context. A task-specific path can become obsolete immediately. Promote the general procedure only when it recurs, has an owner, and passes fixtures.

    Do not put organization policy into the graph merely because it is queryable. Link approved architecture records as evidence, but preserve their authority and authorship.

    The three-layer model also improves debugging. If an agent skips a check, inspect the Skill. If it follows a stale rule, inspect the instruction file. If it reports a wrong caller, inspect the graph and source. If it makes an unsafe edit despite correct context, inspect permissions and review controls.

    Apply an explicit promotion test before moving information between layers. A repeated task observation becomes a Skill step only when the procedure is stable across several cases. A Skill step becomes an always-loaded rule only when nearly every task needs it and the context cost is justified. A repository relationship never becomes permanent policy merely because it appeared in several successful runs; keep it derived from source.

    Version each layer independently. Record an owner and review trigger for CLAUDE.md or AGENTS.md, a semantic version or content hash for Skills, and an indexed commit plus extractor version for graph data. A task result should name all three versions. When behavior changes, this lets reviewers reproduce the context the agent actually received.

    Independent lifecycle and governance lanes for procedures, instructions, and code graphs

    Test failure paths as carefully as the happy path. The Skill should stop on an unavailable adapter or revision mismatch. The instruction layer should not authorize destructive behavior through ambiguous prose. The graph should return access denial and coverage gaps explicitly. A team that tests only successful retrieval will mistake silent fallback for reliability.

    Finally, control context size. Always-loaded instructions should remain short enough to review. Skill descriptions should be specific enough for correct selection without loading every body. Graph responses should return the smallest evidence set that supports the task. More context can hide contradictions as easily as it can answer questions.

    Review context growth as part of regular repository maintenance, not only after an agent fails.

    FAQ

    Can rules and Skills conflict?

    Yes. A persistent rule can prohibit an action that a Skill requests, or duplicate Skills can prescribe different workflows. Define precedence, test both harnesses, and stop for human review when the conflict affects security, data, or destructive operations.

    Who audits graph-backed context?

    An index maintainer owns extraction health and coverage. Code owners review material schema or manual-fact changes. Task agents verify retrieved edges in their checkouts, and reviewers validate impact and tests.

    When should a Skill become a shared workflow?

    Promote it when the procedure recurs across tasks, has stable inputs and outputs, includes honest stop conditions, has a named owner, and passes fixture tests. Do not promote a one-off solution path as universal guidance.

    pi-coding-agent github

    Use the current first-party earendil-works/pi repository and pin the reviewed release. Historical names and community forks may not match current Skill loading, context files, or security behavior.

    Conclusion

    Put stable instructions in the always-loaded layer, reusable procedures in Pi Skills, and current system relationships in a revision-bound graph or index. Keep each layer owned and testable. The payoff is not more context; it is faster diagnosis when context is missing, stale, contradictory, or unsupported.

  • Multica Skills vs Code Knowledge Graph

    Multica Skills vs Code Knowledge Graph


    Multica Skills and a code knowledge graph are complementary layers. A Skill tells an agent how to perform a reusable procedure; a graph supplies queryable claims about how the current repository is connected. Put investigation steps, output formats, and review rules in Skills. Put modules, symbols, dependencies, tests, provenance, and revision data in the graph. Require the Skill to verify graph results against current source.

    This comparison is easy to blur because both layers can reduce repeated explanation. The boundary is authority. A procedure can say, “Find direct and indirect callers and report unknowns.” It cannot make a stale caller edge true. A graph can return a caller path. It cannot decide whether the task needs a security review or which evidence format the team accepts.

    As of Multica v0.4.10, the product documents Skills, workspace context, Project Resources, and task/session coordination. It does not document native code-graph ingestion, edge extraction, or graph freshness. The graph in this article is an external repository context layer.

    Supported provider sessions can resume within Multica's task lifecycle, but that continuity belongs to one run and does not reconcile graph facts across agents.

    Quick Verdict

    Multica Skills package repeatable procedures, while a code knowledge graph supplies changing repository relationships with provenance.

    Use reusable agent skills for repeatable behavior:

    • task intake and precondition checks;
    • tool sequence and read-only defaults;
    • required evidence fields;
    • review and escalation steps;
    • organization-specific output formats.

    Use a code knowledge graph for structural facts:

    • module and symbol ownership;
    • definitions, imports, calls, registrations, and event flows;
    • generated-source relationships;
    • schema, API, database, and queue dependencies;
    • tests and architecture decisions connected to code;
    • source location, indexed commit, and extraction method.

    Use neither as unquestioned authority. A Skill can be malicious or stale. A graph can be incomplete or wrong. Current source, executable tests, and approved policy remain the verification anchors.

    What Multica Skills Are Best For

    Well-governed reusable agent skills standardize how agents gather and report evidence without freezing volatile code relationships into prose.

    A Multica Skill is an Agent Skills-compatible package centered on SKILL.md, with optional supporting files. Teams can create or import Skills and explicitly attach them to agents. Workspace, local, and repository-scoped Skills have different storage and discovery behavior, but their common job is to package instructions and reference material for an underlying coding tool.

    A repository-analysis Skill might require this workflow:

    1. confirm repository and base revision;
    2. identify likely entry points;
    3. query direct callers and registrations;
    4. map affected tests and contracts;
    5. mark inferred or unresolved edges;
    6. verify material paths in source;
    7. return a fixed evidence table.

    That structure improves consistency across agents. It also makes failure visible: if the graph is unavailable or the task revision differs, the Skill can stop instead of improvising.

    The lifecycle is explicit. The current documentation describes create or import, attach, and update. It does not establish an automatic “successful task becomes a Skill” mechanism. An edited workspace Skill reaches newly created tasks; existing tasks keep the copy they already received.

    Searches for Multica pricing often appear near product evaluation, but pricing does not change the architectural boundary. No public fixed cloud price was listed at the verification cutoff. A free-trial invitation is not proof of a permanent free tier. Evaluate Skills on governance and workflow fit, then obtain current commercial terms from the vendor.

    Third-party Skills require review. Multica does not document signing, auditing, or sandboxing imported Skills. The underlying tool receives their content, so a Skill can influence commands, file access, and data handling. Treat it like executable operational configuration even when it is written in Markdown.

    What Code Knowledge Graphs Are Best For

    Searches for Multica pricing belong to commercial evaluation, while this layer comparison turns on evidence quality, freshness, and governance rather than price alone.

    A code knowledge graph models relationships that change as the repository changes. It can answer questions that prose instructions should not try to memorize:

    • Which services consume this event?
    • Which symbols call this function directly or through registration?
    • Which schema generates this client?
    • Which tests cover this contract?
    • Which architecture record constrains this dependency?
    • Which edges could not be resolved at the indexed commit?

    Useful results carry provenance. A CALLS edge without a source path, revision, and derivation is merely an assertion. A mature layer stores direct and inferred edges separately, records parse failures, restricts queries by repository permissions, and expires or rebuilds data when the task base moves.

    The graph should be read-only to ordinary task agents. Otherwise an agent can alter the context used to validate its own patch. Index writes belong to a reviewed extraction process with audit logs and access controls.

    Graph coverage also has limits. Dynamic dispatch, reflection, runtime configuration, generated code, and cross-repository contracts can produce missing or ambiguous edges. The correct graph response is “unknown with evidence,” not a confident empty set.

    Procedure, structural facts, source verification, and reviewed action as separate stages

    Why Workflow Memory Cannot Replace System Knowledge

    Workflow memory describes what the team wants an agent to do. System knowledge describes what the current code demonstrates. The two drift differently.

    Suppose a Skill says that all payment changes must inspect packages/billing. Six months later, payment authorization moves into a service and event consumer. The procedure may still be valid at the intent level—trace the payment path—but its hard-coded directory is stale. A graph built from the current revision can reveal the new relationships, while the Skill supplies the review process.

    The reverse failure also occurs. A graph can correctly show a dependency path but omit the organization rule that security must review it. The graph supplies structure, not governance.

    Stale workflow and stale repository-fact failure paths converging on source review

    Keep stable rules in workspace context or Skills. Keep volatile relationship claims in the graph. Keep task decisions in the issue. Keep proof in source and tests. This separation lets the team refresh one layer without silently rewriting the others.

    How the Two Layers Work Together

    The integration contract should be small and testable:

    1. The Skill receives the task and extracts repository, revision, entity, and change intent.
    2. It calls a read-only graph query through a provider-supported adapter.
    3. The graph returns bounded paths, provenance, coverage gaps, and index age.
    4. The Skill requires current-source verification of high-impact edges.
    5. It maps the verified path to tests, owners, and review rules.
    6. It records unknowns rather than widening the search indefinitely.

    Multica’s MCP configuration is provider-specific, so do not assume every attached agent can call one MCP graph server. Some tools may need a CLI or provider-native extension. The Skill can hide that adapter detail while keeping the returned evidence schema consistent.

    Test the combination with fixture repositories. Include direct calls, aliases, generated code, an unresolved dynamic edge, a stale graph revision, and a denied path. Passing means the workflow reports correct evidence and honest unknowns. It does not mean every future repository relationship is solved.

    Keep the returned graph packet out of the Skill package itself. Embedding a captured result beside the procedure makes the two lifecycles look like one and encourages agents to reuse old edges. The Skill may include a response schema, example with synthetic paths, and adapter documentation. The live result should identify the task, repository, indexed commit, query time, and access scope. Store it with the work item when auditability matters, then expire it when the base revision moves. This distinction also makes incident review easier: maintainers can tell whether the agent followed a bad procedure, received stale evidence, or ignored accurate evidence.

    Log adapter and schema versions as well. The same Skill can produce different results after a query contract changes, even when its Markdown is unchanged.

    FAQ

    Can a Skill call graph queries?

    Yes, if the underlying provider has an approved adapter such as MCP, a CLI, or an extension. The Skill should request a bounded read-only query, validate the revision, and require source citations. This is a team integration, not a documented native Multica graph feature.

    Who owns stale Skill cleanup?

    Assign an owner and review date to every shared Skill. The owner removes obsolete commands, tests provider compatibility, checks permission assumptions, and announces changes that affect newly created tasks.

    What evidence proves dependency impact?

    Use source locations for definitions and relationship paths, the indexed commit, relevant generated-source or configuration evidence, and tests at the affected contract. A graph edge alone is a lead; verified source plus suitable tests support the conclusion.

    What is the best multi-agent system?

    There is no context-free winner. Evaluate coordination, provider support, permission boundaries, self-hosting terms, auditability, and failure recovery against your workflow. This article only establishes how Multica Skills and an external graph divide responsibility.

    Conclusion

    Multica Skills should make work repeatable. A code knowledge graph should make structural claims queryable and auditable. Connect them through a narrow read-only interface, retain provenance, and verify results in current source. When procedure, facts, and proof remain separate, the team can improve each layer without turning instructions into architecture mythology.

  • Claude Code Recipes vs Knowledge Graph

    Claude Code Recipes vs Knowledge Graph


    Claude Code recipes and a knowledge graph solve different problems. A recipe controls the sequence of work and the evidence format. In current Claude Code terms, a reusable executable recipe is normally a Skill, not an official feature called “Recipes.” A code knowledge graph, if a team operates one, supplies queryable structural claims such as module, dependency, call, and test relationships. It remains external unless connected through MCP, a CLI, or another tool.

    The useful design is not recipe or graph. It is a procedure that queries the smallest relevant context layer, checks provenance and freshness, and verifies consequential claims against source.

    Quick Verdict

    For Claude Code recipes vs knowledge graph decisions, use the smallest layer that can answer the question:

    For coding agent context, this means separating stable instructions, reusable procedure, queryable structural facts, and current verification evidence.

    Layer Primary job Appropriate content Failure signal
    Recipe / Skill Control procedure steps, scope questions, evidence schema, stop conditions repeated but unsupported answer
    CLAUDE.md / rules Supply stable guidance conventions, commands, local architecture constraints stale or over-broad instruction
    Code knowledge graph Supply structural facts source-attributed entities and relationships at an indexed revision missing, false, or stale edge
    Source and tests Verify current behavior implementation, configuration, assertions, runtime fixtures contradictory or incomplete evidence

    The recipe should decide when to inspect source, invoke code intelligence, or ask a graph for candidates. It should not embed a mutable dependency map. The graph should answer relationship questions with provenance. It should not decide the team's review sequence or risk tolerance.

    This is also why neither a large prompt nor a large graph removes judgment. Procedure quality and context quality are independent variables. For a broader view of the fact layer, see knowledge graphs for AI coding assistants. For the cost of repeatedly rebuilding context, see Claude Code repeated repository scanning.

    Workflow controls and graph facts passing through provenance, freshness, and source-verification gates

    What Recipes Control

    Here, “recipe” means an editorial workflow pattern for coding agent context. Anthropic documents reusable prompt-based workflows as Skills; legacy custom commands have been merged into that surface. A recipe can require Claude to:

    • confirm a target, repository revision, and excluded paths;
    • start from definitions or executable entry points;
    • separate direct evidence, inference, and unknowns;
    • return files, symbols, relationship types, and relevant tests;
    • reverse-check one important edge;
    • stop when dynamic behavior or unavailable tooling prevents a reliable answer.

    Those requirements change agent behavior even when no graph exists. They make a source-reading run more disciplined and a graph-backed run more auditable.

    Searches for “Claude Code recipes vs knowledge graph Reddit” can inspire workflow questions, but community examples do not establish current product behavior or graph accuracy.

    A community comparison can treat the recipe as a better prompt. That framing is too narrow for engineering use. The important artifact is an owned contract: what question may be answered, which evidence is acceptable, and what must be escalated. Community examples may inspire wording, but they are not factual sources for current product behavior.

    Recipes are especially useful for consistency. Two reviewers can compare outputs when both runs use the same fields and stop conditions. But consistency is not correctness. A recipe that tells an agent to “find all callers” without defining static, configured, generated, and runtime-dispatched relationships can produce the same category error every time.

    What Knowledge Graphs Provide

    Searches for “Claude Code recipes vs knowledge graph Reddit” often compare prompts with indexes; the engineering distinction is between workflow control and verifiable repository facts. A code knowledge graph models repository entities and typed relationships. Depending on the implementation, entities may include files, symbols, modules, services, schemas, tests, or owners. Edges may represent imports, calls, registration, production or consumption of an event, reads or writes, test coverage, or deployment coupling.

    The operational value is not the graph label. It is the ability to ask a bounded relationship question and receive:

    • the source and target entities;
    • a specific relation type and direction;
    • source locations or extraction evidence;
    • the indexed repository revision;
    • confidence or extraction method where relevant;
    • explicit absence or uncertainty rather than a fabricated path.

    That structure can make reverse dependency and multi-hop candidate discovery cheaper than rereading broad parts of a monorepo. It also lets different workflows query the same repository-fact layer instead of copying maps into prompts.

    However, a graph represents what its ingestion and extraction can see. Dynamic registration, reflection, generated artifacts, runtime configuration, cross-repository services, and data-dependent paths may be incomplete. A graph edge can be stale or wrong. A missing edge is not proof that no relationship exists.

    Graphify can be considered as one possible external code-graph layer in this architecture, not a native Claude Code capability. Evaluate any such layer by source coverage, provenance, refresh behavior, query controls, and how easily a reviewer can return from an edge to the pinned code revision.

    How Recipes Query Context Layers

    Treat retrieval as a decision tree rather than “search everything.” A useful recipe follows four stages.

    1. Classify the question. Stable convention questions may be answered from scoped CLAUDE.md guidance. Definition and reference questions are good candidates for code intelligence. Reverse dependencies or repeated cross-module impact questions may justify a graph query. Runtime behavior may require tests, logs, configuration, or a human owner.

    2. Request the smallest evidence set. Ask for one target and one relation type. Include repository revision and scope. A graph query for “direct consumers of schema X at commit Y” is more auditable than “explain everything affected by X.”

    3. Qualify the response. The recipe should preserve relation type, source, indexed revision, and unknowns. It should not translate all results into an undifferentiated dependency list.

    4. Verify by risk. Reopen the source for high-impact edges, reproduce a code-intelligence lookup, or execute an appropriate existing test. Verification effort should rise with security, data, compatibility, or deployment consequences.

    A repository question routed to the smallest evidence layer and then through risk-scaled verification

    Anthropic's large-repository guidance explicitly suggests exposing an existing search or RAG index through MCP when layered instructions no longer scale. That is an integration pattern. The Skill invokes the tool; the external system owns indexing and graph freshness; the repository remains the final evidence surface.

    Where Each Approach Breaks Down

    A recipe breaks down when its procedure is vague. “Analyze the codebase” has no scope or finish condition. “Find all callers” can hide unsupported completeness. A recipe can also become stale when paths, tool names, or output expectations change.

    A recipe also breaks down when it hides missing context. Strong formatting can make weak evidence look finished. Require an unknowns section, source citations, and at least one independent check.

    A graph breaks down when extraction or freshness is weak. A precise-looking edge from an old commit is still stale. An incomplete language parser or ignored generated layer can omit consequential relationships. Store and display revision, extraction time, and provenance.

    The combined system breaks down at the seam. The recipe may query the wrong relation, omit the revision, or treat candidates as verified facts. The graph may answer correctly but use vocabulary the recipe collapses. Test that interface with known positive, negative, and dynamic cases.

    Log the query schema and adapter version with each result. A workflow can remain textually unchanged while a graph API renames an edge, changes traversal defaults, or broadens access. Compatibility tests should fail on an unknown relation rather than silently converting it into a generic dependency.

    Finally, avoid centralizing authority in either layer. Module owners should be able to challenge graph relations, workflow owners should revise procedures, and reviewers should reject conclusions that cannot be traced to current evidence.

    FAQ

    Can recipes hide missing context?

    Yes. A rigid template can turn incomplete retrieval into a polished report. Require each result to state scope, repository revision, evidence sources, excluded paths, and unknowns. Add a stop condition when the requested completeness cannot be supported.

    Who owns graph-backed recipe quality?

    Ownership is shared but separable. The workflow owner maintains query choice and evidence rules. The graph owner maintains ingestion, schema, provenance, and freshness. Repository owners validate consequential relationships. One person may fill multiple roles, but the checks should remain distinct.

    When should recipes be rewritten?

    Rewrite them when the reader job, repository boundary, available tools, evidence schema, or recurring failure mode changes. Refresh a graph when facts change; do not rewrite a procedure merely to conceal stale graph data.

    Does Claude Code see AGENTS md?

    Claude Code's documented instruction file is CLAUDE.md. Anthropic's memory documentation describes a compatibility pattern in which CLAUDE.md imports @AGENTS.md. That makes the shared content available through Claude's import mechanism; it is not the same as treating AGENTS.md as the native instruction filename.

    Conclusion

    In Claude Code recipes vs knowledge graph, the recipe owns workflow control and the graph owns queryable structural claims. Keep both bounded and versioned. Ask the procedure to retrieve only relevant relations, preserve provenance and unknowns, and verify high-impact edges against source or tests before acting.

  • OpenSpec Compound Engineering Layers

    OpenSpec Compound Engineering Layers


    OpenSpec compound engineering is best understood as an editorial layering pattern, not a documented product integration. OpenSpec can organize change intent and implementation artifacts. Compound Engineering can preserve reusable work knowledge. A proposed external code graph can supply current structural facts. Each layer answers a different question, and source code plus tests remain the final behavior check.

    The value comes from clean handoffs. The risk comes from letting three independently changing layers appear to agree when they do not.

    Quick Verdict

    Use the layers this way:

    This OpenSpec compound engineering split is useful only when each layer keeps its own authority and update rule.

    Layer Primary question Typical artifact Authority limit
    OpenSpec What change are we agreeing to build? proposal, delta specs, design, tasks Expresses intended behavior and work, not current code structure.
    Compound Engineering What did prior engineering work teach us? plan, review findings, solution record Preserves scoped workflow knowledge, not an exhaustive system map.
    Proposed external code graph How is this revision structurally connected? typed, provenance-bearing nodes and edges Generated facts can be incomplete and need source verification.

    Equal context layers for intent, reusable work memory, and revision-aware structure

    There is no documented first-party integration among OpenSpec, Compound Engineering, and Graphify in the pinned primary sources. [OPENSPEC-OVERVIEW-20260724] [CE-README-20260724] The workflow below is therefore a proposed composition that teams must implement and govern themselves.

    Also separate two uses of “graph.” OpenSpec's schema can define dependencies among change artifacts. That artifact dependency graph controls creation order. It is not a code knowledge graph of symbols, calls, implementations, or tests. [OPENSPEC-SCHEMA-20260724]

    The structural layer is introduced in Knowledge Graph for AI Coding Assistants. The broader memory model is covered in Compound Engineering Memory Explained.

    OpenSpec as Intent Context

    OpenSpec provides a structured process for agreeing on a change before implementation. Its current overview describes a change folder with artifacts such as a proposal explaining why and scope, delta specifications describing added or modified behavior, a design explaining technical decisions, and tasks tracking implementation work. [OPENSPEC-OVERVIEW-20260724]

    That makes it useful intent context, but “intent” should not be reduced to one proposal file. In spec-driven development:

    • the proposal frames the problem and change boundary;
    • delta specs define expected behavior through requirements and scenarios;
    • the design records the implementation approach and trade-offs;
    • tasks turn the agreement into executable work.

    The current OPSX command flow uses /opsx:* commands to explore, propose, apply, verify, and archive changes. [OPENSPEC-COMMANDS-20260724] Teams should use the terminology present in their installed version rather than copying older command examples from secondary guides.

    OpenSpec artifacts are strongest when reviewers can test them for internal consistency. Does each task implement a requirement? Does the design address the constraints in the proposal? Do scenarios cover the edge case that motivated the change? They are weaker as evidence of current runtime behavior. A spec may be correct while the code is incomplete, or obsolete while the code moved on.

    Compound Engineering as Work Memory

    Compound Engineering contributes reusable knowledge about how work was understood, implemented, and reviewed. The pinned current repository documents planning, review, and compounding capabilities. Its ce-compound skill writes one selected durable learning to solutions/, and ce-compound-refresh can maintain stale or overlapping solution records. [CE-README-20260724] [CE-COMPOUND-20260724] [CE-REFRESH-20260724]

    This work-memory layer must not be conflated with Claude Code auto memory, which is supplied by the host rather than the Compound Engineering plugin. [ANTHROPIC-MEMORY-20260724]

    The accepted search form Everyinc/compound-engineering-plugin refers to the canonical repository spelling EveryInc/compound-engineering-plugin. The distinction is small for search, but exact entity naming matters when a team pins a repository or commit for audit.

    Work memory should not duplicate the OpenSpec change package. A useful solution record might explain why a production failure evaded the original scenario, which diagnostic path found it, and which validation now prevents recurrence. The associated OpenSpec artifacts still own the intended change. The solution record owns the transferable learning from performing or repairing the work.

    Compound Engineering does not provide OpenSpec's artifact model in the cited repository, and OpenSpec does not provide Compound Engineering's solution workflow. Any connector between them must state how artifact IDs, repository revisions, review status, and permissions are carried across.

    Code Graphs as System Structure

    A proposed external code graph answers questions neither artifact set can answer exhaustively: which current symbol implements a specified behavior, which callers are in the change radius, which tests reach the path, or whether a path named in an old solution still exists.

    The graph should use typed edges and expose provenance. A fact such as CheckoutHandler CALLS PaymentService needs a repository, indexed commit, source location, extraction method, and access scope. It is a structural candidate for the agent to verify, not a statement of intended behavior.

    Graphify can be considered as one possible external code graph layer. It is not a built-in OpenSpec or Compound Engineering component, and this article makes no first-party integration claim.

    Do not import OpenSpec's artifact dependency graph and call it a code graph. The former can say that a design artifact depends on approved specs before it is created. The latter represents properties of a code revision. [OPENSPEC-SCHEMA-20260724] A connector may link a requirement to candidate symbols, but that cross-layer link should show whether it was curated, inferred, or generated by similarity.

    The graph is most valuable when it narrows verification. If it cannot support the requested language, branch, generated source, or runtime configuration, it should return uncertainty and let the agent inspect the repository directly.

    How the Layers Fit an Agent Workflow

    Consider a change to idempotent payment retries.

    Cross-layer handoff and correction loop from intent through work memory and code structure

    1. Explore the request. Clarify the failure, constraints, and affected user behavior. Do not write graph facts or durable solutions yet.
    2. Create the OpenSpec change. Capture why and scope in the proposal, behavior in delta specs, technical choices in design, and implementation work in tasks. [OPENSPEC-OVERVIEW-20260724]
    3. Retrieve prior work memory. Search reviewed Compound Engineering solutions for the same subsystem, error class, or constraint. Preserve their version scope and treat conflicting records as a review signal.
    4. Query proposed structural context. Resolve requirement terms and prior solution references to candidate symbols, callers, and tests on the target revision. Return provenance and uncertainty.
    5. Plan and implement. Use the intent artifacts as the acceptance boundary, prior solutions as scoped evidence, and graph results as navigation. Open the source and run tests before accepting any claim.
    6. Verify. OpenSpec's current /opsx:verify workflow checks implementation against change artifacts and is designed to report findings rather than block all progress automatically. [OPENSPEC-COMMANDS-20260724]
    7. Update the changed layer. Revise the spec if agreed behavior changed, compound a reusable lesson if the work produced one, and rebuild structural facts for the new revision.

    The order may loop. A structural query may reveal a hidden caller that changes the design. A prior solution may expose a missing scenario. When that happens, update the authoritative artifact before continuing rather than carrying an informal exception in the conversation.

    Limits and Handoff Risks

    Cross-layer references can look precise while being stale. A task may link to a requirement that was revised. A solution may name a removed path. A graph may cover main while implementation occurs on a release branch. Every handoff should carry stable artifact IDs, repository revision, review status, and source permissions.

    Disagreement is normal and should be visible:

    • spec versus code may mean incomplete implementation or obsolete intent;
    • solution versus spec may mean a historical workaround conflicts with a new requirement;
    • graph versus code may mean ingestion lag or extraction error;
    • artifact dependency versus code dependency may be a category mistake.

    OpenSpec documents a review process for checking change artifacts, and its verification workflow should be treated as evidence within a broader engineering review, not proof of runtime correctness. [OPENSPEC-REVIEW-20260724] [OPENSPEC-COMMANDS-20260724]

    Privacy also crosses layers. A public spec should not make a private incident or repository relationship visible through a generated summary. Query-time permission checks, derived-data deletion, and audit logs are required when systems have different access models.

    Finally, measure the composed workflow on matched tasks. Track missing scenarios, stale links, irrelevant retrievals, reviewer corrections, and time to verified evidence. Do not assert a universal token-saving percentage for the three-layer design.

    FAQ

    Which layer should be updated first?

    Update the layer whose authoritative knowledge changed. If agreed behavior changes, revise OpenSpec before implementation proceeds. If only the code structure changed, rebuild the graph after the commit. If the work produced a reusable diagnostic or solution, compound that lesson after it has been validated. Cross-links should update after their targets are stable.

    Can specs and graphs disagree?

    Yes. A spec expresses intended behavior; a graph reflects extracted structure for a revision. Disagreement may indicate incomplete implementation, stale intent, ingestion lag, or an extraction error. Surface both sources and ask the responsible reviewer to classify the mismatch rather than automatically preferring one.

    Who owns cross-layer review?

    The change owner should coordinate it, with artifact-specific responsibility retained by spec reviewers, subsystem maintainers, and the platform team operating retrieval. Security and privacy owners should review cross-system permissions. No connector should erase those ownership boundaries.

    What is OpenSpec for Claude Code?

    OpenSpec is a spec-driven workflow that can expose slash commands and change artifacts to supported AI coding tools, including Claude Code configurations documented by the project. [OPENSPEC-OVERVIEW-20260724] It organizes change intent and work; it is not Claude Code memory or a code graph.

    Conclusion

    OpenSpec, Compound Engineering, and a proposed external code graph can form a coherent context architecture when their responsibilities stay narrow. OpenSpec owns agreed change artifacts. Compound Engineering preserves reviewed work learning. The graph supplies revision-aware structural candidates.

    The composition is a design pattern, not an official integration. Make every handoff carry identity, revision, status, provenance, and permissions, then verify behavior in source code and tests. Clear boundaries make the three layers useful; blurred authority makes them dangerous.

  • Compound Engineering Token Usage

    Compound Engineering Token Usage


    Reusable knowledge can reduce repeated investigation, but it is not free. Compound engineering token usage depends on what the agent loads, when it loads it, and whether the retrieved material still applies. A short, relevant solution record may replace several searches. A stale instruction file or a bundle of unrelated Skills may add context before useful work begins.

    There is no credible universal savings percentage. Teams should measure the same task on the same repository revision with the same model and tool configuration, then inspect both token use and engineering correctness.

    Why CE Can Save Tokens

    Compound Engineering can reduce repeated work by distilling a completed investigation into a reusable artifact. The current ce-compound skill writes one durable learning to a solutions/ directory. Its lightweight path uses the current conversation, while its fuller path can gather additional evidence, including session history, before producing the document. [CE-COMPOUND-20260724]

    For compound engineering token usage, this distillation is one stage in the current plan–work–review–compound cycle, not a guarantee that every later task will use fewer tokens.

    The potential gain is straightforward: when a later task matches the recorded problem class, the agent can retrieve a focused explanation instead of rediscovering the same files, failed hypotheses, and validation steps. A reviewed solution can point directly to the affected subsystem and the test that distinguishes the real cause from a similar symptom.

    That is only a potential. If retrieval returns the wrong solution, or the solution lacks version scope, the agent may spend more context verifying and correcting it. The useful unit is not “tokens removed.” It is verified work completed per unit of context.

    The current plugin also includes ce-compound-refresh, which is intended to maintain stale and overlapping solution documents. [CE-REFRESH-20260724] Maintenance matters because compounding without pruning turns reuse into accumulation.

    For structural retrieval fundamentals, see Knowledge Graph for AI Coding Assistants. The three-layer handoff is evaluated in OpenSpec Compound Engineering Layers.

    Where Context Overhead Appears

    Claude Code's context can include the conversation, instructions, file reads, tool results, auto memory, and loaded Skill content. Anthropic documents /context as a way to inspect the current context breakdown. [ANTHROPIC-CONTEXT-20260724]

    Standing context, on-demand retrieval, and noisy overhead flowing into a task

    Billing and context are related but not identical. Anthropic's current usage documentation distinguishes subscription usage from pay-as-you-go API usage, where /cost can report token-based cost. [ANTHROPIC-USAGE-20260724] A team measuring Claude Code context cost should record the authentication and billing mode rather than comparing unlike numbers.

    Tool output is easy to overlook. Long logs, broad searches, generated plans, and repeated file reads all occupy context. A workflow can use fewer prompt words while still carrying more total context because its tools return too much evidence.

    Skills, Notes, and Old Docs as Hidden Cost

    Instruction and Skill systems load at different times. Anthropic's current documentation says CLAUDE.md instructions are loaded into context, while Skills advertise descriptions and load their full content when invoked. User-invoked-only Skills can avoid loading until called. [ANTHROPIC-MEMORY-20260724] [ANTHROPIC-FEATURES-20260724]

    A Compound engineering token usage example should therefore count more than the final answer. Suppose two runs fix the same test failure. The first run opens 25 files and several tool outputs. The second loads one relevant solution, opens six files, and verifies the same test. The second may be more efficient—but only if both start from the same commit, use the same model and settings, and produce an equally correct result.

    This creates several hidden costs:

    • a large CLAUDE.md sends rarely relevant guidance into many sessions;
    • broad Skill descriptions compete for attention even when full Skill bodies are not loaded;
    • overlapping solution documents make retrieval return several versions of the same lesson;
    • old path names and dependency versions trigger verification work;
    • full compounding gathers more evidence than a lightweight pass, even when the lesson is obvious.

    Anthropic recommends keeping CLAUDE.md concise, with a target below roughly 200 lines, and notes that imported instruction content still loads into context. [ANTHROPIC-MEMORY-20260724] Its auto-memory mechanism limits the portion of MEMORY.md loaded at session start and allows topic files to be read on demand. [ANTHROPIC-MEMORY-20260724] Auto memory is a Claude Code host feature, not a feature supplied by Compound Engineering.

    Count duplication across formats. The same rule repeated in CLAUDE.md, a Skill, three solution records, and an agent prompt creates both token overhead and an authority problem.

    Retrieval and Expiration Strategies

    Start with a context budget by layer. Keep standing instructions small. Retrieve solution documents only after the task has a sufficiently specific subsystem or symptom. Load graph neighborhoods, logs, and long reference files on demand. Limit the number of retrieved artifacts and show why each matched.

    Rank evidence by scope and freshness, not text similarity alone. A solution tied to the current package and a recent compatible revision should outrank a semantically similar note for another service. Return the revision, review status, and invalidation condition with the excerpt.

    Expire records through explicit triggers:

    • referenced symbols or files disappear;
    • a dependency or schema version moves beyond the documented range;
    • the fix is reverted or superseded;
    • a new reviewed solution covers the same problem class;
    • the owning team marks the assumption invalid.

    Use ce-compound-refresh as one maintenance input, then keep human review for high-impact conflicts. [CE-REFRESH-20260724] A proposed external code graph can help detect renamed or removed symbols, but that is not an official Compound Engineering integration and its extracted facts still require revision checks.

    That proposed code knowledge graph should expose revision-aware nodes and edges with queryable provenance so an agent can inspect why a structural fact matched.

    The best retrieval system can also answer “nothing reliable found.” Filling the context window with weak matches is worse than letting the agent inspect the repository directly.

    Limits and Measurement Notes

    Use a matched evaluation harness. Freeze the repository commit, task, acceptance tests, model, agent version, authentication mode, enabled tools, and context limits. Run enough repeated trials to account for model variability. Record:

    Matched experiment lanes comparing context volume, tool paths, and verified correctness

    • input and output tokens where the interface exposes them;
    • tool calls, files opened, and tool-output volume;
    • time to a test-passing result;
    • irrelevant or stale artifacts retrieved;
    • reviewer corrections and regressions;
    • success against the same acceptance tests.

    Token counts alone can reward a short but wrong answer. Cost alone can be distorted by caching, model choice, or billing plan. A fair result states the full setup and separates observed measurements from explanations.

    Do not extrapolate a single repository result into “Compound Engineering saves X percent.” Report the task family and confidence interval if the sample permits it. If a proposed external graph changes retrieval, test it as a separate variable instead of combining it with new instructions, a new model, and a changed Skill set.

    FAQ

    How should teams measure context waste?

    Measure context that was loaded but neither used nor needed to reach the verified result. Track unopened retrievals, repeated file reads, stale guidance, duplicate instructions, and long tool outputs. Compare matched runs and include correction rate so a smaller but inaccurate context is not counted as an improvement.

    When should a Skill be retired?

    Retire or narrow it when its trigger no longer maps to a real task, its instructions duplicate a better source, its dependencies are obsolete, or it repeatedly loads irrelevant context. Preserve a versioned record when audit history matters, but remove it from active discovery and default use.

    What context should load only on demand?

    Long reference documents, historical solutions, detailed logs, generated graph neighborhoods, and subsystem-specific procedures should usually wait until the task identifies a relevant scope. Repository-wide safety rules and essential commands can remain standing instructions, provided they stay concise.

    How does Compound Engineering work with Claude Code?

    Compound Engineering is a plugin workflow that can run in Claude Code, while Claude Code supplies the host context, instruction, Skill, and memory mechanisms. [CE-README-20260724] [ANTHROPIC-FEATURES-20260724] The two should not be described as one memory product.

    Conclusion

    Compound engineering token usage improves when durable knowledge replaces repeated investigation and only relevant artifacts enter context. It worsens when instructions, Skills, old notes, and tool output accumulate without ownership or expiry.

    Measure controlled tasks, not anecdotes. Record correctness alongside tokens and cost, expose what loaded, and change one context variable at a time. That produces a result a team can reproduce instead of a savings claim it cannot defend.

  • Compound Engineering Knowledge Graph

    Compound Engineering Knowledge Graph


    A compound engineering knowledge graph can be useful, but it is not a documented feature of the current Compound Engineering plugin. It is a proposed external design: connect current code structure to reviewed solution records, issues, pull requests, and design documents so an agent can retrieve a bounded evidence set for a task.

    The hard part is not drawing more edges. It is defining authority, provenance, version scope, and permissions before generated relationships enter an agent's context.

    Before You Build the Graph

    Start with questions, not a schema. A platform team may need to answer:

    A compound engineering knowledge graph earns its operational cost only when those cross-artifact questions recur and ordinary repository search no longer answers them reliably.

    • Which current symbols participate in this failing request path?
    • Which reviewed solution records concern the same subsystem?
    • Which pull request introduced the behavior?
    • Which tests and owners should be included before a change?

    If ordinary repository search answers these questions reliably, a graph may add unnecessary operations. Build the layer only where repeated traversal across artifacts is a measured bottleneck.

    Define the source-of-truth policy before ingestion. Code and tests verify current behavior. Reviewed specifications and decisions express intent. Solution records preserve scoped reasoning. Issues and pull requests supply history, but their comments may include superseded hypotheses. Generated links support navigation and must not silently override those sources.

    Also define the version key. A relationship without a commit, branch, or release scope is unsafe in a changing repository.

    Start with Knowledge Graph for AI Coding Assistants if the graph model is unfamiliar. Evaluate context overhead separately in Compound Engineering Token Usage.

    Connect Code, Docs, Bugs, PRs, and Solutions

    A useful initial schema is small.

    An engineering knowledge graph built from this schema should remain a bounded evidence index, not a claim that every engineering artifact belongs in one database.

    Small provenance-first schema linking engineering artifact types to a revision rail

    Node types might include Repository, Revision, File, Symbol, Test, Document, Issue, PullRequest, Solution, and Owner. Edge types might include DEFINES, CALLS, IMPLEMENTS, IMPORTS, TESTS, CHANGED_BY, DISCUSSED_IN, SOLVES, OWNS, and VALID_AT.

    Every node and edge should have provenance fields:

    • source system and stable source identifier;
    • repository and revision;
    • extraction time and method;
    • confidence or resolution status where applicable;
    • access scope;
    • expiry or invalidation condition;
    • reviewer for curated links.

    The graph should distinguish extracted facts from curated assertions. A parser may extract Symbol A CALLS Symbol B from one revision. A maintainer may curate Solution 17 SOLVES retry duplication in Settlement. Those claims were produced differently and should not share an unexplained confidence score.

    The current Compound Engineering workflow gives the proposed graph a useful document type: ce-compound writes a selected learning to solutions/, while refresh tooling can maintain stale or overlapping solution records. [CE-COMPOUND-20260724] [CE-REFRESH-20260724] The integration itself remains hypothetical. A connector would need to ingest those records, preserve their repository history, and keep review state visible.

    Those solution records must not be conflated with Claude Code auto memory, which is a separate host-managed context layer. [ANTHROPIC-MEMORY-20260724]

    Graphify can be evaluated as one possible external code-structure provider in this model. It should not be presented as an official Compound Engineering component or as a complete source of product, incident, and pull-request truth.

    Model Similar Problems and Past Fixes

    “Similar problem” is not a primitive fact. Two incidents may share an error string but have different causes. Two solution documents may describe the same root cause with different vocabulary. An engineering knowledge graph needs an explicit method for proposing similarity.

    The phrase Compound engineering knowledge graph GitHub can imply that such a graph already exists in the official repository. It does not appear in the pinned current Compound Engineering documentation. The plugin documents planning, review, and durable solution workflows; this article's graph is an external architecture proposal. [CE-README-20260724] [CE-COMPOUND-20260724]

    Use several signals rather than a single magic edge:

    • shared affected symbols or subsystems;
    • common error types, test failures, or stack frames;
    • overlapping dependencies and change paths;
    • curated labels or incident categories;
    • text or code embeddings used as candidate generators.

    Represent the output as POSSIBLY_SIMILAR_TO, not SAME_AS, until reviewed. Store the features and model version that produced the candidate. If the relationship comes from an embedding classifier, say so; graph topology alone does not infer semantic similarity.

    Past fixes also need outcomes. Record whether a solution was accepted, reverted, superseded, or limited to a version. A pull request that mentions an issue is not automatically the correct fix, and a merged change can later be reverted. Model these events instead of flattening them into one permanent SOLVES edge.

    For privacy, avoid embedding unrestricted issue text into a broadly queryable index. The permission intersection of every source should constrain the returned evidence.

    Query the Graph During Agent Tasks

    Graph retrieval should be a bounded step inside an agent workflow, not a request to “load the repository.” A practical query contract includes task terms, repository, target revision, maximum traversal depth, allowed node types, and an evidence budget.

    Bounded graph query selecting a revision-scoped slice for source and test verification

    For a failing checkout test, the sequence could be:

    1. Resolve the failing test and symbols on the target commit.
    2. Traverse one or two typed edges to callers, implementations, and affected tests.
    3. Retrieve reviewed solution records linked to those components.
    4. Return paths, source identifiers, indexed revision, and uncertainty.
    5. Let the agent open the source and reproduce the behavior before editing.

    In a proposed Graphify workflow, the code graph supplies structural candidates. Compound Engineering solution documents contribute scoped prior learning. The agent's host supplies instructions and tool execution. These are separate systems joined by an explicit retrieval contract, not a built-in vendor integration.

    Good queries are falsifiable. “Show current callers of this symbol at commit X” can be checked. “Tell me everything relevant” cannot. Log which returned facts were opened, accepted, corrected, or ignored; that evidence helps tune traversal and expiry.

    Do not automatically write agent conclusions back as graph truth. Send proposed curated edges through review, especially SOLVES, OWNS, and cross-artifact intent relationships.

    Drift, Privacy, and Review Risks

    Drift occurs in more than code. Symbols move, issue labels change, owners rotate, solution records become obsolete, and pull-request links can point to a branch that no longer reflects production. Each data source needs a freshness rule and a deletion path.

    Index status should be visible in every response. If the requested commit is newer than the graph, return a qualified partial answer or require live repository inspection. Dynamic dispatch, runtime configuration, generated code, and incomplete language support should also lower confidence.

    Permissions must be evaluated at query time. A user who can read repository A but not a linked incident in system B should not receive the incident title, extracted text, or a summary that reveals it. Derived embeddings and cached responses need the same retention discipline as source content.

    Schema review matters because edge types shape agent behavior. Adding APPROVED_BY or redefining OWNS can change which evidence an agent trusts. Treat schema changes like API changes: document semantics, migrate old data, sample results, and assign an approver.

    Measure the system with controlled tasks and correction logs. Useful signals include stale edges found, unsupported links rejected, time to verified evidence, and reviewer corrections. Do not publish a universal token-saving percentage without matched conditions.

    FAQ

    What sources should be excluded?

    Exclude data without a legitimate access path, retention policy, or clear task value. Raw private messages, unrestricted transcript archives, secrets, and low-quality generated summaries should not enter by default. For each source, document the permitted users, expiry rule, and whether derived embeddings must be deleted with the original.

    Who approves graph schema changes?

    A named cross-functional owner should approve them: typically the platform team operating the graph plus representatives from security and the affected engineering domains. High-authority relationships such as ownership, approval, or solution status need stricter review than mechanically extracted imports.

    How should bad links be corrected?

    Preserve the original provenance, mark the link invalid for the affected revision, and record why it failed. Fix the extractor or curated assertion at its source, rebuild the relevant slice, and add a regression sample. Do not merely hide the edge in the UI while leaving agents able to retrieve it.

    What are the steps in compound engineering?

    The current plugin organizes work around planning, implementation support, review, and a compounding step that captures reusable learning; exact available skills should be checked in the pinned official repository. [CE-README-20260724] A code graph is not one of those documented first-party steps.

    Conclusion

    A credible compound engineering knowledge graph begins with narrow questions and evidence rules. Connect code, tests, documents, issues, pull requests, and solutions only when every relationship exposes provenance, revision, access scope, and status.

    The graph should help an agent find evidence, not manufacture authority. Keep Compound Engineering's reviewed solution records, the agent host's instructions, and the proposed external structural layer distinct. That separation makes conflicts inspectable and corrections possible.

  • CLAUDE.md vs Knowledge Graph

    CLAUDE.md vs Knowledge Graph


    Choosing CLAUDE.md vs knowledge graph is the wrong decision frame. CLAUDE.md is best for instructions the agent should follow. Solution documents are best for reusable explanations of validated fixes. A code knowledge graph is best for traversing current structural relationships. They overlap at the edges, but they do not have the same job, authority, or lifecycle.

    The practical design question is which layer should answer a given prompt—and how the agent should react when two layers disagree.

    Quick Verdict

    Use the smallest authoritative layer that matches the question.

    The practical CLAUDE.md vs knowledge graph verdict is therefore additive: keep policy in instructions, validated reasoning in solution documents, and current relationships in a revision-aware structural layer.

    Agent question Best first layer Why
    “Which test command must I run?” CLAUDE.md It is an explicit repository instruction.
    “Why did we avoid this retry strategy?” Reviewed solution document It preserves evidence and engineering reasoning.
    “Which handlers call this service on this commit?” Proposed external code graph It can traverse revision-aware structural links.
    “Is this claim safe enough to change code?” Source code and tests They remain the final verification boundary.

    Equal-weight comparison of instruction, solution-document, and knowledge-graph context

    CLAUDE.md and solution documents are prose. A code graph is generated structure. Neither format makes a claim correct by itself. Authority should come from source, scope, revision, and review status.

    The broader structural model is explained in Knowledge Graph for AI Coding Assistants; implementation-level graph governance is covered in Compound Engineering Knowledge Graph.

    What CLAUDE.md Is Best For

    CLAUDE.md is the right place for concise guidance that should influence work across many sessions: build and test commands, repository conventions, architectural boundaries, security requirements, and pointers to narrower documentation.

    Anthropic documents a hierarchy of memory and instruction files for Claude Code. Project instructions can live in CLAUDE.md or .claude/CLAUDE.md, and more specific files can apply at lower directory levels. These instructions are loaded into context; imports can organize them but do not make the imported content free. [ANTHROPIC-MEMORY-20260724]

    That behavior gives CLAUDE.md high reach and a real context cost. It should say “Always run the migration compatibility test before modifying schemas,” not contain the history of every past migration. Anthropic's current guidance recommends concise instruction files and suggests keeping each file under roughly 200 lines. [ANTHROPIC-MEMORY-20260724]

    Treat instructions as policy. Give them owners, review repository-wide changes carefully, and avoid facts that can be derived more reliably from the current code. An instruction that names a path likely to move should link to a stable concept or verification command instead.

    This makes CLAUDE.md one input to coding agent memory, not the whole system.

    What Solution Docs Are Best For

    Solution documents preserve reasoning that would be expensive to reconstruct. They can describe symptoms, failed approaches, root cause, the validated fix, affected components, tests, and invalidation conditions. This is the durable part of coding agent memory that turns one investigation into a reusable engineering record.

    The current Compound Engineering ce-compound skill selects one durable learning and writes it under solutions/; its fuller path can use session history as evidence. The separate ce-compound-refresh workflow is designed to maintain stale and overlapping solution documents. [CE-COMPOUND-20260724] [CE-REFRESH-20260724]

    In the current plan–work–review–compound sequence, solution-document persistence belongs to the compounding step. A search such as Claude md vs knowledge graph Reddit often mixes personal preference, generic memory advice, and several different products; this comparison instead keeps documented instruction behavior separate from the proposed graph layer.

    This makes solution docs more selective than transcripts and more explanatory than instructions. They should not tell every session what to do. They should become relevant when the current task matches the recorded problem class.

    The critical fields are scope and status. A solution must say which versions and components it covers, whether it was reproduced on the current revision, who reviewed it, and what would make it obsolete. Without those fields, confident prose can outlive the system it describes.

    What Code Knowledge Graphs Are Best For

    A code knowledge graph is best for questions that require traversal or filtering across many structural facts: callers, implementations, dependencies, routes, tests, ownership boundaries, and links from code to reviewed documents.

    In this article, the graph is a proposed external layer. It is not part of CLAUDE.md, Claude Code auto memory, or the official Compound Engineering plugin. Graphify can be evaluated as one possible implementation, but no first-party Compound Engineering–Graphify integration is claimed.

    Each graph fact should identify the indexed commit, source artifact, extraction method, and access scope. An edge saying CheckoutHandler CALLS PaymentService is useful only if the agent can tell which revision produced it and can open the source. Generated edges are candidates for retrieval, not instructions.

    Graphs are weaker at intent and causality. A call edge does not explain why a boundary exists, why a workaround was chosen, or whether a maintainer approves changing it. Those explanations belong in reviewed prose. Dynamic dispatch and runtime configuration can also make graph extraction incomplete.

    How the Three Layers Work Together

    Suppose an agent must change an idempotency rule.

    Context assembly workflow from rules and prior solutions through graph retrieval to verification

    1. CLAUDE.md supplies the non-negotiable rules: required tests, forbidden direct database writes, and the command for validating migrations.
    2. A relevant solution document explains the previous duplicate-settlement incident, the failed approaches, and the assumption that justified the current rule.
    3. A proposed external code graph retrieves the handlers, service methods, storage paths, and tests connected to the rule on the indexed revision.
    4. The agent opens the returned code and runs the required tests before accepting any graph or prose claim.
    5. After review, the team updates the layer whose knowledge changed: instructions for a new standing rule, the solution doc for revised reasoning, or the graph index for a new revision.

    The retrieval order is not fixed. A policy question starts with instructions. A recurring failure starts with solutions. A blast-radius question starts with structure. The final action still returns to source evidence.

    This layering also creates a useful conflict signal. If CLAUDE.md forbids a pattern that the solution doc recommends, stop and ask for review. If the graph contradicts a path named in prose, verify the current branch before deciding which artifact is stale.

    Limits and Trade-Offs

    Every layer can create context waste. Large instruction files load guidance that may be irrelevant. Too many solution documents create noisy retrieval and duplicate explanations. An over-connected graph returns a broad neighborhood instead of a bounded evidence set.

    Govern them differently:

    • audit CLAUDE.md for reach, clarity, and instruction conflicts;
    • refresh solution documents for overlap, scope, and expiry;
    • monitor graph ingestion for revision lag, extraction errors, permission leaks, and low-value edges.

    Do not use one global confidence score to hide these differences. A human instruction can be authoritative but outdated. A graph edge can be mechanically reproducible but incomplete. A solution document can be well reasoned but scoped to an older release.

    Measure the combined system on controlled repository tasks. Record whether the agent retrieved the right evidence, how much irrelevant context it opened, which claims required correction, and whether reviewers could trace the result to source. Avoid universal token-savings claims.

    FAQ

    Can one layer override another?

    Only through an explicit authority rule. Current source code and tests verify behavior; reviewed repository instructions define working policy; scoped solution records explain prior decisions; generated graph facts support navigation. When layers conflict, the agent should surface the conflict and request the responsible owner's review rather than silently selecting the most confident wording.

    Who audits generated graph facts?

    The platform team should monitor extraction and freshness, while subsystem owners validate samples and high-impact paths. Security, authorization, migration, billing, and deletion flows deserve stricter checks. Every returned fact should expose enough provenance for a developer to reproduce it against source.

    How should teams version context layers?

    Version prose in the repository when possible. Record the commit or release scope in solution documents. Stamp graph indexes and query responses with their source revision. If a task targets a different branch, qualify or reject facts that cannot be reproduced there.

    What does CLAUDE.md do in Claude Code?

    It supplies persistent instructions that Claude Code reads as context according to the documented user, project, and directory hierarchy. [ANTHROPIC-MEMORY-20260724] It is not a database of every fact about the codebase and should remain concise.

    Conclusion

    The useful answer to CLAUDE.md vs knowledge graph is division of labor. Put stable rules in concise instructions. Put validated reasoning in owned solution documents. Use a proposed external graph for revision-aware structural retrieval, then verify its output against code and tests.

    When each layer exposes its authority, provenance, and expiry, the agent can select context instead of accumulating it. That is a stronger foundation than asking one artifact to behave like all three.

  • Compound Engineering Large Codebase Memory

    Compound Engineering Large Codebase Memory


    The first fifty solution notes feel useful. The next five hundred can become another repository to search. In compound engineering large codebase work, the problem is not whether Markdown is good or bad. It is whether each type of context is represented in a form that matches the questions agents need to answer.

    Markdown remains the right format for explanations, decisions, and operating guidance. Large systems also need current structural links: which modules depend on a changed package, which implementations satisfy an interface, and which tests exercise a path. Those links should complement repository memory, not replace it.

    Why Large Codebases Stress Markdown Memory

    Markdown is organized for reading, while an agent often needs to traverse relationships. A document can say that the billing service calls a ledger adapter, but it cannot automatically show every caller, the revision on which the statement was true, or whether a second document disagrees.

    That is the central scaling problem in compound engineering large codebase work: durable prose remains valuable, while structural questions need revision-scoped evidence.

    Markdown notes multiplying and losing alignment as a repository grows

    Scale makes four problems visible:

    • Discovery: relevant notes are distributed across directories and use different vocabulary.
    • Granularity: one document mixes repository-wide rules with a one-version workaround.
    • Freshness: the explanation remains after symbols, modules, or ownership boundaries move.
    • Collision: several teams document the same subsystem from different perspectives.

    Compound Engineering's current ce-compound skill writes a focused durable learning to solutions/, and ce-compound-refresh can inspect the collection for staleness and overlap. [CE-COMPOUND-20260724] [CE-REFRESH-20260724] Those controls improve document hygiene. They do not turn prose into a revision-aware map of the repository.

    For the underlying graph concept, see Knowledge Graph for AI Coding Assistants. For a layer-by-layer decision, use CLAUDE.md vs Knowledge Graph.

    What Markdown Notes Still Do Well

    Markdown is excellent when the answer needs judgment rather than traversal. It can explain why a migration was staged, which incident revealed a design weakness, or why a tempting fix was rejected. Those are durable narratives with context that a call graph cannot infer.

    Use concise repository instructions for rules that should affect most sessions. Anthropic documents CLAUDE.md as an instruction mechanism loaded into Claude Code context and recommends keeping it concise. [ANTHROPIC-MEMORY-20260724] Use solution documents for validated problem-solution records that should be retrieved when a related issue appears. Use architecture decision records for decisions whose alternatives and consequences matter beyond one fix.

    Claude Code auto memory is a separate host feature; it is not the same thing as Compound Engineering's solution-document layer.

    Good notes state their scope. They identify a subsystem, the repository revision or release window, the evidence that validated the conclusion, an owner, and an invalidation condition. A note titled “Queue retries” is weak. A record titled “Prevent duplicate settlement after queue redelivery” with affected paths, tests, and version assumptions is useful repository memory.

    Prose should own meaning. It should not pretend to be an exhaustive index of the code.

    What Large Systems Need Beyond Notes

    Large repositories need a structural index that can answer bounded questions against the current revision. Useful relationships include:

    The awkward search phrase Compound engineering large codebase GitHub points to a reasonable evaluation task: inspect the current official repository rather than assuming an older guide describes the present plugin. The pinned repository used for this article documents the current command and skill surface. [CE-README-20260724]

    • package imports package;
    • function calls function;
    • type implements interface;
    • endpoint reaches handler and service;
    • test covers symbol or route;
    • owner maintains directory;
    • solution document concerns subsystem.

    This is a proposed external layer, not a documented feature of Compound Engineering. Each relationship should carry provenance: source file, line or symbol identifier, commit, extraction method, and confidence where static resolution is incomplete. Access scope matters too. A cross-repository link must not expose a private service name to a user who cannot read the source repository.

    The result is not “all company knowledge in a graph.” It is a narrower, testable map of relationships an agent otherwise has to rediscover. Human explanations remain in Markdown. The graph helps select the relevant code and documents.

    How Structured Links Improve Repository Memory

    Consider a task to change an authorization policy. A text search finds the policy name and several old incident notes. A revision-aware structural query can add the middleware that calls it, the endpoints that reach the middleware, the tests connected to those paths, and the solution record for a previous regression.

    Revision-aware structural links connecting code, tests, documents, and verified solutions

    The agent can then retrieve a small evidence bundle instead of reading every nearby file. In a proposed Graphify-assisted workflow, Graphify is one possible external code graph layer that returns structural candidates with provenance. It is not an official integration with Compound Engineering, and the agent must verify high-impact links against the repository before changing code.

    Structured links also make disagreement visible. If a solution document says service A owns validation while the current call path places it in service B, the system should surface a conflict rather than silently choose. That conflict becomes a review task: either the note is stale, the graph extraction is wrong, or the architecture drifted without documentation.

    This division of labor is the useful pattern: graph for retrieval and traversal, prose for reasoning, source code and tests for final verification.

    Limits and Maintenance Risks

    Structured memory has its own maintenance cost. Dynamic dispatch, generated code, reflection, runtime configuration, and feature flags can produce incomplete or misleading links. Branches can diverge. Renames can preserve behavior while breaking identity. An index built on yesterday's main branch should not be presented as fact for today's release branch.

    The maintenance plan should name an operator, a subsystem reviewer, an incident path, and a maximum acceptable lag for each indexed repository.

    Define freshness as a service-level property. Record the indexed commit, expose ingestion failures, and reject or qualify queries when the requested revision is outside the index. Sample important links against source code, especially around security, billing, migrations, and destructive operations.

    Avoid measuring success only by graph size. More nodes can mean more noise. Better measures include time to verified evidence, irrelevant files opened, stale claims detected, corrections after review, and coverage of the subsystem under test. Compare the same task, revision, agent, and model configuration before attributing an improvement to the memory layer.

    Finally, set deletion and retention rules. Removing a repository or branch should remove derived facts and embeddings. Historical links can be useful for incident review, but they should be clearly separated from current retrieval.

    FAQ

    When should notes become structured data?

    Convert a claim when agents repeatedly need to filter, traverse, compare, or validate it across many artifacts. Keep the explanation in prose, but represent stable identifiers and relationships as structured facts. A one-off decision rationale does not need a graph node simply because it can have one.

    Who validates architecture links?

    The team that owns the affected boundary should validate high-impact links. A platform team may operate the index and its extraction rules, while service owners review samples and investigate conflicts. Links used for security, data integrity, or migrations should be checked against code and tests before action.

    How often should repo memory be rebuilt?

    Rebuild structural facts whenever the required freshness contract would otherwise be violated—often on relevant commits or merges, not an arbitrary calendar schedule. Review prose on ownership changes, upgrades, incidents, and stated expiry conditions. The indexed revision should always be visible.

    What is a compound engineer?

    In this context, it is an engineer who turns completed work into reusable inputs for later work: clearer plans, reviewed changes, and durable solution records. The current Compound Engineering plugin encodes parts of that workflow, but the role is broader than any one tool. [CE-README-20260724]

    Conclusion

    Large codebases do not outgrow Markdown. They outgrow using Markdown for every context problem. Keep rules, explanations, and validated solutions in concise, owned documents. Add a proposed external structural layer when agents need revision-aware traversal across code and related records.

    Reliable repository memory is not the largest archive. It is the smallest evidence set that lets an agent find the relevant structure, understand the prior reasoning, and verify both against the current code.

  • Compound Engineering Memory Explained

    Compound Engineering Memory Explained


    An agent fixes a difficult bug on Monday. On Thursday, a second agent meets the same failure and starts from zero. The missing piece is not a larger prompt. It is a maintained record of what the team learned, why the fix worked, and when that knowledge stops being trustworthy.

    That is the useful meaning of compound engineering memory. It is an editorial model for durable engineering context, not a named memory product inside Compound Engineering. The current Compound Engineering workflow contributes solution documents and maintenance commands; Claude Code contributes instruction and auto-memory mechanisms; a code knowledge graph can add structural context as an external layer. Those systems have different owners and failure modes, so treating them as one feature creates more confusion than reuse.

    What Compound Engineering Memory Means

    Compound engineering memory is the part of the workflow that makes a solved problem cheaper to recognize and reason about the next time. It should preserve a small amount of high-value context:

    • repository rules that should guide many tasks;
    • validated solution records for recurring problem classes;
    • limited task history when it explains a decision;
    • revision-aware facts about code structure, when an external system supplies them.

    The official Compound Engineering repository does not document a feature named “Compound Engineering Memory.” Its current ce-compound skill identifies one durable learning from the completed work and writes it to the repository's solutions/ directory. A separate ce-compound-refresh skill reviews those documents for stale, overlapping, or conflicting guidance. [CE-COMPOUND-20260724] [CE-REFRESH-20260724]

    This distinction matters. Memory is not every transcript, search result, or note an agent ever produced. It is selected evidence with an authority level, an owner, and a review date. A repository becomes easier to work in when the agent can find the right record quickly and can also tell whether that record still applies.

    For the structural foundation, see Knowledge Graph for AI Coding Assistants. The scale-specific transition is covered separately in Compound Engineering Large Codebase Memory.

    Memory Layers in the Workflow

    A practical stack has four layers.

    Four-layer compound engineering memory stack with distinct persistence boundaries

    First, repository instructions such as CLAUDE.md state stable rules: build commands, test expectations, architectural constraints, and working conventions. Claude Code loads these instruction files into context, which makes them appropriate for concise guidance that should affect most sessions. [ANTHROPIC-MEMORY-20260724]

    Second, Compound Engineering solution documents explain validated problem-solution pairs. The current ce compound workflow writes one focused learning rather than a generic session summary. That keeps the record closer to an engineering runbook than a diary. [CE-COMPOUND-20260724]

    Third, task history provides temporary evidence. The current Compound Engineering plugin can inspect session history in its fuller compounding path, but that history is an input to distillation, not the durable artifact itself. [CE-COMPOUND-20260724]

    Fourth, an external code knowledge graph can represent relationships such as “handler calls service,” “type implements interface,” or “test covers endpoint.” That layer is not part of the official plugin. It is a proposed integration pattern for teams whose repositories need queryable structural context.

    Where Memory Breaks Down

    Memory fails quietly. A note can remain plausible after the code has changed. Two solution documents can recommend different fixes because they were written for different releases. A task transcript can preserve an abandoned hypothesis next to the final explanation. An inferred code link can outlive the commit that supported it.

    The search phrase Compound engineering plugin often collapses these layers into one thing. The safer model is to decide which layer should answer each question and which source has authority.

    Three controls reduce that risk.

    Provenance, scope, review, and expiration controls for durable engineering memory

    Provenance records where a claim came from: a file and revision, an issue, a test result, or a reviewed solution. Scope says which service, version, or configuration the claim applies to. Status distinguishes proposed, validated, superseded, and expired records.

    The current ce-compound-refresh workflow is designed to find stale and overlapping solution documents, then route meaningful changes through review. [CE-REFRESH-20260724] That is useful maintenance, but it does not make every note correct automatically. Teams still need a named owner for high-impact guidance and a rule for resolving conflicts.

    Expiration should be based on evidence, not age alone. A stable explanation of a protocol may remain valid for years. A workaround tied to a specific dependency version may expire at the next upgrade. The memory record should carry the condition that invalidates it.

    How Code Knowledge Graphs Help

    Markdown is good at explaining why. It is weaker at answering structural questions across thousands of changing files. A code knowledge graph can complement solution documents by making relationships explicit and queryable.

    In a proposed external design, every graph fact should include its source revision, extraction method, confidence, and access scope. An agent could then ask for the callers of a changed function, the tests linked to those callers, and solution documents associated with the same subsystem. The graph narrows the search space; the solution document explains the reasoning behind a previous fix.

    Graphify can be evaluated as one possible external code graph layer, but that is not an official Compound Engineering integration. The useful contract is vendor-neutral:

    1. retrieve structural facts for the current revision;
    2. link facts to reviewed human or agent-authored explanations;
    3. show provenance in the agent response;
    4. fall back to repository inspection when evidence is missing or stale.

    A graph should not be treated as a truth oracle. Generated edges can be incomplete, dynamic calls can be hard to resolve, and branch differences can invalidate otherwise correct facts. The gain is better navigation and auditable retrieval, not certainty.

    Limits and Governance Notes

    The memory stack needs governance proportional to its effect. A typo in a local scratch note has low impact. A repository-wide instruction that changes migrations or authorization checks has high impact and should require review.

    Keep repository instructions short and stable. Anthropic's current guidance recommends concise CLAUDE.md files and warns that overly large instruction files consume context and reduce adherence. [ANTHROPIC-MEMORY-20260724] Put detailed, situation-specific learning in solution documents that can be retrieved when relevant. Keep raw transcripts temporary unless a compliance or debugging requirement justifies retention.

    For an external graph, define who can ingest private repositories, which branches are indexed, how deleted code is removed, and whether sensitive identifiers can appear in embeddings or logs. A structural fact should be revision-aware, and any cross-link to an issue or pull request should respect the source system's permissions.

    Finally, measure usefulness with controlled tasks. Compare the same repository revision, task, model, and tool configuration. Record retrieval latency, irrelevant context, correction rate, and whether the final answer cites evidence. Do not infer a universal token-saving percentage from one successful session.

    FAQ

    Who should own memory cleanup?

    The team that owns the affected subsystem should own the meaning of its durable records. A platform or developer-experience team can maintain templates, refresh jobs, and retention rules, but it should not silently decide whether an authentication or data-integrity workaround is still valid. Assign a reviewer in the solution document and route high-impact changes through normal code or architecture review.

    How should teams handle conflicting notes?

    Do not merge them into a vague compromise. Record the scope and evidence for each note, reproduce the relevant behavior on the current revision, and mark one record as current only after review. Keep a link to the superseded record when it explains historical behavior, but remove it from default retrieval.

    When should old solutions expire?

    Expire a solution when its stated assumptions no longer hold: the referenced code is removed, a dependency version changes, the underlying incident class is eliminated, or a newer reviewed solution supersedes it. Time-based review reminders are useful, but the invalidation condition is more informative than a fixed age.

    What is compound engineering in AI?

    It is a workflow in which completed engineering work produces reusable knowledge for later work. In the current Compound Engineering plugin, that includes planning, review, and a compounding step that captures a durable solution. [CE-README-20260724] It does not mean saving every conversation forever.

    Conclusion

    Compound engineering memory works when each context layer has a narrow job. Instructions define stable rules. Solution documents preserve validated reasoning. Task history remains temporary evidence. A proposed external code graph supplies revision-aware structural links.

    The operational test is simple: can an agent retrieve a relevant claim, see where it came from, know whether it applies to the current code, and discover who can correct it? If any part is missing, the repository has accumulated notes, not reliable memory.

  • Kimi K3 Knowledge Graph for AI Developers

    Kimi K3 Knowledge Graph for AI Developers


    A Kimi K3 knowledge graph workflow gives the model structured, revision-bound evidence about a repository; it does not give K3 a built-in graph or replace source inspection. K3's large context can carry code and tool results. A code knowledge graph adds named entities, typed relationships, source provenance, and freshness rules so an agent can ask narrower questions before it plans or edits.

    Kimi documents K3 with a one-million-token API context window and tool-calling support, and Kimi Code exposes a k3 coding-model surface with plan-dependent context. Those capabilities are useful transport and reasoning capacity. They are not documentation that K3 maintains a code graph, automatically knows repository history, or can validate graph edges. The graph remains an external evidence layer that a team must build, refresh, and audit.

    What a Kimi K3 Knowledge Graph Means

    For AI developers, a code knowledge graph is a queryable representation of repository facts. Nodes can represent modules, files, symbols, services, schemas, tests, configuration, decisions, or documentation. Edges can represent imports, calls, ownership, data flow, build dependencies, test coverage, or a claim's source. Every useful result should name the revision and the evidence behind it.

    The phrase “Kimi K3 knowledge graph” therefore describes an integration pattern, not a Moonshot product feature. The model receives a focused graph query or evidence packet, reasons over it, and then reads the current source or runs a tool when the decision is consequential. The agent does not get to promote a guessed relationship into graph truth.

    Use this ownership model:

    Layer Responsibility What it should not claim
    Kimi K3 Interpret task instructions, request tools, synthesize an answer or plan Permanent repository memory or verified graph edges
    Graph/index service Return versioned entities and relationships with provenance Runtime behavior it has not observed
    Source, tests, and runtime checks Establish current implementation and behavior Architectural intent without a decision record
    Human owner Approve contracts, risk boundaries, and corrections That a generated summary is automatically current

    This separation makes failures diagnosable. If an answer is wrong, the team can ask whether the model reasoned badly, the graph was stale, the query was too broad, source was missing, or the approval rule was skipped.

    Long Context vs Structured Code Knowledge

    Long context and structured code knowledge solve different parts of the problem. A K3 request can carry a large task packet, code excerpts, decisions, and tool results. That helps when a task needs several related artifacts in one reasoning window. It does not make relationships explicit, select the relevant evidence, or reveal that a dependency was rebuilt after the packet was created.

    Structured code knowledge makes relationships queryable. An agent can ask for callers of a symbol, the services that consume a schema, the tests around a route, or the source records behind a design constraint. The answer should still be a starting point, not a patch instruction. Dynamic dispatch, generated code, reflection, plugins, undocumented operational dependencies, and stale indexing can all make an edge incomplete.

    Abstract comparison between raw context capacity, revision-bound code relationships, and source verification for Kimi K3

    The decision rule is practical:

    • Use a bounded context packet when the task has a known scope and the relevant artifacts can be cited directly.
    • Use graph retrieval when the hard question is relationship discovery across modules, documents, tests, and ownership boundaries.
    • Read source and run verification when the answer will change behavior, permissions, data, or a public contract.

    The two approaches can work together. A graph query finds a narrow evidence set; K3 reads it in context; tools confirm the current revision; a reviewer evaluates the resulting plan. The Kimi K3 Context Engineering guide explains how to make that packet accountable.

    What Graphs Add for AI Developers

    A useful AI code graph adds traceability more than it adds prose. Instead of asking an agent to remember a long repository dump, give it a relationship query with file and symbol evidence. That is especially valuable when the codebase has repeated names, indirect dependencies, generated layers, design records outside source, or multiple agents working from different sessions.

    Four graph capabilities are worth prioritizing:

    1. Module and ownership maps: Show where a responsibility begins, which public interfaces cross its boundary, and who can review a change.
    2. Dependency and impact paths: Connect imports, calls, schemas, configuration, queues, build artifacts, and affected tests without pretending all edges are runtime proof.
    3. Decision and document links: Connect a technical choice to its source record, owner, date, and the code paths it constrains.
    4. Freshness and provenance: Attach an indexed commit, generation time, extractor version, and source locations to every important result.

    K3's official API documentation supports custom tools, tool choices, and tool-result turns. That makes it possible to expose graph queries through an agent harness. The documentation is a protocol contract, not a guarantee that a graph query is correct; the harness must return clear evidence, respect access boundaries, and preserve the complete tool-call history required by K3's multi-turn flow.

    For a product-level model of structured repository evidence, visit the Graphify knowledge-graph hub. For a comparison that keeps a model-specific context system separate from graph retrieval, Macaron Context vs Code Knowledge Graph offers a related decision boundary.

    When Graph Retrieval Can Still Fail

    A graph can be wrong in a more precise way than a raw prompt, but it can still be wrong. Static extraction can miss dynamic imports. A call graph can overapproximate a dispatch path. A code graph may not see private deployment configuration. A document link may be obsolete. A branch can move after the graph is indexed. And a retrieved neighborhood can be so broad that K3 treats incidental relationships as task requirements.

    Build failure handling into the response format. A graph query should return its indexed revision, timestamps, source paths or symbols, relationship type, confidence or unknown state, and a statement of what it cannot observe. Make the agent say which edges it inspected in source and which remain graph-derived. This prevents a polished dependency diagram from functioning as an unearned fact.

    The same rule applies to model memory. K3 may have earlier messages, a compacted summary, or client-managed cache context, but those states are not authoritative over a revision-bound source record. When graph context and a prior model statement disagree, treat the disagreement as a retrieval task, not a vote.

    How to Combine Both Approaches

    Use a two-stage workflow. First, query a versioned graph for the smallest set of modules, dependencies, tests, decisions, and unknowns that can bound the task. Second, place that evidence and its provenance into K3's context, let the agent inspect current files and tools, and require an explicit plan before an edit. K3's kimi-k3 API documentation says long conversations and tool calls must carry the full assistant message forward; retain that record so later reviewers can reconstruct the evidence path.

    Then add governance:

    Stage Required artifact Stop condition
    Retrieve Revision, sources, relationships, and known gaps Graph revision does not match the task revision
    Interpret K3's evidence-backed plan and uncertainties Plan contains an uncited critical claim
    Verify Source reads, focused tests, and diff review A graph edge is relied on but never checked
    Refresh New index or marked stale records after change Changed paths invalidate indexed facts

    Keep the graph independent of a single model or provider. That lets a team reuse the same evidence layer when a client or model changes, while preserving access controls and audit records. CC Switch Knowledge Graph Workflow shows why provider routing and structured repository evidence should not be conflated.

    Abstract lifecycle for versioned sources, code relationships, freshness audit, selected agent evidence, and graph refresh

    FAQ

    What facts should a code graph expose?

    Expose facts that a reviewer can trace: entity names and types, source paths and symbols, relationship types, indexed revision, generation time, owner, links to supporting documents, and explicit unknowns. Start with module boundaries, public interfaces, dependencies, tests, configuration, and decisions. Do not expose a generated narrative without its source locations.

    How should teams audit graph freshness?

    Store the indexed commit and extractor version on every result, invalidate or flag records when relevant files, configuration, schemas, or lockfiles change, and sample important edges against current source and tests. A high-risk task should refuse graph evidence from an unmatched revision instead of silently accepting it.

    Can graph context conflict with model memory?

    Yes. A prior prompt, session summary, or cached prefix can describe an earlier branch or a mistaken inference. Treat the conflict as an evidence mismatch: compare revisions, inspect the named sources, update or invalidate the graph record, and make a human decide if the technical contract is ambiguous. Neither a large context window nor a graph result wins automatically.

    Conclusion

    Kimi K3 can reason over large, tool-assisted context, but that is different from maintaining structured repository knowledge. A well-governed code graph supplies versioned relationships and provenance; K3 turns a focused evidence set into questions, plans, and proposed changes; source, tests, and humans remain the authority.

    Combine them when relationship discovery is the bottleneck. Keep them separate when reporting capabilities: the model is not the graph, the graph is not the repository, and neither removes the need to verify the current revision.