Blog

  • Multica Large Codebase Context

    Multica Large Codebase Context


    A Multica large codebase workflow can coordinate who receives a task, where it runs, and how its status is tracked. It does not by itself tell an agent which module owns a behavior, which callers depend on it, or which tests prove a change is safe. Pair Multica’s task and resource controls with a revision-bound repository evidence layer, then require the assigned agent to verify every retrieved relationship in current source.

    This boundary matters because orchestration and repository understanding solve different problems. Multica’s managed backend owns workspaces, issues, task queues, and collaboration state. A local daemon invokes an installed coding-agent CLI, which performs the actual code work. Project Resources can point the run at a repository or local directory. None of those controls is a semantic model of the codebase.

    The product is also early and moving quickly. This article was checked against Multica v0.4.10 on July 24, 2026. Current cloud runtime execution is described as coming or waitlist-only, while the service can coordinate local daemon execution. Public fixed cloud pricing was not listed at the verification cutoff; the appropriate buying step is to contact sales rather than assume the trial implies a permanent free plan.

    Why Managed Agents Need Repository Context

    Multica large codebase work needs both the platform's coordination state and a bounded account of the repository relationships relevant to the task.

    A task board knows the work item. A runtime knows the checkout and tool process. A coding agent sees the prompt, instructions, files, and tool results available during its run. Large-repository work still depends on relationships that may sit outside the first obvious search result.

    Consider a change to an authorization rule. The named function may live in one package, while policy registration, generated clients, database migrations, feature flags, and contract tests live elsewhere. An agent can produce a plausible local edit after finding the definition and two direct callers. The patch can still break an indirect consumer or violate an architecture decision it never read.

    Useful Multica repository context therefore needs more than a repository pointer. It should provide a compact evidence packet:

    • indexed repository and exact commit;
    • likely modules and entry points for this task;
    • direct dependencies plus known indirect or unresolved paths;
    • relevant unit, integration, contract, and migration tests;
    • generated-code boundaries and source generators;
    • current architecture records, owners, and review constraints;
    • gaps that the agent must resolve before it edits.

    This packet narrows discovery without pretending to be authoritative. The agent should open the cited files in its own checkout and report any mismatch between the packet and current source.

    What Task Assignment Solves

    Multica repository context begins with the task's project resources and runtime brief, but those pointers do not by themselves establish call chains or change impact.

    Multica is strongest when the problem is operational coordination. Its documented workflow covers issues, task creation, agent assignment, progress, retries, selected workdir or runtime, and supported provider-session resumption. That answers practical questions: who should attempt the task, where should the process run, when did it start, and what state did the coordinator record?

    Project Resources add another useful layer. A Git repository resource can support an isolated per-task checkout. A local-directory resource works in the user’s directory and serializes access. Multica writes typed resource pointers to .multica/project/resources.json and summarizes available resources in the runtime brief.

    Those mechanics are relevant to searches such as Multica-ai, but the product name is not evidence of automatic architecture routing. Multica does not document a built-in rule that assigns an issue to an agent because a semantic graph says that agent owns the affected module. A team may build that policy externally, but it should describe the policy as its own integration.

    Project Resource preparation is also best-effort. If a fetch or resource brief fails, the task can still start without that section. A serious large-codebase workflow should treat a missing resource manifest as a visible precondition failure when the task depends on it, even if the platform does not block the run.

    What It Does Not Tell Agents

    The name Multica-ai identifies the coordination product; it does not imply that the product supplies a native semantic code graph.

    Assignment does not establish system structure. It does not prove:

    • the true runtime entry point for a feature;
    • the complete call chain through registration, reflection, events, or generated code;
    • the direction and authority of a dependency;
    • which schema or configuration file is canonical;
    • which tests cover the changed contract rather than a nearby implementation;
    • whether a design note still matches the checked-out revision.

    Workspace context and Skills do not close that gap on their own. Workspace context is shared guidance. A Skill is a reusable workflow package. Both can tell an agent how to investigate, what output shape to produce, or which command to run. Neither remains a current dependency model unless a separate process extracts, refreshes, and verifies those relationships.

    Session resumption has the same limit. Resuming a supported provider session can restore one task’s conversational continuity. It does not reconcile that session’s conclusions with another agent, a newer commit, or a source-of-truth architecture model.

    Who, where, and when controls beside module, call-chain, and test evidence

    Module, Call-Chain, and Impact Knowledge

    Build a small read-only repository layer that answers task-shaped questions. A generated JSON index can be enough for a modest codebase; a code knowledge graph becomes useful when relationships cross packages, repositories, schemas, events, and tests.

    At minimum, store nodes for repositories, commits, modules, symbols, services, schemas, tests, and decisions. Store edges such as defines, imports, calls, registers, publishes, consumes, generates, tests, and constrains. Every edge should retain a source location, indexed revision, extractor version, and confidence or derivation method.

    Repository relationships routed through current-source and test verification

    The assignment flow can then remain simple:

    1. Multica assigns the issue and prepares the task checkout.
    2. A pre-task hook or Skill requests a bounded context packet for the issue terms and target revision.
    3. The packet lists likely modules, dependency paths, tests, owners, and unresolved edges.
    4. The underlying coding agent verifies high-impact facts in source before planning edits.
    5. The agent records evidence and unknowns in the task result.
    6. Review compares the patch and tests against the same pinned revision.

    This is a proposed team architecture, not a native Multica knowledge-graph feature. Keep the graph read-only for ordinary agents. Give index updates to a separate service or reviewed maintenance job so a coding task cannot rewrite the facts used to judge its own safety.

    Limits and Verification Notes

    Structured context can be stale, incomplete, or confidently wrong. Generated code can hide its source. Dynamic dispatch can defeat static extraction. A branch may move after the packet is built. A graph can also reveal sensitive relationships across repositories that an assigned agent should not see.

    Use four controls:

    • Revision binding: reject or refresh a packet when its commit differs from the task base.
    • Provenance: show the file, symbol, and extraction method behind every material edge.
    • Access filtering: apply repository and path permissions before retrieval, not after generation.
    • Verification: require current-source checks and relevant tests before a relationship becomes a review conclusion.

    Multica’s workspace roles, agent assignability, daemon tokens, and underlying coding-tool permissions are separate boundaries. A private agent controls assignment, not the visibility or mutability of every context source. A local-directory resource also operates in the real directory, so process credentials and write scope deserve OS-level containment.

    Self-hosting is available, but the repository’s license is a modified Apache 2.0 license with restrictions around hosted or embedded commercial services and frontend branding. Teams evaluating deployment should review those actual terms rather than summarizing the project as stock Apache 2.0.

    FAQ

    Who validates assigned context?

    The task owner should validate scope and revision before work starts. The coding agent should verify cited paths and relationships in its checkout, and the reviewer should check material impact and test claims. The index maintainer owns extractor health, not the final engineering decision.

    When should tasks be split by module?

    Split when modules have separable write scopes, tests, and integration contracts. Do not split merely because directories differ. If two tasks change the same schema, runtime registration path, or release boundary, keep one integration owner and make the dependency explicit.

    What context should reviewers inspect?

    Reviewers need the base commit, retrieved modules and relationship paths, files the agent actually inspected, unresolved edges, changed contracts, and the tests run. They should also see whether the resource brief or index refresh failed.

    What is an example of a multi-agent system?

    For this article, a practical example is a coordinator assigning separate planning, implementation, test, and review tasks to different agents while preserving isolated write state. Multica can coordinate those roles; a separate repository evidence layer keeps their structural claims comparable.

    Conclusion

    Use Multica for assignment, lifecycle, resource preparation, and collaboration state. Use current source plus a revision-bound map or graph for module, call-chain, impact, and test knowledge. The reliable pattern is not “the coordinator understands the repository.” It is “the coordinator delivers a bounded task and auditable evidence to an agent that must verify both.”

  • Claude Code Repeated Repository Scanning

    Claude Code Repeated Repository Scanning


    Claude Code repeated repository scanning is a retrieval problem before it is a token problem. A workflow wastes context when each run rediscovers the same module boundaries, definitions, callers, and tests without preserving a source revision or reusing a trusted project map. The remedy is not “never scan again.” It is to scope each task, persist reusable structural candidates with provenance, retrieve only relevant evidence, and force rescans when freshness conditions fail.

    In this article, recipe is editorial shorthand for a repeatable workflow. Claude Code implements reusable workflows as Skills; it does not document a built-in repository-map cache.

    Why Recipes Re-Read the Same Repo

    Claude Code repeated repository scanning usually begins when a reusable recipe has no persisted, revision-aware map of the structure it is about to inspect.

    Repeated workflows often begin with broad instructions: inspect the repository, understand the architecture, then find the relevant code. That sequence is defensible for a new codebase, but expensive when every task repeats it.

    Repeated broad repository scanning feeding the same discovery loop

    Three things cause the loop:

    • the recipe has no bounded target or stop condition;
    • prior findings live only in conversation text and lack a revision;
    • stable guidance, procedures, and mutable code facts are mixed in one always-loaded file.

    Claude Code context optimization starts by separating those layers. Put stable conventions and essential commands in scoped CLAUDE.md files. Put specialized procedures in on-demand Skills. Keep current module, dependency, and test relationships in source-backed maps or an external index, not as timeless instructions.

    Anthropic's large-codebase guidance recommends starting Claude in the relevant directory, using nested instructions, excluding generated or vendor paths, and using code intelligence for definitions and references. These measures reduce unrelated file reads without claiming that previous analysis remains correct forever.

    For repeatable architecture and impact workflows, see Claude Code recipes for large codebases. The key addition here is measurement: prove that retrieval became smaller while review quality did not decline.

    Where Context and Token Cost Accumulates

    Effective Claude Code context optimization starts by measuring every context surface, not only the source files opened during the task.

    Context grows from more than source files. Instructions, conversation turns, tool inputs and outputs, file reads, search results, and Skill content all consume space. Anthropic notes that large repositories can fill context with unrelated instructions and file reads, increasing token use and degrading performance.

    The cost model needs qualification. Claude Code uses prompt caching and automatic compaction. API users are charged by token consumption, while Pro and Max usage is included in the subscription plan; therefore there is no universal dollar cost for “one repository scan.” Anthropic's cost documentation points users to /usage for session usage data and recommends moving specialized procedures from always-loaded CLAUDE.md content into Skills.

    Measure the retrieval pattern instead of inventing a savings percentage:

    Metric What it reveals
    file-read and search-tool count breadth of repository inspection
    input and cache-read tokens context consumed or reused
    time to first evidence-backed answer retrieval latency
    unsupported or omitted edges found in review quality cost
    age and indexed revision of reused maps freshness exposure

    Track these values for comparable tasks at a pinned commit. Lower token use accompanied by more missed dependencies is not an optimization.

    Persist Project Maps and Dependency Graphs

    A persisted project map is a team artifact or external index. It is not guaranteed Claude Code memory. At minimum, record modules, entry points, relation types, tests, source locations, repository revision, generation time, and known coverage gaps.

    A search such as “Claude Code Graphify” usually reflects interest in attaching a persistent structural layer to Claude's workflow. Graphify can be evaluated as one possible external code-graph layer, but it should be treated as a separately operated source of candidate relationships, not a native Claude Code feature. The broader architecture is covered in knowledge graphs for AI coding assistants.

    Persist only facts that are useful across tasks. A useful map might answer “which packages consume this schema?” or “which tests exercise this entry point?” It should not store a long narrative that every run must reread.

    For each stored edge, keep:

    • source and target identity;
    • relation type and direction;
    • source file or extraction evidence;
    • indexed commit or content hash;
    • extraction method and time;
    • coverage or uncertainty note.

    An external index may be exposed to Claude Code through MCP, a CLI, or another controlled tool. Query it for a small candidate set, then verify high-impact results against the current source revision.

    Retrieve Only Task-Relevant Files

    Begin each task with a retrieval plan:

    1. Pin the revision and name the target behavior, symbol, or module.
    2. Query a project map for candidate entry points and one relation type.
    3. Open the defining source and the nearest relevant configuration.
    4. Use code intelligence for definitions and references where available.
    5. Read tests that claim to exercise the selected paths.
    6. Expand only when evidence conflicts or a freshness rule fires.

    This sequence turns a broad scan into progressive retrieval. It also keeps code intelligence, graph queries, text search, and tests in their appropriate roles. Definitions and references can be precise for supported languages; text search catches configuration and strings; graphs support reverse and cross-module discovery; tests provide behavioral evidence.

    Use scoped Skills so the full procedure loads only when needed. Use nested CLAUDE.md or path-scoped rules for local conventions rather than placing every package's guidance in the root file. After context compaction, Claude Code reinjects some context surfaces according to documented limits, so concise, well-placed instructions still matter; context-window behavior should not be mistaken for a durable code index.

    Risks and Freshness Checks

    Less reading increases dependence on what was retained. A stale map can be more dangerous than a fresh scan because it looks intentional.

    Revision and source-evidence freshness gate for retained repository relationships

    Force a refresh when dependency manifests, public schemas, routing, plugin registration, generated clients, build configuration, migrations, or ownership boundaries change. Also refresh when the stored revision is not an ancestor of the working revision, the index lacks the target language, or source verification contradicts a returned edge.

    Use different expiry policies. Stable module descriptions may survive many commits with spot checks. Call edges, route registration, generated APIs, and tests around an active refactor should expire quickly. Runtime-discovered relationships need the shortest confidence window unless they are continuously observed.

    Keep a rescan budget rather than a no-rescan rule. Broad scans are appropriate for an unfamiliar repository, a major architecture migration, a suspected coverage gap, or a failed freshness check. For routine changes, retrieve a small map slice and validate it against source.

    Finally, audit omissions. Sample changes after merge and ask whether the retrieval plan missed a dependent module, relevant test, or operational boundary. Feed that failure into the map schema, freshness triggers, or recipe—not into an unsupported claim that more context is always better.

    FAQ

    When should a recipe force a rescan?

    Force one when the pinned revision and stored map diverge materially, relevant manifests or schemas changed, the target uses unsupported dynamic behavior, or source contradicts the map. Also rescan after a known extraction failure or when the task crosses an unindexed repository boundary.

    What maps should expire quickly?

    Runtime registration, call chains around active refactors, generated interfaces, routes, feature flags, migrations, and test-to-behavior mappings should have short expiry windows. Stable ownership or high-level module-purpose records can last longer if they retain provenance and periodic review.

    How should teams measure reduced reading?

    Compare similar tasks at pinned revisions. Track file reads, searches, input and cache-read tokens, time to first cited evidence, map age, and omissions found in review. Use a baseline and report distributions, not one favorable run or a universal savings percentage.

    claude code plan mode

    Plan mode can help keep an analysis read-only while Claude explores and proposes a plan, but it does not create a persistent repository map. Teams still need scoped retrieval, freshness checks, evidence review, and appropriate permission rules for the surrounding workflow.

    Conclusion

    Reduce Claude Code repeated repository scanning by reusing small, revisioned maps and retrieving evidence progressively. Measure both context reduction and missed relationships. Rescan when freshness fails, and never let a persisted map outrank current source, configuration, tests, or responsible human review.

  • 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.

  • Claude Code Repository Analysis Skill

    Claude Code Repository Analysis Skill


    A Claude Code repository analysis Skill should standardize how an agent finds entry points, module relationships, dependencies, tests, and uncertainty. It should not contain a supposedly complete map of the repository. Put the Skill at .claude/skills/repository-analysis/SKILL.md, commit it with the project, give it a specific description, and test its evidence contract against a fixture repository before using it for consequential change planning.

    The useful unit is one bounded workflow: receive a target and revision, collect source-backed relationships, label unsupported edges, map tests and risk, then return a predictable report for human review.

    Before Building the Skill

    A Claude Code repository analysis Skill needs a bounded owner and evidence contract. “Understand the repository” is too broad. A better contract is: “Given a symbol, module, endpoint, or change proposal, identify its entry points, direct relationships, relevant tests, and unresolved risks within a stated scope.”

    A codebase Skill should own the repeatable procedure, not a mutable snapshot of repository relationships. That separation keeps the workflow reviewable as the code changes.

    Write down the inputs before writing SKILL.md:

    • target symbol, behavior, or directory;
    • repository revision and working directory;
    • excluded paths such as vendored or generated output;
    • supported languages and available code-intelligence tools;
    • required output fields and verification checks;
    • escalation conditions for dynamic or inaccessible evidence.

    Keep responsibilities separate. CLAUDE.md is appropriate for stable repository conventions and build commands. A Skill is the on-demand procedure. Current module and dependency relationships must still come from source, code intelligence, tests, or an external knowledge graph for AI coding assistants. For a deeper layer comparison, see Claude Code recipes vs knowledge graph.

    Claude Code Skills expose names and descriptions for discovery, then load the full body when used. That makes the description part of the interface: say when the Skill should activate, what target it expects, and what output it produces.

    Define the Repository Analysis Workflow

    Start the codebase Skill with a small SKILL.md rather than a large reference manual:

    A repository analysis Skill contract routing task, revision, and scope through tools into typed evidence

    ---
    name: repository-analysis
    description: Analyze a specified repository symbol, module, or change surface and return source-backed entry points, relationships, tests, risks, and unknowns. Use for bounded repository analysis before planning a change.
    ---
    
    1. Confirm the target, revision, and directories in scope.
    2. Locate definitions and executable or configured entry points.
    3. Trace direct inbound and outbound relationships.
    4. Inspect indirect registration and generated boundaries separately.
    5. Map specific tests to claimed behaviors.
    6. Return evidence tables, unknowns, and verification steps.
    

    This is deliberately procedural. Do not encode facts such as “service A always calls service B” in the Skill body unless they are stable architectural rules with an owner. Ask the Skill to rediscover mutable relations from evidence.

    This Claude Code repository analysis Skill example therefore freezes the output contract while leaving current facts to source-backed retrieval.

    Freeze an output schema so results can be compared across runs:

    Field Required content
    Scope revision, target, included and excluded paths
    Entry points file, symbol, trigger type, evidence
    Relationships from, relation, to, direct/inferred/unknown
    Tests test name, file, behavior or edge covered
    Risks failure mode, affected boundary, proposed check
    Unknowns missing tool, dynamic behavior, contradictory evidence

    Require the Skill to stop and ask for scope when the target is ambiguous. A repeatable workflow that begins from the wrong boundary only makes a wrong answer more consistent.

    Add Module, Dependency, and Entry-Point Queries

    A practical Claude Code repository analysis Skill example should define query classes, not invent commands that may not exist in the reader's environment.

    For module discovery, locate package manifests, build targets, module declarations, and top-level imports. Return ownership and responsibility only when supported by source, repository documentation, or an ownership file. Directory names are hints, not architectural proof.

    For entry points, inspect executable mains, exported handlers, routes, jobs, event consumers, plugin registration, configuration loaders, and deployment manifests relevant to the target. Ask for the file and symbol that establishes each entry. Treat convention-based framework discovery as an explicit relation, not an ordinary function call.

    For dependencies, prefer definitions and references from a configured code-intelligence plugin. Supplement those results with text search for configuration keys, strings, templates, schemas, and generated boundaries. The Skill should distinguish import dependency, call, registration, publication, data read/write, and deployment coupling; collapsing all of them into “depends on” makes later impact analysis unreliable.

    For an external graph or search index, define the question and the evidence returned: indexed revision, source location, relation type, and query time. Claude Code can reach external services through MCP, but an MCP connection does not make the graph native or guarantee its correctness.

    End every query block with a verification instruction. For example: reopen the defining file, reproduce one reference lookup, and flag any result that points outside the declared revision or scope.

    Map Tests and Risk Areas

    Make test mapping an evidence task. A test with a matching filename may not execute the path under review, while a contract or integration test in another package may be the strongest check.

    Require these fields for each candidate test: test name, file, setup or fixture, entry point exercised, assertion relevant to the target, and coverage status. Use statuses such as directly exercises, covers an adjacent contract, name match only, and not found.

    Then classify risk by boundary rather than by generic severity:

    • public API or serialized schema compatibility;
    • migration and persistent state behavior;
    • authorization, tenancy, or secret handling;
    • asynchronous delivery, retry, and idempotency;
    • generated client or build artifact drift;
    • deployment configuration and rollback.

    For each material risk, request one existing check and one missing or proposed check. The Skill may recommend a test, but it should not edit code or execute a mutating command during an analysis-only run.

    Test the Skill itself on a fixture repository with known entry points, callers, and tests. Include negative cases: aliases, dynamic registration, generated code, an unrelated name match, and one intentionally unknowable edge. The expected output must include “unknown”; otherwise the test rewards confident guessing.

    Maintenance and Permission Risks

    Assign an owner and review triggers. Update the Skill when its evidence schema, supported tooling, repository layout conventions, or risk policy changes. Do not update it merely to cache a one-off discovery; that belongs in source-backed documentation or a refreshed index.

    Permissions need precise wording. The allowed-tools field can pre-approve listed tools while a Skill is active, but Anthropic states that it does not restrict other tools. It is not a read-only sandbox. For an analysis-only workflow, use organization or project permission rules, including deny rules or an appropriate permission mode, and keep workspace trust requirements in mind.

    A fixture repository testing structural traps, allowed reads, denied paths, and safe escalation

    Avoid pre-approving broad shell access simply to make the Skill convenient. Prefer read, search, code-intelligence, and explicitly scoped graph queries. Separate the analysis Skill from any implementation or deployment Skill so a request for impact mapping cannot silently become a mutation workflow.

    Operational checks can show whether the Skill loads, not whether its claims are correct. Claude Code's /context view helps inspect loaded configuration, and the skill_activated OpenTelemetry event can indicate invocation in supported monitoring setups. Neither proves that a call edge or test mapping is factual; fixture tests and source review remain necessary.

    Version the Skill and its fixtures together. Record the Claude Code version, available code-intelligence plugins, permission mode, fixture commit, and expected evidence schema for every acceptance run. Re-run the suite after changing frontmatter, tool adapters, repository conventions, or a permission rule. Include one denied path and one stale external-index response so the Skill proves it can stop safely, not only complete a happy path. In production sampling, track unsupported relationship claims, missed tests, scope clarifications, and review corrections. A lower file-read count is useful only when these correctness measures remain stable.

    Keep a rollback path. If a revised Skill increases false confidence or silently widens its tools, restore the prior reviewed version and preserve the failing output as a regression fixture. Treat Skill maintenance like interface maintenance, not prompt polishing.

    FAQ

    Who should approve Skill updates?

    The repository or platform team can own the shared workflow, but affected module owners should approve changes to scope, evidence requirements, and risk rules. Permission changes deserve a security or tooling-owner review. Use normal code review and require an updated fixture result for behavioral changes.

    What should the Skill not automate?

    It should not edit code, change permissions, run deployment commands, approve its own evidence, or present inferred relationships as authoritative. Keep implementation, migration, and release operations outside an analysis-only Skill unless the team creates a separately reviewed workflow.

    How should teams test Skill output?

    Use a versioned fixture repository with known definitions, callers, indirect registrations, tests, and missing edges. Compare structured output, not prose style. Also sample the Skill against real changes and record false relationships, missed tests, unsupported claims, and time-to-evidence.

    claude code mcp

    MCP is one way Claude Code connects to external tools and data sources. A repository analysis Skill can request a scoped MCP query to a code-search or graph service, then verify returned edges against source. The Skill and the MCP server have separate permissions, ownership, and freshness concerns.

    Conclusion

    A sound Claude Code repository analysis Skill is a small, reviewable procedure with a strict evidence schema. Keep mutable repository facts outside the Skill, require explicit unknowns, test the workflow against known and negative cases, and enforce read-only behavior through actual permission controls rather than suggestive frontmatter.

  • Claude Code Recipes for Large Codebases

    Claude Code Recipes for Large Codebases


    Claude Code recipes for large codebases should be repeatable analysis workflows, not collections of clever prompts. In this article, recipe is editorial shorthand. Anthropic's current product surface is a Skill; legacy custom commands still work but have been merged into Skills. A useful recipe tells Claude what scope to inspect, what evidence to return, what uncertainty to preserve, and how a reviewer can verify the result.

    The three recipes below cover architecture orientation, module and call-chain analysis, and impact plus test mapping. None assumes that Claude Code has a built-in repository graph. They work with source reads and code intelligence, and can optionally query an external, source-attributed index.

    Before Using Recipes on a Large Codebase

    Claude Code recipes for large codebases should begin by reducing the search surface. Anthropic's large-codebase guidance recommends starting Claude in the directory relevant to the task, using nested CLAUDE.md files for local conventions, excluding generated or vendor directories, and adding code-intelligence plugins where supported. That setup matters more than making a repository analysis prompt longer.

    Define four fields before running any recipe:

    1. Scope: repository commit, workspace or package boundaries, and directories that are out of scope.
    2. Question: one architecture, call-chain, or impact question, stated so a reviewer can tell when it has been answered.
    3. Evidence contract: file paths, symbols, line-level references where practical, relevant tests, and commands or tools used.
    4. Stop conditions: missing language support, generated indirection, runtime registration, unavailable services, or contradictory evidence.

    This turns the prompt into reviewable work. It also prevents a common failure mode: Claude reads broadly, produces a plausible summary, and leaves no way to distinguish code evidence from inference.

    Treat repository analysis prompts as evidence contracts rather than prose templates. The required scope, output fields, and stop conditions matter more than stylistic wording.

    Stable conventions belong in CLAUDE.md; the procedure belongs in a Skill; current dependency and call relationships still need to come from code, code intelligence, or an external knowledge graph for AI coding assistants. If your team wants to package the procedure, see the Claude Code repository analysis Skill.

    Recipe for Architecture Overview

    Architecture-focused repository analysis prompts should build a bounded orientation map, not summarize every directory. Give Claude the commit and scope, then ask it to identify:

    A search for “Claude Code recipes for large codebases Reddit” may provide examples, but the architecture recipe still needs repository-specific evidence and review criteria.

    A bounded architecture recipe moving from entry points through modules and dependencies into an evidence packet

    • user-facing or machine-facing entry points;
    • top-level modules and the responsibility of each;
    • dependency direction between those modules;
    • shared infrastructure and cross-cutting concerns;
    • configuration, build, and deployment boundaries relevant to the target area;
    • unresolved areas that would require runtime evidence or an owner interview.

    Require a compact output table with component, responsibility, entry evidence, outbound dependency, and confidence. The confidence column is not a probability score. It should use explicit labels such as direct source evidence, supported inference, or unknown.

    A practical instruction is:

    Start from documented and executable entry points. Trace only enough imports, registrations, and configuration to explain the target system boundary. Cite a file and symbol for every component. Mark runtime-discovered relationships as unknown unless a test, configuration file, or code-intelligence result supports them. End with three verification checks a maintainer can run.

    Do not ask for “the complete architecture.” In a monorepo, that request encourages breadth without proof. Ask for the smallest map that answers the task, then expand one uncertain boundary at a time. The deliverable should let a new reviewer challenge individual edges instead of accepting one polished narrative.

    Recipe for Module and Call-Chain Analysis

    A search such as “Claude Code recipes for large codebases Reddit” often reflects a reasonable need for reusable examples. The useful pattern, however, is not a copied prompt. It is a call-chain contract that separates direct evidence from possible runtime behavior.

    Start with one symbol, endpoint, event, job, or configuration key. Ask Claude to return:

    • its definition and public entry points;
    • direct callers or references found through code intelligence;
    • adapters, registrations, dependency-injection bindings, and generated layers;
    • outbound calls and observable side effects;
    • branches that are indirect, dynamic, or not statically resolvable;
    • the files and tests a reviewer should open next.

    Code intelligence can provide precise definition and reference lookups for supported languages. Text search remains useful for strings, configuration, templates, and languages without a configured server. Neither technique alone proves a complete runtime call graph.

    Use an edge table rather than prose:

    From Relation To Evidence Status
    symbol or entry point calls, registers, publishes, reads target file, symbol, lookup direct, inferred, unknown

    Then require a reverse check: choose one claimed downstream effect and trace back to the original entry point independently. If the two paths disagree, the recipe should report the disagreement rather than smooth it over.

    Recipe for Impact and Test Mapping

    Impact analysis begins with a proposed change, not with the whole repository. State the symbol, schema, API, configuration, or behavior that may change. Ask Claude to map four surfaces: direct dependents, compatibility boundaries, stateful or operational effects, and tests.

    A changed interface fanning out across package boundaries to affected tests and a human-review path

    The output should distinguish:

    • compile-time impact: imports, types, interfaces, generated clients, and build targets;
    • runtime impact: registrations, queues, routes, feature flags, migrations, and external integrations;
    • behavioral impact: assumptions encoded in callers, validation, error handling, and fallback paths;
    • verification coverage: unit, integration, contract, end-to-end, and operational checks.

    A test file is not automatically evidence that a behavior is covered. Require Claude to cite the specific test name and explain which edge or behavior it exercises. Also ask for negative cases: tests that appear related by filename but do not reach the changed path, and important paths for which no test was found.

    Finish with a review matrix: risk, affected evidence, existing check, missing check, owner. The owner can be a team or CODEOWNERS path; do not invent a person. For a high-risk boundary, the recipe should recommend a human verification step or a targeted test, not a larger speculative scan.

    If an external code graph is available, query it for candidate dependents, then confirm the important edges against the pinned source revision. Anthropic documents exposing an existing search or RAG index through MCP; that is an integration option, not a native Claude Code index.

    Limits, Drift, and Review Notes

    A recipe controls procedure. It does not make stale instructions, incomplete language-server results, or an outdated graph correct. Treat every stored project map as a snapshot with a source commit and generation time. Force revalidation when dependency manifests, routing, schemas, build configuration, or generated interfaces change.

    Review output at three levels:

    • Evidence validity: do cited paths and symbols exist at the stated revision?
    • Edge validity: does the source support the claimed direction and relation?
    • Coverage: did the recipe search the relevant static, configuration, generated, and runtime-registration surfaces?

    Keep unknowns visible. Dynamic dispatch, reflection, generated code, macro expansion, and runtime configuration can defeat static inspection. A mature result may contain more qualified uncertainty than an early result; that is often an improvement.

    Finally, keep the recipe short enough to maintain. Put stable repository facts in scoped CLAUDE.md files, reusable procedures in Skills, and current structural claims in source-backed evidence. When any of those layers changes, review its owner and revision independently.

    FAQ

    Who should maintain repository recipes?

    The team that owns the affected architecture boundary should maintain the recipe, with one named role responsible for review. Platform teams can own the shared evidence schema, but module owners should approve scope, special cases, and verification rules. Store the recipe with the repository so changes are reviewed beside code.

    When should a recipe call a graph query?

    Call an external graph when the question spans many modules, requires reverse dependency lookup, or repeats often enough that broad source scanning is wasteful. Use it to generate candidate relationships, not final truth. Check high-impact edges against source at the graph's indexed commit.

    How should teams audit recipe output?

    Sample cited files and symbols, reproduce at least one lookup, reverse-trace one important edge, and inspect every “unknown.” Compare the result with a small fixture or a change whose impact is already understood. Record false edges, omissions, and stale sources so the recipe or context layer can be corrected.

    what is claude code

    Claude Code is Anthropic's coding agent for terminal, IDE, desktop, and web workflows. It can read repositories, use tools, follow CLAUDE.md instructions, and load Skills. Those features support analysis workflows, but they do not turn every repository into an automatically maintained code graph.

    Conclusion

    The best Claude Code recipes for large codebases are narrow, evidence-producing, and comfortable reporting uncertainty. Start with one bounded question, require files and symbols for every important claim, and end with a human-verifiable check. Save repeated procedures as Skills, and treat code intelligence or an external graph as evidence sources whose coverage and freshness still need review.

  • Multiple Ralph Loops Shared Context

    Multiple Ralph Loops Shared Context


    Two loops can read the same repository and still work from incompatible assumptions. One sees a module before a refactor, another records a test mapping from a different branch, and both treat the finding as current. Parallelism then converts context drift into merge conflict or, worse, a clean merge with inconsistent behavior.

    Multiple Ralph loops need shared repository knowledge only where it is safe to reuse. Branch state, task progress, scratch work, and write authority should remain isolated. The design goal is a read-only common orientation layer with explicit provenance, not a shared agent mind.

    Why Multiple Loops Need Shared Context

    Multiple Ralph loops often repeat the same orientation work. Each loop locates module owners, reads repository rules, identifies public entry points, and finds relevant tests. A reviewed, current index can prevent every worker from rebuilding that map independently.

    Parallel Ralph agents need the same source-backed orientation without sharing mutable task state. That distinction keeps reuse separate from coordination authority.

    This concurrency is not a universal property of Ralph. Geoffrey Huntley’s original description presents a simple outer loop operating on a plan and repository with executable backpressure. The snarktank implementation similarly runs one task-oriented process per iteration. Concurrent workers are an implementation choice layered on top.

    Ralph Orchestrator is one such variant. Its parallel-loop guide describes worktree-isolated loops and optional integration of successful branches. That makes coordination explicit, but it does not make every state surface safe to share.

    The useful common ground is knowledge that many tasks need and no implementation loop should mutate casually: repository rules, module boundaries, ownership, definitions, dependencies, and verified test relationships. Everything shared should still identify the commit and source from which it was derived.

    What Should Be Shared Read-Only

    Parallel Ralph agents should share approved repository instructions and architectural constraints as read-only context. The AGENTS.md specification allows instructions to be scoped by directory, with more deeply nested files applying within their subtree. A loop should receive only the rules relevant to the paths it reads or edits, not an undifferentiated global prompt.

    A read-only repository knowledge core feeding three isolated worktree and task-state lanes

    Share derived structural indexes as read-only data. A code graph can provide modules, symbols, imports, calls, implementations, ownership, and test mappings with file and commit provenance. Graphify is one possible codebase graph layer for this purpose. Each loop can query a task-sized subgraph and verify the cited source in its own checkout.

    Share immutable task specifications when several loops contribute to the same program, but assign each task a distinct owner and write scope. Shared acceptance criteria establish a common contract; they should not become a collaborative scratchpad that any worker can rewrite.

    Searches for “Multiple Ralph loops Reddit” may surface useful coordination anecdotes, but they are not evidence that one shared memory model is safe. Classify each item by authority, provenance, scope, and expiry before sharing it.

    Community discussions often collapse all memory into one category. The safer distinction is authority. Source-derived context and approved rules can be shared because workers consume them. Hypotheses, interim decisions, and branch-local results should remain with the loop that produced them until reviewed and promoted.

    What Must Stay Isolated

    Searches for “Multiple Ralph loops Reddit” may surface coordination anecdotes, but they do not change the isolation requirement. Branch and worktree state must remain isolated. Two loops editing the same checkout can overwrite uncommitted work, run checks against mixed changes, and produce ambiguous Git history. A dedicated branch and worktree give each task a stable filesystem and commit identity.

    Task progress should also be isolated. A loop’s failed attempts, pending checks, and next action belong to its task. Merging progress logs creates an ordering problem and can cause one worker to adopt another worker’s unresolved hypothesis. Share a verified finding through a promotion workflow instead.

    Scratchpads, tool output, temporary credentials, and environment values should never become general shared context. Their sensitivity and lifetime differ from repository knowledge. Store secrets in approved systems and pass only the minimum reference needed for the task.

    Write authority must stay isolated even when read context is shared. A graph result may show that a dependency crosses into another team’s module. That evidence can trigger coordination, but it does not grant the loop permission to edit the dependency. Read scope, write scope, and merge authority are separate controls.

    Branch, Task State, and Write-Scope Boundaries

    Assign each loop a task ID, base commit, branch, worktree, allowed write paths, validation commands, and completion condition. Record these values in machine-readable task state. At iteration start, the loop should reject shared context whose commit or scope is incompatible with its checkout.

    When a worker discovers a cross-task fact, it should publish a proposed finding containing the claim, source paths and symbols, commit, evidence type, and expiration condition. Another owner or automated check can validate it before the fact enters the read-only shared layer. This prevents a confident summary from bypassing review.

    An isolated loop finding passing quarantine, provenance, owner review, shared context, and merge gates

    Merge in a controlled order. A successful branch can still conflict semantically with a branch that passed tests against an earlier base. Rebase or merge the current integration state, rerun affected checks, and invalidate structural context that no longer matches. The merge owner should resolve overlap; individual loops should not silently coordinate by editing a common file.

    Ralph Orchestrator documents a shared memory file with locking in its codebase, alongside loop-specific events, task state, and scratchpads. A lock prevents simultaneous file corruption; it does not establish that the stored claim is correct or safe for every loop. Content still needs scope, provenance, ownership, and expiry.

    Conflict and Security Risks

    The most common conflict is stale shared context. A module map indexed at the base commit may become wrong after the first branch merges. Attach commit and index version to every result, then invalidate or rebuild after structural changes. Do not let “latest” remain an unverified label.

    Semantic conflicts are harder than textual conflicts. Two branches may modify different files while making incompatible assumptions about an interface or data model. Shared dependency and ownership information can flag the overlap early, but affected tests and human review remain necessary.

    Security risks include cross-repository disclosure, secret leakage through logs, prompt injection stored as “memory,” and excessive permissions on the shared service. Apply repository access controls to indexing and queries, sanitize untrusted content, and keep implementation loops unable to rewrite the evidence they consume.

    Ralph Orchestrator’s MCP surface should not be mistaken for a native code-graph bridge. Its documented role is an inbound, workspace-scoped control plane for orchestrator state. Connecting a graph through MCP or another transport would be a separate integration with separate credentials, audit logs, and lifecycle rules.

    Finally, define a safe stop condition. Pause a loop when its base commit is obsolete, its write scope overlaps a merged task, required shared context is stale, or validation reveals a cross-task contract change. Parallel throughput is not useful when coordination evidence is uncertain.

    FAQ

    Who merges shared findings?

    A designated integration owner or reviewed automation should promote findings into the shared read-only layer. The producer supplies source paths, symbols, commit, and limitations. For architecture, security, or cross-team claims, the relevant code owner should approve the promotion.

    What should never be shared between loops?

    Do not broadly share secrets, temporary credentials, raw private prompts, unreviewed hypotheses, mutable scratchpads, or branch-local task state. Avoid sharing derived relationships without provenance. A loop can report a finding, but another loop should not receive it as authoritative until it is validated.

    How should stale shared memory expire?

    Tie structural facts to a commit and index version, task findings to a task or branch, and reviewed rules to an owner and review trigger. Invalidate on relevant merges, refactors, generation changes, or contradiction from current source. Archive history for audit rather than feeding it into active context.

    What is the Ralph Wiggum coding technique?

    It is an iterative agent workflow that repeatedly works from a task or plan, modifies a repository, and uses tests, builds, or other checks as feedback. Parallel workers, worktrees, shared memory, and code graphs are implementation options, not requirements of the base pattern.

    Conclusion

    Multiple Ralph loops work best when they share evidence, not mutable thought. Keep reviewed rules and source-derived repository structure read-only and provenance-rich. Isolate branches, task progress, scratch state, write permissions, and merge authority.

    The hard boundary is promotion: a loop can discover a useful fact, but that fact becomes common context only after its scope and source are checked. For repository orientation in a single loop, see Ralph Loop large codebase context. For the shared structural layer, see knowledge graphs for AI coding assistants.

  • Ralph Knowledge Graph Integration

    Ralph Knowledge Graph Integration


    A repeated coding loop benefits from a stable task and fresh inspection of the repository. It does not benefit from reconstructing the same module boundaries and dependency paths from scratch. A code graph can reduce that orientation cost, but only if it returns scoped, current, and verifiable evidence.

    This article describes a proposed Ralph knowledge graph integration. It is not a built-in feature of Ralph, Anthropic’s Ralph Loop plugin, or Ralph Orchestrator. The design keeps the graph read-only to the implementation loop, treats results as candidates rather than truth, and preserves source inspection and tests as backpressure.

    Before Adding a Knowledge Graph

    Establish the failure you are trying to fix. If iterations repeatedly miss indirect consumers, reopen the same ownership files, or choose the wrong tests, structural retrieval may help. If the repository is small and module boundaries are obvious, a graph may add more maintenance than value. Start from observed retrieval failures, not the attractiveness of the architecture.

    A Ralph code graph is justified only when those failures require repeatable relationship queries. Define that need before choosing a schema, transport, or vendor.

    Define the Ralph implementation too. Huntley’s original pattern uses an outer loop, a stable plan, one task per iteration, and executable feedback. The snarktank implementation launches a fresh Amp or Claude process for each iteration. Anthropic’s official plugin continues in the current Claude Code session through a Stop hook. Those choices determine when graph context is fetched and how long it remains valid.

    Freeze an integration contract before connecting tools. It should name the task ID, active commit, allowed read and write scope, graph schema version, freshness policy, maximum result size, and required provenance. The graph can orient the loop; it cannot expand the authorized task.

    A Ralph knowledge graph database should also have a clear ownership model. Decide who builds it, who can query it, which repositories and paths it includes, and how index failures are reported. Do not let an empty or partial result silently mean “no dependency exists.”

    Map Ralph Tasks to Graph Queries

    A Ralph code graph query should turn acceptance criteria into explicit structural questions. “Change the retry policy” might become: which module defines the client, which entry points call it, which wrappers override the policy, and which tests exercise timeout and retry behavior? “Rename a public type” might request its definition, implementations, imports, generated bindings, and external package boundaries.

    Each query should begin narrow. Retrieve the owner, definition, and direct relationships first. Expand to transitive consumers only when the task or source evidence requires it. This prevents a graph traversal from becoming another repository dump.

    A Ralph knowledge graph database should expose the same narrow query boundary to every iteration. It should not turn a request for one owner or relation into an unrestricted graph export.

    The result contract matters. Each node or edge should carry a file path, symbol, relationship type, active or indexed commit, and index version. If the system assigns confidence or marks an edge as inferred, expose that status to the agent. A path with no source provenance is an architectural suggestion, not evidence.

    Keep text search beside graph retrieval. ripgrep deterministically searches line-oriented text and, by default, respects ignore rules while skipping hidden and binary files. It can find literals, configuration keys, and registration strings that a static graph may not model. The graph answers relationship questions; text search answers text questions.

    Retrieve Modules, Dependencies, and Tests

    A Ralph knowledge graph database needs only the relationships required by its approved task classes. The minimum useful graph often contains modules, definitions, imports, references, calls, implementations, and test relationships. Repository-specific edges may connect schemas to generated files, routes to handlers, migrations to models, or packages to owners. Add them only when extraction is reliable enough to support the tasks that need them.

    For a change to an interface, the loop might retrieve the defining module, every implementation, direct consumers, package-boundary crossings, and related tests. It should then open those source locations. If a language feature, macro, runtime registry, or dependency-injection container makes an edge uncertain, the query result should say so and point to the configuration that needs manual inspection.

    Test mapping deserves particular caution. File proximity and name similarity are weak evidence that a test covers a behavior. Prefer relationships derived from imports, executed call paths, build metadata, or an explicit repository mapping. A human owner should validate mappings used for security, migrations, and public contracts.

    Graphify is one possible codebase graph layer for these queries. The defensible claim is that structure-aware retrieval may help an agent assemble a smaller context slice in repositories where relationships are otherwise expensive to recover. It does not guarantee complete architecture, lower cost, or safer edits for every codebase.

    Feed Results Into the Implementation Loop

    At the start of an iteration, pass the task, current commit, and write scope to a read-only graph query. Return a ranked context packet containing the likely owner, entry points, dependencies, tests, and provenance. The agent should confirm the packet against the checkout before planning edits.

    A read-only graph service returning provenance-backed candidates to current source and tests

    Next, use the verified relationships to choose files and checks. The graph may suggest that an interface has three implementations and two test suites. The agent opens all three implementations, confirms which tests exercise the changed contract, and uses exact search for configuration or string-based registration that the graph might miss.

    After the edit, run the repository’s normal tests, builds, linters, type checks, or static analysis. In Ralph’s model, these checks provide backpressure. They do not prove that the graph was complete, but failures can reveal a missed edge and supply data for improving the index.

    Persist only the useful task-scoped findings between iterations: verified owner, relevant paths, failed retrieval assumptions, and the commit against which they were checked. Do not copy an entire subgraph into an append-only prompt. Query again when the repository state or task changes.

    Claude Code supports external tool connections through MCP, which is one possible transport for a graph query. That does not mean the Anthropic Ralph plugin or any other Ralph implementation includes a graph service by default.

    Drift, Access, and Review Risks

    Drift is the primary technical risk. An index built at commit A can return plausible but wrong relationships at commit B. Require a matching commit or an explicitly documented delta, and fail closed when provenance is missing. Rebuild or incrementally update after structural edits, generation changes, or schema-version changes.

    Candidate graph context passing revision, permission, and human-review gates

    Access is separate from write scope. A graph may contain paths the current agent is not allowed to read, or reveal names across repository boundaries. Apply source permissions to indexing and retrieval. Even when a result is readable, it does not authorize the loop to edit that module.

    Review should expose the graph’s role. For material changes, keep the query, returned source locations, index version, relationships the agent verified, and known blind spots. Reviewers should be able to reproduce the retrieval path and challenge a missing consumer without trusting an opaque summary.

    Ralph Orchestrator requires an additional distinction. Its parallel-loop documentation describes worktree-isolated loops, and its MCP server exposes orchestrator state as an inbound workspace-scoped control plane. That is not a native outbound bridge to a code graph. A graph connection would be a separate integration with its own permissions and lifecycle.

    Finally, audit false positives and false negatives on real tasks. If graph retrieval frequently needs broad correction, simplify the graph or improve extraction before making it a default dependency.

    FAQ

    What graph facts should stay read-only?

    Derived definitions, imports, calls, implementations, test mappings, and ownership edges should be read-only to the implementation loop. The loop can report a suspected error, but the graph should be rebuilt from source or corrected through a reviewed annotation workflow. This preserves the distinction between evidence and agent memory.

    Who validates test mappings?

    The code owner or team responsible for the behavior should validate high-impact mappings. Automated extraction can propose tests, but a mapping should not be treated as coverage proof unless its basis is clear. Security, migration, and public-interface changes deserve explicit human review.

    When should the graph be rebuilt?

    Rebuild or incrementally update it after relevant commits, structural refactors, dependency or generation changes, parser upgrades, and schema-version changes. Force a rebuild when provenance does not match the active checkout or when a verified false negative suggests the index is incomplete.

    What is the Ralph Wiggum strategy?

    It is an iterative coding-agent approach that repeatedly works from a task or plan and uses repository changes plus executable checks to make progress. Implementations vary in prompt handling, process lifetime, persisted state, stopping conditions, and concurrency. A code graph is an optional extension, not part of the definition.

    Conclusion

    A useful Ralph knowledge graph integration is a narrow retrieval boundary, not a second source of truth. Map each task to structural questions, return a small packet with provenance, confirm it in source, and keep standard tests and review in control of the edit.

    Build the graph only where repeated failures justify it, and document freshness and permissions as part of the integration. For the wider structural model, see knowledge graphs for AI coding assistants. For sharing verified context across concurrent workers, see multiple Ralph loops and shared context.

  • Ralph Code Search Problems

    Ralph Code Search Problems


    An agent searches for a feature name, finds no exact match, and concludes that the feature does not exist. It then adds a second implementation beside the first. That is not a random search failure. It is an inference failure: the retrieval method answered a narrower question than the agent believed it had asked.

    Ralph code search problems become costly because the loop can repeat the same false negative with fresh confidence. The remedy is to understand what text search proves, recognize repository patterns that hide relationships, and require source-backed verification before turning “not found” into “missing.”

    Why Ralph Can Miss Existing Features

    Ralph code search problems begin where task language and repository language diverge. “Audit failed logins” may be implemented under event names, middleware, hooks, or a generic security pipeline. An exact search for the task phrase can return nothing even though the behavior exists.

    That is a coding agent search failure when the agent converts a narrow text result into a broad behavioral conclusion. The correction is to narrow the conclusion or expand the evidence surface.

    Geoffrey Huntley’s Ralph account documents this class of failure: an agent used ripgrep, concluded functionality was absent, and created duplicate code. The lesson is not that ripgrep behaves unpredictably. The lesson is that absence of a string is weak evidence about absence of behavior.

    Repeated loops magnify the issue when each iteration starts with the same query and no durable record of the earlier search boundary. The next attempt may see a clean context but inherit the same task wording. Without a better retrieval plan, fresh context reproduces the same blind spot.

    Implementation details matter too. Snarktank’s loop starts a new Amp or Claude process per iteration, while the Ralph Wiggum Claude Code plugin continues inside the current session through a Stop hook. Neither process model automatically supplies semantic repository search.

    Where Text Search Breaks Down

    A coding agent search failure is often a mismatch between the engineering question and the evidence a text query can return. ripgrep is deterministic, line-oriented, and built around regular-expression matches. By default it respects ignore rules and skips hidden and binary files. Those are documented boundaries, not nondeterminism.

    Equal comparison of literal line matches and structure-aware alias, generated, and indirect paths

    Problems arise when the task asks about a relationship that text does not encode directly. A call may cross an interface, an import may be renamed, a framework may register handlers by configuration, or a generated client may expose a different symbol from its schema. Searching for one spelling cannot prove that none of those paths exists.

    The search scope can also be wrong. Running from a subdirectory, respecting an ignore file, choosing a file-type filter, or excluding generated paths changes the evidence set. Reviewers need the query, working directory, flags, and relevant exclusions before accepting a negative result.

    A query such as “Ralph Wiggum Claude Code” may identify the loop implementation, but it still does not identify repository aliases, generated symbols, or indirect callers. Product vocabulary and code vocabulary remain separate search surfaces.

    Text matches may also be too broad. Common names return tests, fixtures, comments, vendored files, and unrelated packages. An agent can select the closest-looking match without establishing ownership. High recall is not the same as structural relevance.

    Aliases, Generated Code, and Indirect Calls

    A broad query such as “Ralph Wiggum Claude Code” identifies a workflow, not the aliases used by a particular repository. A package can re-export a symbol, a module resolver can rewrite a path, or a local adapter can wrap a vendor client. Search may find the definition but not the path used by the application, or find the call site without revealing which implementation is injected at runtime.

    Generated code creates another authority problem. The runtime consumer may call a generated client, while the durable contract lives in an OpenAPI file, protobuf schema, or code generator configuration. Editing the generated file can pass a local search check and still be overwritten later. Retrieval needs to connect output to its source.

    Indirect calls appear in event systems, dependency injection, reflection, plugin registries, route tables, and framework hooks. Some relationships can be resolved statically; others require configuration or runtime evidence. A structure-aware index should expose uncertainty instead of inventing a precise call edge.

    Tests can reveal these paths, but only if the agent knows which behavior to run. A test named after a ticket may not mention the implementation symbol. Search across test descriptions, fixtures, and module imports, then confirm that the test actually exercises the path rather than merely sharing vocabulary.

    How Structure-Aware Search Helps

    Structure-aware retrieval begins with entities and relationships: definitions, references, imports, implementations, callers, callees, modules, and tests. A query can ask, “Which implementations satisfy this interface, which entry points reach them, and which tests cover those paths?” That is closer to the engineering question than a list of matching lines.

    A code graph can provide this layer. Graphify is one possible codebase graph system that may return a task-sized subgraph with file and symbol provenance. It should complement exact text search: text is useful for literals, configuration values, comments, and dynamic registration strings that a static graph may miss.

    Results remain candidates. The agent should open the cited source, verify the active commit, inspect configuration or generation boundaries, and run relevant checks. Dynamic behavior, conditional imports, macro expansion, and incomplete language support can all produce missing or misleading edges.

    This graph capability is not native to the Ralph pattern or the cited implementations. Claude Code can connect to external services through MCP, but each service must document its indexing, freshness, permissions, and failure modes.

    Verification and Debugging Limits

    Treat every negative search result as a bounded statement: no match was found for this query, in this scope, under these exclusions, at this commit. Before concluding a feature is absent, vary the vocabulary, inspect likely owners and entry points, follow imports or interfaces, and check schemas, generated surfaces, and tests.

    A negative search result branching through scope, vocabulary, graph, runtime, and review checks

    Log false negatives with enough detail to improve retrieval. Record the original task phrase, command or graph query, scope, exclusions, expected entity, actual source location, and reason it was missed. Aggregate by cause. A collection of anecdotes cannot tell whether aliases, ignored paths, language support, or task decomposition is the dominant problem.

    Verification should scale with impact. A local helper may need source inspection and unit tests. A security check, migration, or public API requires broader consumer analysis and human review. Passing tests are necessary backpressure, but a narrow suite cannot prove that every indirect path was found.

    Finally, do not force one retrieval system to answer every question. Exact search, symbol navigation, code graphs, build metadata, runtime traces, and human ownership knowledge cover different evidence surfaces. A reliable loop chooses among them and preserves the retrieval trail.

    FAQ

    When should search results be distrusted?

    Distrust the conclusion, not the tool, when the query vocabulary differs from repository vocabulary, the scope or exclusions are unclear, aliases or generation are likely, or the task asks about behavior rather than text. Re-run with explicit scope and add structural or runtime evidence.

    What evidence should reviewers request?

    Ask for the exact query, working directory, flags, excluded paths, commit, files inspected after the search, and tests or checks run. For graph results, also request the index version, relationship type, and source provenance. The evidence should make a negative result reproducible.

    How should teams log false negatives?

    Store the task wording, retrieval query, expected result, missed file or symbol, root cause, and corrective action. Separate tool limitations from poor query formulation and stale indexes. Review the log periodically to improve task templates, indexes, and repository conventions.

    How do we find errors in a code?

    Use layered evidence: reproduce the behavior, read the relevant source, search exact values and symbols, follow structural relationships, run static checks and targeted tests, then review the diff and logs. No single search command or graph can establish correctness for every repository.

    Conclusion

    Ralph code search problems are usually mismatches between the question and the retrieval model. Text search can establish whether text matches exist in a defined scope. It cannot, by itself, prove that behavior, callers, implementations, or test coverage are absent.

    Make negative results reproducible, add relationship-aware retrieval where the repository needs it, and verify every candidate in current source. For the implementation playbook, see how to stop Ralph rereading the repository. For the structural option, see Ralph knowledge graph integration.

  • Stop Ralph Rereading Repository

    Stop Ralph Rereading Repository


    An agent opens the router, searches for the service, reads the same interface, then repeats the sequence in the next iteration. The loop looks busy, but much of the work is repository orientation. On a large codebase, that repeated scan can consume more attention than the edit itself.

    The goal is not to stop Ralph from reading source. Current source is the final authority. The goal is to stop Ralph rereading repository roots when a smaller, verifiable context slice would answer the task. That requires an index with provenance, scoped queries, durable findings, and clear reasons to fall back to a full scan.

    Before You Optimize the Loop

    Before you try to stop Ralph rereading repository roots, confirm which loop you are running. Geoffrey Huntley’s original Ralph pattern describes an outer loop driven by a plan and executable feedback. The snarktank implementation launches a new Amp or Claude process for each iteration. Anthropic’s official plugin continues through a Stop hook inside the current Claude Code session. These reset boundaries create different reasons for repeated scanning.

    Then measure the behavior. Record which files and directories are opened per iteration, which searches recur, how often review finds a missed consumer, and whether the active task actually changed. A repeated read can be correct after a commit or branch change. It is wasteful when the repository state is unchanged and the agent is reconstructing the same verified relationships.

    This baseline turns coding agent repeated scanning into an observable retrieval problem. Optimize only the repeated orientation steps whose repository state and answer remained unchanged.

    Do not optimize by injecting a full repository summary into every prompt. Summaries drift, hide uncertainty, and can be larger than the discovery they replace. Define the target instead: the smallest source-backed context that lets an iteration locate the owner, understand affected relationships, respect write scope, and choose the right checks.

    Build a Module and Dependency Map

    Start with a lightweight map of modules and boundaries. This reduces coding agent repeated scanning by preserving only the orientation facts that can be checked against the active revision. For each module, capture its path, public entry points, owned symbols, direct dependencies, primary consumers, and associated tests. Add generated or schema-derived surfaces only if the task can affect them. Every item should point back to a file and commit, not merely repeat an architectural label.

    The map does not need to model every runtime behavior. It needs to answer common orientation questions reliably. A package index plus import graph may be enough for a conventional service. A monorepo with generated clients, dependency injection, and cross-language schemas may need symbol, call, and generation edges.

    Queries such as “Stop Ralph rereading repository Reddit” usually express frustration with the symptom, not a request for a particular cache. The implementation choice should follow observed failure modes. If the loop repeatedly forgets module ownership, build an ownership index. If it misses indirect consumers, model dependency and call relationships. If it reruns the same commands, fix the task handoff or repository instructions.

    Text search stays in the workflow. ripgrep is deterministic and line-oriented. By default it respects ignore rules and skips hidden and binary files. An index should complement that retrieval model by representing relationships; it should not be sold as a repair for imaginary randomness.

    Query by Task Instead of Repository Root

    Translate the acceptance criteria into retrieval questions before opening directories. A search such as “Stop Ralph rereading repository Reddit” names a symptom; the task query still needs to name the owner, behavior, and evidence required. For “add retry handling to outbound billing calls,” ask which module owns the client, which entry points call it, where retry policy is configured, and which tests exercise failure responses. Begin with those results and expand only when current source exposes another dependency.

    A broad repository map narrowing through a task aperture into a provenance-backed context packet

    A task query should include the active commit, allowed write paths, and expected behavior. Results should include file, symbol, relationship type, provenance, and confidence or limitations. The agent then opens the cited source and confirms that the path still exists and the relationship means what the task assumes.

    Graphify is one possible codebase graph layer for this retrieval step. It may help return a task-sized subgraph containing modules, dependencies, definitions, and tests. It is not necessary for every repository, and it should not replace exact search, directory inspection, or executable checks. A simple module manifest may be the better tool when repository structure is already explicit.

    Keep results small. Ranking twenty likely files can be useful; dumping thousands of graph nodes recreates root-level scanning in another format. Prefer a staged query: owner and entry point first, direct dependents second, tests and generated surfaces third, broader traversal only after evidence shows it is required.

    Persist Useful Findings Between Iterations

    Persist findings that are expensive to rediscover and likely to remain relevant for the active task. Examples include the verified owner module, the actual entry point behind an alias, required tests, an unexpected generated artifact, and a rejected path with evidence. Attach the commit and source locations so the next loop can check freshness.

    Keep that task handoff separate from durable project rules. In snarktank’s implementation, the prompt tells the agent to read Git history and progress.txt, work on one story, run checks, commit, and append useful information. Its README says progress.txt resets for a new branch. Those file semantics are specific to snarktank, but the broader principle is portable: active findings need a lifecycle tied to the task.

    Project-wide commands and conventions can live in scoped instructions such as AGENTS.md, whose specification allows directory-level rules. Do not promote a one-off discovery into permanent guidance without review. Derived graph facts should remain read-only to the loop and be refreshed from source rather than manually rewritten.

    A useful handoff is short enough to inspect. Label verified facts, hypotheses, failed attempts, and pending checks. Archive the longer event history if audit requires it, but do not force every iteration to reread it.

    Risks, Drift, and Review Habits

    Caching the wrong fact makes the loop faster in the wrong direction. Invalidate module and graph results when the commit, branch, index schema, generated code, or dependency lock state changes in a relevant way. If provenance cannot be compared with the active checkout, retrieve again from current source.

    Revision and review gates deciding whether cached context should refresh or trigger a full rescan

    Access boundaries matter as much as freshness. A shared index may expose code or paths outside an agent’s task. Apply repository permissions to retrieval, and keep write scope independent from read access. A result that mentions another module is not permission to edit it.

    Reviewers should request a retrieval trail for high-impact changes: initial task query, source files opened, edges followed, excluded paths, tests selected, and assumptions left unresolved. The purpose is not surveillance. It is to distinguish a safe narrow search from a narrow search that simply missed the real consumer.

    Use full rescans deliberately. They are appropriate after major refactors, branch switches, index corruption, uncertain generation pipelines, or evidence that scoped retrieval produced false negatives. They are also useful as periodic audits. The optimization succeeds when broad scans become evidence-driven exceptions, not when they disappear.

    Finally, compare the indexed path with a baseline on representative tasks. Look for missed consumers, stale facts, unnecessary context, and review corrections. Do not publish a universal speed or token claim from a small internal sample.

    FAQ

    What should not be cached?

    Do not cache secrets, volatile runtime values, unverified hypotheses presented as facts, or structural results without provenance. Avoid making generated output authoritative when its source schema is available. Short-lived test failures can be recorded in task state, but they should expire when the environment or commit changes.

    How should teams test retrieval quality?

    Build a set of real repository tasks with known owners, consumers, tests, and edge cases. Compare scoped retrieval with source inspection and review findings. Track false negatives, stale results, irrelevant context, and how often the agent must broaden the query. Re-run the set after index or repository changes.

    When should a full rescan happen?

    Rescan after a major branch or commit change, structural refactor, index-version change, generation update, or evidence that returned relationships are incomplete. A full scan is also justified when the task crosses unfamiliar boundaries or affects security, migrations, or a public interface whose consumers are uncertain.

    What is the Ralph loop in Claude Code?

    Anthropic’s Ralph Loop plugin uses a Stop hook to keep the same prompt active until a completion condition or iteration limit is reached. It operates inside the current Claude Code session. That differs from shell implementations that launch a new process for every iteration, so context and persistence behavior should be documented separately.

    Conclusion

    To stop Ralph rereading repository roots, first identify the repeated orientation question. Build only the module, dependency, or test map needed to answer it. Query by task, open the cited source, persist verified findings for the active scope, and invalidate them when repository state changes.

    The result should be a more disciplined reading path, not less verification. Text search, source inspection, type checks, tests, and review remain the backpressure that keeps a loop honest. For a deeper diagnosis of retrieval failures, see Ralph code search problems. For the structural model behind task-sized context, see knowledge graphs for AI coding assistants.

  • Ralph Fresh Context Trade-Offs

    Ralph Fresh Context Trade-Offs


    A long agent session can become an unreliable map of the repository. It contains earlier file contents, rejected hypotheses, transient failures, and instructions that may no longer match the current task. Resetting the conversation appears to solve that problem, but a clean window can also erase the reasoning that prevented a dangerous edit.

    Ralph fresh context is useful only when durable project artifacts carry the right knowledge forward. The engineering question is not whether old chat is good or bad. It is which information should be re-read from current source, which should persist outside the conversation, and which should disappear at the next iteration.

    What Fresh Context Solves

    In a Ralph fresh context loop, a reset reduces commitment to an obsolete narrative. The next iteration can inspect the current plan, source, Git history, and test output without also weighing every abandoned approach from the previous session. In Geoffrey Huntley’s original Ralph description, each loop receives a new context window and works through a stable plan with tests, builds, or static analysis providing backpressure.

    Tangled session state crossing a reset boundary as verified task, repository, and validation artifacts

    The snarktank loop creates a concrete process boundary by launching a new Amp or Claude process for each iteration. That can make failures easier to isolate and encourage the agent to rely on repository artifacts rather than an expanding chat transcript.

    A coding agent context reset also creates an inspection point. Teams can define exactly what the next iteration receives: a task specification, applicable repository rules, a short progress handoff, current source, and recent validation results. If that set is too large or too vague, the problem is visible before the next prompt begins.

    What It Can Lose Between Iterations

    A coding agent context reset can discard useful observations that are not already in the code. An iteration may discover that a generated client must be refreshed, a flaky integration test needs a particular fixture, or a symbol with an obvious name is not the real entry point. If the observation remains only in conversation, a clean reset can force the next loop to relearn it.

    The more serious loss is rationale. Source shows what exists, but not always why a constrained choice was made or why a plausible alternative failed. Git history may help, yet commit messages are rarely a complete operational handoff. A concise task note can preserve the evidence and scope of a decision without carrying the full transcript.

    Fresh context can also hide an unresolved assumption. The previous iteration may have decided that a search result proved a feature was missing. If that inference is summarized as fact, the reset removes the uncertainty while preserving the conclusion. Handoffs should distinguish verified facts, hypotheses, failed attempts, and pending checks.

    A Ralph fresh context review should record which observations were lost, which were promoted into durable artifacts, and which still require verification. That review makes reset quality inspectable instead of treating a clean window as success by itself.

    Persistent Memory vs Conversation Carryover

    Conversation carryover is easy but weakly structured. Its lifetime is tied to a session, its scope can be unclear, and later turns may treat old statements as current. Persistent memory can be smaller and more explicit: task status, reviewed repository rules, committed code, test results, and structural findings with provenance.

    The distinction is implementation-specific. Anthropic’s official Ralph Loop plugin uses a Stop hook to continue inside the current Claude Code session. That is not the same reset boundary as snarktank’s new process. Teams should test their actual tool rather than infer session behavior from the Ralph name.

    Persistence also needs ownership. An agent can update branch-local progress, but durable project rules should require review. Derived code relationships should be rebuilt or checked against current source. Secrets and private prompt content should not flow into a shared log merely because it is convenient.

    A practical Ralph fresh context review asks three questions: what artifact will survive, what makes it authoritative, and what event makes it expire? If any persisted item lacks those answers, it is likely to become stale context in a different form.

    Repository Knowledge That Should Survive

    The task specification and acceptance criteria should survive unchanged unless the authorized owner revises them. Current code and commits should remain the primary implementation record. The next iteration also needs the applicable build, test, and formatting commands, plus directory-scoped rules such as those supported by the AGENTS.md specification.

    Verified structural knowledge may also deserve persistence: module ownership, interface implementations, downstream consumers, test mappings, and entry points. A code graph can provide that orientation layer if each result cites the file, symbol, commit SHA, and index version. Graphify is one possible codebase graph layer; its output should be treated as candidate context and confirmed in source.

    Durable repository knowledge at the center while temporary hypotheses expire around it

    Short-lived experience can survive in an active task handoff. Record the failed command, the observed result, and the next check rather than a broad conclusion. Once a lesson is shown to recur and its scope is understood, it may be promoted into reviewed project guidance.

    The full conversation usually should not survive by default. Retain it for audit when required, but feed the next iteration a curated set of durable artifacts. A smaller handoff makes contradictions easier to see.

    Cost, Drift, and Review Risks

    Resets are not free. Re-reading files, rerunning discovery, and reconstructing architecture consume time and context. If several iterations open the same modules before every edit, the team has probably under-specified the durable orientation layer. Measure that repetition before adding a large memory system.

    Persistence creates the opposite risk: drift. A progress note can outlive its branch, a project instruction can stop matching the build, and a graph can describe an earlier commit. Tie active task state to task or branch identity, review instructions when they are contradicted, and invalidate structural results when provenance no longer matches.

    Reviewers should inspect what crossed the reset boundary, not only the final diff. Ask whether each carried statement is fact, inference, or instruction; whether its source is current; and whether it grants more write scope than the task allows. This is especially important for security boundaries, migrations, and public APIs.

    Finally, avoid treating passing tests as complete proof. Tests are essential backpressure, but they only cover what the suite exercises. Source inspection, scoped search, type checks, and human review remain necessary when the change affects relationships that the test suite may not encode.

    FAQ

    What should survive a reset?

    Keep the authorized task, current repository state, applicable reviewed rules, relevant test results, and verified findings that the next iteration would otherwise have to rediscover. Include provenance and expiration for structural or operational notes. Do not preserve every hypothesis merely because it appeared in the earlier session.

    How should teams inspect carried memory?

    Use a small, typed handoff. Label facts, hypotheses, decisions, failures, and pending checks. For each material fact, cite current source, a commit, test output, or another authoritative artifact. Review who can write each layer and reject entries whose scope or freshness is unknown.

    When is a clean reset safer?

    It is safer when the current session is dominated by stale file contents, contradictory instructions, repeated failed approaches, or an unrelated prior task. Before resetting, persist only the verified state needed to continue. If critical rationale cannot be reconstructed from durable artifacts, repair the handoff first.

    What is the Ralph method of AI?

    Ralph is a repeated coding-agent workflow in which a stable task or plan drives successive implementation attempts and executable checks provide feedback. It is a pattern with multiple implementations, not a single required session model. Fresh-process, fresh-window, and same-session hook loops should not be conflated.

    Conclusion

    Ralph fresh context is a control over attention, not a substitute for memory design. It can reduce old-chat pollution and loosen attachment to a failed approach. It can also erase architecture, rationale, and unresolved uncertainty when those exist only in the conversation.

    Define the reset boundary for the implementation you actually run. Preserve a small set of typed, scoped, and verifiable artifacts; let temporary hypotheses expire; and check current source before acting on carried knowledge. For the structural layer, see knowledge graphs for AI coding assistants. For a practical response to repeated discovery, see how to stop Ralph rereading the repository.