Skip to content

Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase.

Merge remote-tracking branch 'origin/main' into fix/issue-74

yescinecae0e84892cf
diff --cc README.md
index 5410f0a4,0add266b..7e645277
--- a/README.md
+++ b/README.md
@@@ -446,9 -430,18 +441,18 @@@ Graft supports these layouts
every child, always labeled `<child>/`. Run `graft build` inside a child to
work on just that repo.
-Either way, narrow to one sub-project with `graft ask "<task>" --in <scope>/`
+In every layout, narrow to one sub-project with `graft ask "<task>" --in <scope>/`
once you know where you're working.
+ `graft init` at the parent of a multi-repo folder wires **every child repo too**,
+ not just the parent — an agent session opens at a repo root and reads its
+ instruction files from there, so each child needs its own. A session started in
+ the parent gets the federated view; one started in a child sees that repo alone.
+
+ Commands also find the graph from a subdirectory: with no `[dir]` argument they
+ walk up to the nearest `graft/`, so `graft ask` works from `src/deep/inside/`
+ without a `cd` to the repo root.
+
## Visualize it (`graft viz`)
`graft viz` opens a local, interactive view of both graphs — no install, no dev
diff --cc src/cli.ts
index b7a2ef21,43b0cfc7..bfc7ba2e
--- a/src/cli.ts
+++ b/src/cli.ts
@@@ -120,14 -138,7 +138,15 @@@ progra
.option("-e, --extensions <exts...>", 'code extensions to include (e.g. ".ts" ".py")')
.option("-j, --concurrency <n>", "files summarized in parallel during --deep (default 5)")
.option("--no-reuse", "re-parse every file instead of replaying unchanged ones from the extraction cache")
+ .option("--lsp", "add compiler-grade call edges via a language server if one is installed (opt-in, slower; e.g. rust-analyzer, clangd)")
+ .option(
+ "--follow-submodules",
+ "include initialized Git submodules recursively; persisted for later builds and automatic refreshes",
+ )
+ .option(
+ "--no-follow-submodules",
+ "exclude Git submodules; persisted for later builds and automatic refreshes (default)",
+ )
.option(
"--include-dir <name>",
"override SKIP_DIRS for this repo's walks — repeatable (e.g. --include-dir build --include-dir tools); " +
@@@ -135,18 -146,7 +154,19 @@@
(val: string, prev: string[]) => [...prev, val],
[] as string[],
)
- .action(async (dir: string, opts: { deep?: boolean; extensions?: string[]; concurrency?: string; reuse?: boolean; lsp?: boolean; includeDir?: string[] }) => {
+ .action(async (
+ dir: string,
+ opts: {
+ deep?: boolean;
+ extensions?: string[];
+ concurrency?: string;
+ reuse?: boolean;
++ lsp?: boolean;
+ includeDir?: string[];
+ followSubmodules?: boolean;
+ },
+ command: Command,
+ ) => {
const concurrency = opts.concurrency ? Math.max(1, Number(opts.concurrency)) : undefined;
if (opts.concurrency && !Number.isFinite(concurrency)) {
console.error(`✗ --concurrency must be a number, got "${opts.concurrency}"`);
diff --cc src/graph/source-files.ts
index b6cd5cee,e855b52b..7242bf22
--- a/src/graph/source-files.ts
+++ b/src/graph/source-files.ts
@@@ -10,8 -10,9 +10,9 @@@ import { statSync } from "node:fs"
import { resolve } from "node:path";
import { walkDir } from "../ingest/fs.js";
import { relPosix } from "../util/paths.js";
-import { readIncludeDirs } from "../util/state.js";
+import { readFollowSubmodules, readIncludeDirs } from "../util/state.js";
import { languageOf } from "./extract.js";
+ import { genericLangOf } from "./generic.js";
/**
* The source files a graph build parses: supported languages, minus the
@@@ -24,11 -25,14 +25,16 @@@
export function listSourceFiles(
root: string,
outDir: string,
- repoFiles: string[] = walkDir(root, readIncludeDirs(resolve(root))),
+ repoFiles: string[] = walkDir(root, readIncludeDirs(resolve(root)), {
+ followSubmodules: readFollowSubmodules(resolve(root)),
+ }),
): string[] {
- return repoFiles.filter((f) => !f.startsWith(outDir) && languageOf(f) !== null);
+ // A file is a source file if a depth-tier grammar (languageOf) OR a breadth-tier
+ // grammar (genericLangOf) claims its extension. Both must agree here or `build`
+ // and `check` would enumerate different sets.
+ return repoFiles.filter(
+ (f) => !f.startsWith(outDir) && (languageOf(f) !== null || genericLangOf(f) !== null),
+ );
}
export interface SourceStat {