[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ADE0WZ99EMCSGYZ1YVD1JK":3,"skill-same:01M7ADE0WZ99EMCSGYZ1YVD1JK":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M7ADE0WZ99EMCSGYZ1YVD1JK","context-folding",null,"Use when context is growing large (approaching model window limits), when long documents or transcripts need to be processed, or when compaction is losing critical information. Adapts Recursive Language Model (RLM) techniques to the Devin CLI runtime.","Leostruka\u002Fdevin-bundle","Leostruka","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F81370685?v=4","01M7AD8MAK63VDNAWRDRRRW04N","leandro ostruka","01M7AD8MBS65YDS1KMMV7YPM07",0,"MIT","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-folding\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: context-folding\ndescription: Use when context is growing large (approaching model window limits), when long documents or transcripts need to be processed, or when compaction is losing critical information. Adapts Recursive Language Model (RLM) techniques to the Devin CLI runtime.\ntriggers: [user, model]\n---\n\n# Context Folding (RLM-style)\n\n## When to Use\n\n- Context window is filling up and compaction would lose critical detail\n- Processing documents, transcripts, or logs longer than ~50k tokens\n- Multi-hop reasoning over large context where summarization loses signal\n- Before invoking `compact` when dense access to early context is still needed\n\n## When NOT to Use\n\n- Context fits comfortably in the model window - just use it directly\n- Task is simple retrieval (one needle, one haystack) - grep is cheaper\n- Context is already compacted and the original is gone\n\n**Default stance:** folding is a technique for contexts that genuinely exceed\nthe usable window. With SWE-2 (262K) the bar is high -\nmost session contexts fit and should be used directly. Don't fold\npreemptively; the sub-query fan-out adds latency and coordination cost that\nonly pays off when dense access to a very large artifact is actually needed.\n\n## Source\n\nAdapted from Recursive Language Models (Zhang, Kraska, Khattab - MIT CSAIL,\narXiv:2512.24601). The paper shows RLM(GPT-5-mini) outperforms GPT-5 by +34\npoints (114%) on OOLONG at 132k tokens, at comparable cost ($0.11-$0.99 vs\n$0.98-$6.75 for Claude Code). Reproduced independently (arXiv:2603.02615):\ndepth=1 helps, depth=2+ causes \"overthinking\" and inflates time from 3.6s to\n344.5s. PrimeAgent (PrimeIntellect, MIT-licensed, 16k+ stars) builds on this.\n\n## Core Technique\n\nRLM treats the prompt as a **variable in an environment**, not as direct\ninput. The model peeks, greps, partitions, and launches recursive sub-queries\nover the context instead of reading it all at once. Devin CLI does not have a\npersistent Python REPL, but the same effect is achieved with:\n\n1. **Offload to file** - write the large context to a temp file with `write`\n2. **Peek** - `read` with `offset`\u002F`limit` to sample structure\n3. **Grep** - `grep` with patterns to locate relevant sections\n4. **Partition** - split into chunks mentally or via `exec` (e.g. `split`)\n5. **Sub-query** - dispatch `researcher` subagents (NOT `subagent_explore` when parent is FREE - it runs on the CLI default router, possibly PAID) over chunks\n6. **Synthesize** - combine sub-agent returns into the final answer\n\n## Depth Rule (Critical)\n\n**Use depth=1 only.** The root agent (you) can spawn sub-queries (subagents).\nSubagents must NOT spawn their own sub-queries (depth=2).\n\nEvidence (arXiv:2603.02615): depth=2 causes \"overthinking\" - performance\ndegrades and execution time inflates from 3.6s to 344.5s (95x slower). The\npaper title is \"Think, But Don't Overthink.\"\n\n## Workflow\n\n### Step 1: Offload\n\nIf the context is in the conversation, write it to a file:\n\n```\nwrite \u002Ftmp\u002Fcontext.md \u003Cthe large content>\n```\n\nIf it's already a file, skip this step.\n\n### Step 2: Assess\n\nCheck size and structure:\n\n```\nexec: wc -l \u002Ftmp\u002Fcontext.md\nread \u002Ftmp\u002Fcontext.md offset=1 limit=50   # peek at start\nread \u002Ftmp\u002Fcontext.md offset=\u003Cmid> limit=50  # peek at middle\n```\n\n### Step 3: Locate\n\nUse `grep` to find relevant sections:\n\n```\ngrep \"keyword\" \u002Ftmp\u002Fcontext.md --context_lines=3\n```\n\n### Step 4: Partition (if needed)\n\nIf the relevant sections are spread across the file, split it:\n\n```\nexec: split -l 500 \u002Ftmp\u002Fcontext.md \u002Ftmp\u002Fchunk_\n```\n\n### Step 5: Sub-query (depth=1)\n\nDispatch `researcher` subagents (NOT `subagent_explore` when parent is FREE - it runs on the CLI default router, possibly PAID) over chunks. Each subagent gets:\n- One chunk (or section) to analyze\n- A specific question to answer\n- Instructions to return findings, not spawn further subagents\n\n```\nrun_subagent:\n  profile: researcher\n  task: \"Read \u002Ftmp\u002Fchunk_aa. Find all references to X. Return: file path, line number, and a one-sentence summary of each reference. Do NOT spawn subagents.\"\n```\n\nDispatch multiple in parallel for independent chunks.\n\n### Step 6: Verify subagent returns\n\nPer Rule 12: do not trust subagent returns without verification. For each\nreturn, spot-check the cited lines in the source file with `read`.\n\n### Step 7: Synthesize\n\nCombine verified findings into the final answer. The root context stays\nsmall - only the synthesis enters it, not the raw chunks.\n\n## Anti-Patterns\n\n- **Don't dump the whole file into context.** That defeats the purpose.\n- **Don't let subagents spawn subagents.** Depth=2 causes overthinking.\n- **Don't skip verification of subagent returns.** Rule 12 applies.\n- **Don't use this for small contexts.** Overhead exceeds value under ~50k tokens.\n- **Don't summarize blindly.** RLM's advantage over compaction is dense access - use grep and partition to preserve it.\n\n## Comparison: Context Folding vs Compaction\n\n| Aspect | Compaction (`compact`) | Context Folding (this skill) |\n|---|---|---|\n| Mechanism | Summarize old context, discard detail | Offload to file, sub-query on demand |\n| Information loss | Yes - summary drops details | No - original stays in file |\n| Dense access | No - summarized once | Yes - grep\u002Fread any section anytime |\n| Cost | One large model call | Multiple small sub-agent calls |\n| When to use | Context is stale, detail not needed | Detail is needed, context is large |\n| Can combine | Yes - fold first, compact the synthesis | Yes |\n\n## Cross-skills\n\n- If the folded context still exceeds the safe window, use `context-window-hygiene` to choose the right model and clearing cadence.\n- If the fold is a precursor to exhaustive exploration, use `deep-mode` for the multi-pass search and write findings to a file.\n\n## Evidence Summary\n\n| Claim | Source | Status |\n|---|---|---|\n| RLM(GPT-5-mini) +34 pts over GPT-5 at 132k | arXiv:2512.24601, blog Zhang | Verified |\n| RLM cost $0.11-$0.99 vs Claude Code $0.98-$6.75 | arXiv:2512.24601 Table | Verified |\n| depth=1 helps, depth=2 degrades | arXiv:2603.02615 | Verified |\n| depth=2 inflates time 3.6s → 344.5s | arXiv:2603.02615 | Verified |\n| RLM handles 10M+ tokens | arXiv:2512.24601, blog | Verified |\n","# Context Folding (RLM-style)\n\n## When to Use\n\n- Context window is filling up and compaction would lose critical detail\n- Processing documents, transcripts, or logs longer than ~50k tokens\n- Multi-hop reasoning over large context where summarization loses signal\n- Before invoking `compact` when dense access to early context is still needed\n\n## When NOT to Use\n\n- Context fits comfortably in the model window - just use it directly\n- Task is simple retrieval (one needle, one haystack) - grep is cheaper\n- Context is already compacted and the original is gone\n\n**Default stance:** folding is a technique for contexts that genuinely exceed\nthe usable window. With SWE-2 (262K) the bar is high -\nmost session contexts fit and should be used directly. Don't fold\npreemptively; the sub-query fan-out adds latency and coordination cost that\nonly pays off when dense access to a very large artifact is actually needed.\n\n## Source\n\nAdapted from Recursive Language Models (Zhang, Kraska, Khattab - MIT CSAIL,\narXiv:2512.24601). The paper shows RLM(GPT-5-mini) outperforms GPT-5 by +34\npoints (114%) on OOLONG at 132k tokens, at comparable cost ($0.11-$0.99 vs\n$0.98-$6.75 for Claude Code). Reproduced independently (arXiv:2603.02615):\ndepth=1 helps, depth=2+ causes \"overthinking\" and inflates time from 3.6s to\n344.5s. PrimeAgent (PrimeIntellect, MIT-licensed, 16k+ stars) builds on this.\n\n## Core Technique\n\nRLM treats the prompt as a **variable in an environment**, not as direct\ninput. The model peeks, greps, partitions, and launches recursive sub-queries\nover the context instead of reading it all at once. Devin CLI does not have a\npersistent Python REPL, but the same effect is achieved with:\n\n1. **Offload to file** - write the large context to a temp file with `write`\n2. **Peek** - `read` with `offset`\u002F`limit` to sample structure\n3. **Grep** - `grep` with patterns to locate relevant sections\n4. **Partition** - split into chunks mentally or via `exec` (e.g. `split`)\n5. **Sub-query** - dispatch `researcher` subagents (NOT `subagent_explore` when parent is FREE - it runs on the CLI default router, possibly PAID) over chunks\n6. **Synthesize** - combine sub-agent returns into the final answer\n\n## Depth Rule (Critical)\n\n**Use depth=1 only.** The root agent (you) can spawn sub-queries (subagents).\nSubagents must NOT spawn their own sub-queries (depth=2).\n\nEvidence (arXiv:2603.02615): depth=2 causes \"overthinking\" - performance\ndegrades and execution time inflates from 3.6s to 344.5s (95x slower). The\npaper title is \"Think, But Don't Overthink.\"\n\n## Workflow\n\n### Step 1: Offload\n\nIf the context is in the conversation, write it to a file:\n\n```\nwrite \u002Ftmp\u002Fcontext.md \u003Cthe large content>\n```\n\nIf it's already a file, skip this step.\n\n### Step 2: Assess\n\nCheck size and structure:\n\n```\nexec: wc -l \u002Ftmp\u002Fcontext.md\nread \u002Ftmp\u002Fcontext.md offset=1 limit=50   # peek at start\nread \u002Ftmp\u002Fcontext.md offset=\u003Cmid> limit=50  # peek at middle\n```\n\n### Step 3: Locate\n\nUse `grep` to find relevant sections:\n\n```\ngrep \"keyword\" \u002Ftmp\u002Fcontext.md --context_lines=3\n```\n\n### Step 4: Partition (if needed)\n\nIf the relevant sections are spread across the file, split it:\n\n```\nexec: split -l 500 \u002Ftmp\u002Fcontext.md \u002Ftmp\u002Fchunk_\n```\n\n### Step 5: Sub-query (depth=1)\n\nDispatch `researcher` subagents (NOT `subagent_explore` when parent is FREE - it runs on the CLI default router, possibly PAID) over chunks. Each subagent gets:\n- One chunk (or section) to analyze\n- A specific question to answer\n- Instructions to return findings, not spawn further subagents\n\n```\nrun_subagent:\n  profile: researcher\n  task: \"Read \u002Ftmp\u002Fchunk_aa. Find all references to X. Return: file path, line number, and a one-sentence summary of each reference. Do NOT spawn subagents.\"\n```\n\nDispatch multiple in parallel for independent chunks.\n\n### Step 6: Verify subagent returns\n\nPer Rule 12: do not trust subagent returns without verification. For each\nreturn, spot-check the cited lines in the source file with `read`.\n\n### Step 7: Synthesize\n\nCombine verified findings into the final answer. The root context stays\nsmall - only the synthesis enters it, not the raw chunks.\n\n## Anti-Patterns\n\n- **Don't dump the whole file into context.** That defeats the purpose.\n- **Don't let subagents spawn subagents.** Depth=2 causes overthinking.\n- **Don't skip verification of subagent returns.** Rule 12 applies.\n- **Don't use this for small contexts.** Overhead exceeds value under ~50k tokens.\n- **Don't summarize blindly.** RLM's advantage over compaction is dense access - use grep and partition to preserve it.\n\n## Comparison: Context Folding vs Compaction\n\n| Aspect | Compaction (`compact`) | Context Folding (this skill) |\n|---|---|---|\n| Mechanism | Summarize old context, discard detail | Offload to file, sub-query on demand |\n| Information loss | Yes - summary drops details | No - original stays in file |\n| Dense access | No - summarized once | Yes - grep\u002Fread any section anytime |\n| Cost | One large model call | Multiple small sub-agent calls |\n| When to use | Context is stale, detail not needed | Detail is needed, context is large |\n| Can combine | Yes - fold first, compact the synthesis | Yes |\n\n## Cross-skills\n\n- If the folded context still exceeds the safe window, use `context-window-hygiene` to choose the right model and clearing cadence.\n- If the fold is a precursor to exhaustive exploration, use `deep-mode` for the multi-pass search and write findings to a file.\n\n## Evidence Summary\n\n| Claim | Source | Status |\n|---|---|---|\n| RLM(GPT-5-mini) +34 pts over GPT-5 at 132k | arXiv:2512.24601, blog Zhang | Verified |\n| RLM cost $0.11-$0.99 vs Claude Code $0.98-$6.75 | arXiv:2512.24601 Table | Verified |\n| depth=1 helps, depth=2 degrades | arXiv:2603.02615 | Verified |\n| depth=2 inflates time 3.6s → 344.5s | arXiv:2603.02615 | Verified |\n| RLM handles 10M+ tokens | arXiv:2512.24601, blog | Verified |\n",{"name":5,"triggers":24,"description":7},[25,26],"user","model","main","02b95ddb62959a00b3c31442c2046aca0d19563c","skills\u002Fcontext-folding",1,"https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle","https:\u002F\u002Fleostruka.github.io\u002Fdevin-bundle\u002F","https:\u002F\u002Fgithub.com\u002FLeostruka","2026-11-15 05:19:58",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Leostruka\u002Fdevin-bundle --skill context-folding",{"tool":41,"command":42},"bunx","bunx skills add Leostruka\u002Fdevin-bundle --skill context-folding",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Leostruka\u002Fdevin-bundle --skill context-folding","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-folding\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7E0K3MG2XC4FSRV0MK6SFR1","montador-de-ideias","Use when assembling, expanding, or elevating a raw project idea or initial prompt into an ultra-detailed, first-principles dossier and compiled master prompt with journalistic OSINT market research, Tech Lead and Staff Architect justifications, atomic and modular hardening\u002Foptimization, and high-impact contact surfaces.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fmontador-de-ideias\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7E0J7JJWZ8QMK01RZ3B3C9Z","git-github-adaptive-engineering","Use when any task touches git history, GitHub issues\u002FPRs\u002Freleases\u002FCI, repo governance, or branch and merge decisions. Runs the Fase Zero situational-awareness battery, picks one of five delivery flows via the adaptive decision engine, and enforces commit\u002FPR information-density standards. Orchestrates the gh, git-workflows, github-actions, pr, and debug\u002Ffinish skills.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fgit-github-adaptive-engineering\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7E0GJFRPFEVQQMXEM58EWDM","adaptive-agenda-calendar-routine-engine","Use when planning or executing work across hours, days, weeks, or sprints. Turns the calendar into a strict time-blocked agenda (HH:MM-HH:MM blocks carrying a routine profile, expected inputs, and a handoff output artifact), runs the 5-stage cognitive flow (Radar and Hunt -> Triage plus Steve Jobs conception -> workbench manifest -> >=32-cycle loop -> Close plus Open-Minded Scrum), and unfolds macro calendar milestones into micro agenda blocks through extensions\u002Fgcal\u002Fwrapper.py.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Fskills\u002Fadaptive-agenda-calendar-routine-engine\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7AE2K9FTY0BVS48N0A9JFKF","demo","Use when demonstrating a skill in a fixture project.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdevin-config\u002Fproject\u002F.devin\u002Fskills\u002Fdemo\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7AE2G3DP38PTV3B1N7MW5TS","duplicate-skill","Use when testing duplicate skill name detection.","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdevin-config\u002Fproject\u002F.devin\u002Fskills\u002Fbeta\u002FSKILL.md",[],[],{"skillNo":86,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7AE2DBR8ZHT6T875MJ392GK","https:\u002F\u002Fgithub.com\u002FLeostruka\u002Fdevin-bundle\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fdevin-config\u002Fproject\u002F.devin\u002Fskills\u002Falpha\u002FSKILL.md",[],[]]