[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77GBCK403KGDVJ67RZ5K2WW":3,"skill-same:01M77GBCK403KGDVJ67RZ5K2WW":45},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M77GBCK403KGDVJ67RZ5K2WW","strategic-compact",null,"Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction. Use when a session is approaching a context limit and a task phase is a natural place to compact.","viseshrp\u002Fai-skills-archive","viseshrp","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F11642379?v=4","01M77FS5SES3C3PAVNXVRH1WVJ","Visesh Rajendraprasad","01M77FS5T6KA31CXA6K10TYFDC",0,"MIT","https:\u002F\u002Fgithub.com\u002Fviseshrp\u002Fai-skills-archive\u002Fblob\u002Fmain\u002Farchives\u002Faffaan-m__ECC\u002Fsnapshot\u002F.agents\u002Fskills\u002Fstrategic-compact\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: strategic-compact\ndescription: Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction. Use when a session is approaching a context limit and a task phase is a natural place to compact.\nlicense: MIT\n---\n\n# Strategic Compact Skill\n\nSuggests manual `\u002Fcompact` at strategic points in your workflow rather than relying on arbitrary auto-compaction.\n\n## When to Activate\n\n- Running long sessions that approach context limits (200K+ tokens)\n- Working on multi-phase tasks (research → plan → implement → test)\n- Switching between unrelated tasks within the same session\n- After completing a major milestone and starting new work\n- When responses slow down or become less coherent (context pressure)\n\n## Why Strategic Compaction?\n\nAuto-compaction triggers at arbitrary points:\n- Often mid-task, losing important context\n- No awareness of logical task boundaries\n- Can interrupt complex multi-step operations\n\nStrategic compaction at logical boundaries:\n- **After exploration, before execution** — Compact research context, keep implementation plan\n- **After completing a milestone** — Fresh start for next phase\n- **Before major context shifts** — Clear exploration context before different task\n\n## How It Works\n\nThe `suggest-compact.js` script runs on PreToolUse (Edit\u002FWrite) and combines two signals:\n\n1. **Context size (primary)** — Reads the latest `usage` record from the session transcript (`transcript_path` in the hook payload) and sums `input_tokens + cache_read_input_tokens + cache_creation_input_tokens` (the true context size of the turn). Suggests `\u002Fcompact` at a window-scaled threshold — 160k tokens on a 200k window, 250k on a 1M window (detected from a `[1m]` model marker, or inferred when observed tokens already exceed 200k) — and re-reminds after every additional 60k tokens of context growth\n2. **Tool-call count (secondary)** — Counts tool invocations in session; suggests at a configurable threshold (default: 50 calls), then every 25 calls after\n\n## Hook Setup\n\nAdd to your `~\u002F.claude\u002Fsettings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Edit\",\n        \"hooks\": [{ \"type\": \"command\", \"command\": \"node ~\u002F.claude\u002Fskills\u002Fstrategic-compact\u002Fsuggest-compact.js\" }]\n      },\n      {\n        \"matcher\": \"Write\",\n        \"hooks\": [{ \"type\": \"command\", \"command\": \"node ~\u002F.claude\u002Fskills\u002Fstrategic-compact\u002Fsuggest-compact.js\" }]\n      }\n    ]\n  }\n}\n```\n\n## Configuration\n\nEnvironment variables:\n- `COMPACT_THRESHOLD` — Tool calls before first suggestion (default: 50)\n- `COMPACT_CONTEXT_THRESHOLD` — Context tokens before the context-size suggestion (default: 160000 on a 200k window, 250000 on a 1M window; `0` disables the context signal)\n- `COMPACT_CONTEXT_INTERVAL` — Additional context tokens before the suggestion repeats (default: 60000)\n- `ECC_CONTEXT_WINDOW_TOKENS` — Explicit context-window size, in tokens, overriding auto-detection. Set this for large-window models whose reported id lacks a `[1m]` marker (e.g. 400k Opus 4.x, or a new 1M-window model family) so the threshold scales to the real window instead of defaulting to 200k and overstating context usage.\n- `CLAUDE_CODE_AUTO_COMPACT_WINDOW` — Claude Code's native window-size override, in tokens; honored as a fallback when `ECC_CONTEXT_WINDOW_TOKENS` is unset.\n\n> The context window is otherwise auto-detected from a `[1m]` model marker or inferred when observed tokens already exceed 200k. On a large-window model that carries neither signal, set one of the overrides above so the `\u002Fcompact` suggestion fires at the right point.\n\n## Compaction Decision Guide\n\nUse this table to decide when to compact:\n\n| Phase Transition | Compact? | Why |\n|-----------------|----------|-----|\n| Research → Planning | Yes | Research context is bulky; plan is the distilled output |\n| Planning → Implementation | Yes | Plan is written down (a file, or the task list if you have one); free up context for code |\n| Implementation → Testing | Maybe | Keep if tests reference recent code; compact if switching focus |\n| Debugging → Next feature | Yes | Debug traces pollute context for unrelated work |\n| Mid-implementation | No | Losing variable names, file paths, and partial state is costly |\n| After a failed approach | Yes | Clear the dead-end reasoning before trying a new approach |\n\n## What Survives Compaction\n\nUnderstanding what persists helps you compact with confidence:\n\n| Persists | Lost |\n|----------|------|\n| CLAUDE.md instructions | Intermediate reasoning and analysis |\n| Files on disk | File contents you previously read |\n| Memory files (`~\u002F.claude\u002Fmemory\u002F`) | Multi-step conversation context |\n| Git state (commits, branches) | Tool call history and counts |\n| The task list — **only if you have the todo tools** (see below) | Nuanced user preferences stated verbally |\n\n> ### Don't rely on the task list surviving — it may not exist\n>\n> Claude Code **2.1.233 removed the todo\u002Ftask tools by default** on Opus 4.8, Sonnet 5,\n> Fable 5, Mythos 5 and newer models (`TodoWrite`, `TaskCreate\u002FGet\u002FUpdate\u002FList`).\n> `CLAUDE_CODE_ENABLE_TODO_TOOLS=1` brings them back, but that is a per-machine\n> environment setting — **it does not travel with this skill**, so you cannot assume the\n> reader has it.\n>\n> This matters because \"my todo list survives compaction\" is a reason people compact\n> *instead of* writing state down. If the tools are absent there is no list to survive,\n> and the plan is simply gone. **Write the plan to a file before compacting** — a file\n> persists on every version and every model. Treat the task list as a convenience that\n> may be missing, never as your durable record.\n\n## Best Practices\n\n1. **Compact after planning** — Once the plan is finalized **and written to a file**, compact to start fresh\n2. **Compact after debugging** — Clear error-resolution context before continuing\n3. **Don't compact mid-implementation** — Preserve context for related changes\n4. **Read the suggestion** — The hook tells you *when*, you decide *if*\n5. **Write before compacting** — Save important context to files or memory before compacting\n6. **Use `\u002Fcompact` with a summary** — Add a custom message: `\u002Fcompact Focus on implementing auth middleware next`\n\n## Related\n\n- [The Longform Guide](https:\u002F\u002Fx.com\u002Faffaanmustafa\u002Fstatus\u002F2014040193557471352) — Token optimization section\n- Memory persistence hooks — For state that survives compaction\n- `continuous-learning` skill — Extracts patterns before session ends\n","# Strategic Compact Skill\n\nSuggests manual `\u002Fcompact` at strategic points in your workflow rather than relying on arbitrary auto-compaction.\n\n## When to Activate\n\n- Running long sessions that approach context limits (200K+ tokens)\n- Working on multi-phase tasks (research → plan → implement → test)\n- Switching between unrelated tasks within the same session\n- After completing a major milestone and starting new work\n- When responses slow down or become less coherent (context pressure)\n\n## Why Strategic Compaction?\n\nAuto-compaction triggers at arbitrary points:\n- Often mid-task, losing important context\n- No awareness of logical task boundaries\n- Can interrupt complex multi-step operations\n\nStrategic compaction at logical boundaries:\n- **After exploration, before execution** — Compact research context, keep implementation plan\n- **After completing a milestone** — Fresh start for next phase\n- **Before major context shifts** — Clear exploration context before different task\n\n## How It Works\n\nThe `suggest-compact.js` script runs on PreToolUse (Edit\u002FWrite) and combines two signals:\n\n1. **Context size (primary)** — Reads the latest `usage` record from the session transcript (`transcript_path` in the hook payload) and sums `input_tokens + cache_read_input_tokens + cache_creation_input_tokens` (the true context size of the turn). Suggests `\u002Fcompact` at a window-scaled threshold — 160k tokens on a 200k window, 250k on a 1M window (detected from a `[1m]` model marker, or inferred when observed tokens already exceed 200k) — and re-reminds after every additional 60k tokens of context growth\n2. **Tool-call count (secondary)** — Counts tool invocations in session; suggests at a configurable threshold (default: 50 calls), then every 25 calls after\n\n## Hook Setup\n\nAdd to your `~\u002F.claude\u002Fsettings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"PreToolUse\": [\n      {\n        \"matcher\": \"Edit\",\n        \"hooks\": [{ \"type\": \"command\", \"command\": \"node ~\u002F.claude\u002Fskills\u002Fstrategic-compact\u002Fsuggest-compact.js\" }]\n      },\n      {\n        \"matcher\": \"Write\",\n        \"hooks\": [{ \"type\": \"command\", \"command\": \"node ~\u002F.claude\u002Fskills\u002Fstrategic-compact\u002Fsuggest-compact.js\" }]\n      }\n    ]\n  }\n}\n```\n\n## Configuration\n\nEnvironment variables:\n- `COMPACT_THRESHOLD` — Tool calls before first suggestion (default: 50)\n- `COMPACT_CONTEXT_THRESHOLD` — Context tokens before the context-size suggestion (default: 160000 on a 200k window, 250000 on a 1M window; `0` disables the context signal)\n- `COMPACT_CONTEXT_INTERVAL` — Additional context tokens before the suggestion repeats (default: 60000)\n- `ECC_CONTEXT_WINDOW_TOKENS` — Explicit context-window size, in tokens, overriding auto-detection. Set this for large-window models whose reported id lacks a `[1m]` marker (e.g. 400k Opus 4.x, or a new 1M-window model family) so the threshold scales to the real window instead of defaulting to 200k and overstating context usage.\n- `CLAUDE_CODE_AUTO_COMPACT_WINDOW` — Claude Code's native window-size override, in tokens; honored as a fallback when `ECC_CONTEXT_WINDOW_TOKENS` is unset.\n\n> The context window is otherwise auto-detected from a `[1m]` model marker or inferred when observed tokens already exceed 200k. On a large-window model that carries neither signal, set one of the overrides above so the `\u002Fcompact` suggestion fires at the right point.\n\n## Compaction Decision Guide\n\nUse this table to decide when to compact:\n\n| Phase Transition | Compact? | Why |\n|-----------------|----------|-----|\n| Research → Planning | Yes | Research context is bulky; plan is the distilled output |\n| Planning → Implementation | Yes | Plan is written down (a file, or the task list if you have one); free up context for code |\n| Implementation → Testing | Maybe | Keep if tests reference recent code; compact if switching focus |\n| Debugging → Next feature | Yes | Debug traces pollute context for unrelated work |\n| Mid-implementation | No | Losing variable names, file paths, and partial state is costly |\n| After a failed approach | Yes | Clear the dead-end reasoning before trying a new approach |\n\n## What Survives Compaction\n\nUnderstanding what persists helps you compact with confidence:\n\n| Persists | Lost |\n|----------|------|\n| CLAUDE.md instructions | Intermediate reasoning and analysis |\n| Files on disk | File contents you previously read |\n| Memory files (`~\u002F.claude\u002Fmemory\u002F`) | Multi-step conversation context |\n| Git state (commits, branches) | Tool call history and counts |\n| The task list — **only if you have the todo tools** (see below) | Nuanced user preferences stated verbally |\n\n> ### Don't rely on the task list surviving — it may not exist\n>\n> Claude Code **2.1.233 removed the todo\u002Ftask tools by default** on Opus 4.8, Sonnet 5,\n> Fable 5, Mythos 5 and newer models (`TodoWrite`, `TaskCreate\u002FGet\u002FUpdate\u002FList`).\n> `CLAUDE_CODE_ENABLE_TODO_TOOLS=1` brings them back, but that is a per-machine\n> environment setting — **it does not travel with this skill**, so you cannot assume the\n> reader has it.\n>\n> This matters because \"my todo list survives compaction\" is a reason people compact\n> *instead of* writing state down. If the tools are absent there is no list to survive,\n> and the plan is simply gone. **Write the plan to a file before compacting** — a file\n> persists on every version and every model. Treat the task list as a convenience that\n> may be missing, never as your durable record.\n\n## Best Practices\n\n1. **Compact after planning** — Once the plan is finalized **and written to a file**, compact to start fresh\n2. **Compact after debugging** — Clear error-resolution context before continuing\n3. **Don't compact mid-implementation** — Preserve context for related changes\n4. **Read the suggestion** — The hook tells you *when*, you decide *if*\n5. **Write before compacting** — Save important context to files or memory before compacting\n6. **Use `\u002Fcompact` with a summary** — Add a custom message: `\u002Fcompact Focus on implementing auth middleware next`\n\n## Related\n\n- [The Longform Guide](https:\u002F\u002Fx.com\u002Faffaanmustafa\u002Fstatus\u002F2014040193557471352) — Token optimization section\n- Memory persistence hooks — For state that survives compaction\n- `continuous-learning` skill — Extracts patterns before session ends\n",{"name":5,"license":15,"description":7},"main","2550866e372116f9d9b44ba2cd5c66a6860f3040","archives\u002Faffaan-m__ECC\u002Fsnapshot\u002F.agents\u002Fskills\u002Fstrategic-compact","https:\u002F\u002Fgithub.com\u002Fviseshrp\u002Fai-skills-archive","https:\u002F\u002Fgithub.com\u002Fviseshrp","Full-stack engineer by day, building apps and CLI tools.\r\nSelf-hoster by night, running a tiny Raspberry Pi datacenter.","2026-11-10 11:20:03",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add viseshrp\u002Fai-skills-archive --skill strategic-compact",{"tool":37,"command":38},"bunx","bunx skills add viseshrp\u002Fai-skills-archive --skill strategic-compact",{"tool":40,"command":41},"pnpm","pnpm dlx skills add viseshrp\u002Fai-skills-archive --skill strategic-compact","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fviseshrp\u002Fai-skills-archive\u002Fblob\u002Fmain\u002Farchives\u002Faffaan-m__ECC\u002Fsnapshot\u002F.agents\u002Fskills\u002Fstrategic-compact\u002FSKILL.md",true,[],[46,54,61,68,75,82],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":50,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M77MKJBE97JWGCWFH915STTG","test-audit","Audit new or existing tests for behavioral value, duplication, implementation coupling, brittleness, and test-only production seams. Use when writing, changing, reviewing, or pruning tests, including an independent final review of a test diff.","https:\u002F\u002Fgithub.com\u002Fviseshrp\u002Fai-skills-archive\u002Fblob\u002Fmain\u002Fskills\u002Ftest-audit\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fviseshrp\u002Fai-skills-archive\u002Fblob\u002Fmain\u002Fskills\u002Ftest-audit\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M77MJ0851ZFCXSBX5YX0CEZ2","last30days","Research what people actually say about any topic in the last 30 days. Pulls posts and engagement from Reddit, X, YouTube, TikTok, Hacker News, Polymarket, GitHub, and the web. Includes a doctor health check to diagnose broken or missing sources.","https:\u002F\u002Fgithub.com\u002Fviseshrp\u002Fai-skills-archive\u002Fblob\u002Fmain\u002Farchives\u002Fmvanhorn__last30days-skill\u002Fsnapshot\u002Fskills\u002Flast30days\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M77MHW9RACV0XNY75ZSJJD56","karpathy-guidelines","Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.","https:\u002F\u002Fgithub.com\u002Fviseshrp\u002Fai-skills-archive\u002Fblob\u002Fmain\u002Farchives\u002Fmultica-ai__andrej-karpathy-skills\u002Fsnapshot\u002Fskills\u002Fkarpathy-guidelines\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M77M349AKHE5GDY8ATT5PP5W","port-github-app-to-origin","Plans the port of an existing GitHub App to a Cursor Origin App. Use when the task is to bring a GitHub App to Origin or compare what it uses against the Origin API. Reads the app's needs out of its code, maps them onto the live Origin spec, and writes a porting brief with feedback for Cursor. Planning only.","https:\u002F\u002Fgithub.com\u002Fviseshrp\u002Fai-skills-archive\u002Fblob\u002Fmain\u002Farchives\u002Fcursor__plugins\u002Fsnapshot\u002Forigin-apps\u002Fskills\u002Fport-github-app-to-origin\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M77M30DPGNPY4BDMB1SEHJSK","origin-api","Routes questions about the Cursor Origin API to the right section of the Origin docs and names the few rules to check first. Use when a task mentions Origin, the Origin API, Origin Apps, or Origin webhooks, including creating an Origin App, authenticating as one, calling Origin endpoints, or handling Origin webhook deliveries.","https:\u002F\u002Fgithub.com\u002Fviseshrp\u002Fai-skills-archive\u002Fblob\u002Fmain\u002Farchives\u002Fcursor__plugins\u002Fsnapshot\u002Forigin-apps\u002Fskills\u002Forigin-api\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M77KTXW5T1KVMHX71FMBT7BR","i-have-adhd","Shape output for a reader with ADHD: lead with the next action, number multi-step work, restate state across turns, suppress tangents, give specific time estimates, make wins visible. Invoke with \u002Fi-have-adhd; stays on until \"stop adhd mode\".","https:\u002F\u002Fgithub.com\u002Fviseshrp\u002Fai-skills-archive\u002Fblob\u002Fmain\u002Farchives\u002Fayghri__i-have-adhd\u002Fsnapshot\u002Fskills\u002Fi-have-adhd\u002FSKILL.md",[],[]]