{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "feder-cr-git-ai--work-in-a-sparse-checkout-of-a-large-repo",
 "repo": "feder-cr/git-ai",
 "repo_url": "https://github.com/feder-cr/git-ai",
 "repo_slug": "feder-cr-git-ai",
 "title": "Give an agent a sparse checkout of only the paths it needs",
 "page_title": "How to give an agent a sparse checkout of only the paths it needs with Git AI",
 "summary": "Use graft clone and graft sparse so an agent fetches only the paths it will edit.",
 "who": "A developer whose coding agent works on one part of a large repository and should not download the whole history.",
 "problem": "Full clones of large repositories are slow for short agent tasks that touch only a few files.",
 "outcome": "A workspace that holds only the requested paths, with the agent able to read and change them.",
 "steps": [
  "Complete the build from the first use case so the graft CLI exists in `_build/bin`.",
  "Run `./_build/bin/graft` to list the commands and find the clone and sparse subcommands. (inferred, check the README)",
  "Run `./_build/bin/graft clone` against your running server with the path options that the command help shows. (inferred, check the README)",
  "Run `./_build/bin/graft sparse` to narrow the workspace to the paths the agent needs. (inferred, check the README)",
  "Check that the workspace contains only the requested paths before handing it to the agent."
 ],
 "agent_prompt": "In the repository git-ai, run `./_build/bin/graft` and read the help for the clone and sparse commands. Create a sparse workspace for <target-path> on the running server and verify that only that path appears in the working tree.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "The README names graft clone and graft sparse but does not document their exact options, so check the command help before use.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "go",
 "requirements": [
  "Linux or macOS",
  "Go 1.26",
  "A C toolchain",
  "Meson and Ninja (the build compiles a bundled Git)",
  "Git and a clone of https://github.com/feder-cr/git-ai.git"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.7,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/feder-cr-git-ai/work-in-a-sparse-checkout-of-a-large-repo/",
 "md": "https://dedupedai.com/use-cases/feder-cr-git-ai/work-in-a-sparse-checkout-of-a-large-repo/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/feder-cr-git-ai--work-in-a-sparse-checkout-of-a-large-repo.json",
 "api_version": "v1"
}
