Small Context Coding
/install small-context-coding
Small Context Coding
Use this skill to keep coding work effective when the model context is limited.
Core operating mode
Treat the model as a short-working-memory engineer. Do not try to keep the whole project in chat context. Store project state in files and retrieve only what is needed for the current step.
Default workflow
- Classify the task size.
- Create or update a task plan file before broad changes.
- Read only the minimum files needed to decide the next step.
- Split the work into small closed loops: inspect -> change -> verify.
- Use sub-agents only to isolate distinct subproblems.
- Write checkpoints after each meaningful phase.
Task size heuristic
Small
- One file or one obvious fix
- No sub-agent
- No extra planning file unless requested
Medium
- A few files or one subsystem
- Make a short plan
- Consider one sub-agent for investigation only
Large
- Multiple modules, unclear root cause, or feature work across boundaries
- Create plan + todo + checkpoint files
- Delegate investigation or isolated implementation to sub-agents
- Keep main session focused on orchestration and decisions
Required file-based state
For medium or large tasks, create these under a working notes folder such as notes/\x3Ctask-slug>/:
plan.md— goal, constraints, phasestodo.md— actionable checklistcheckpoint.md— current state, decisions, next step
Keep each file short and current. Do not duplicate long chat history into these files.
Planning rules
A plan should contain:
- task goal
- current understanding
- files/modules likely involved
- ordered steps
- verification method
If the task changes materially, update the plan before continuing broad edits.
Context discipline rules
- Never read whole directories into context without a reason.
- Prefer targeted reads and searches.
- Summarize findings into notes instead of carrying raw outputs forward.
- After a phase is complete, compress it into a checkpoint and move on.
- Do not mix unrelated problem threads in one run when avoidable.
Sub-agent rules
Use a sub-agent when one of these is true:
- investigation can be isolated from implementation
- one subsystem can be analyzed independently
- you need a clean context for an experiment
- the main session is becoming an overloaded coordinator
Do not use sub-agents for trivial single-file edits. Do not spawn many sub-agents unless there are clearly separate workstreams.
Good sub-agent tasks
- trace a call chain for one feature
- inspect one module and summarize risks
- draft a patch for one bounded component
- write or repair one test area
Generate brief files with:
python3 /home/nick/.openclaw/workspace/skills/small-context-coding/scripts/generate_subagent_brief.py "\x3Ctask-name>" "\x3Cscope>" "\x3Cverification>" \x3Crepo-root>
Read references/subagent-patterns.md for prompt shapes and references/usage-guide.md for a concrete example.
Main session responsibilities
- define task boundaries
- decide delegation
- merge findings
- choose final implementation direction
- verify final result
Verification rules
After each implementation step, run the smallest meaningful check:
- targeted test
- lint/typecheck for changed area
- build of affected package
- direct inspection if no automated check exists
Read references/verification-defaults.md for stack-specific defaults before choosing a verification command.
Never claim completion without a verification step or explicit blocker.
A task is only done when these are true:
- the requested change is implemented or explicitly blocked
- the notes reflect the current state
- one meaningful verification step has run, or the blocker is named clearly
- the next follow-up is obvious from
checkpoint.mdif more work remains
Recommended note templates
If notes do not exist, create them from the bundled templates in references/templates.md.
For a real task, prefer initializing them with scripts/init_task.py.
Read references/usage-guide.md when you want a concrete flow for medium or large tasks.
Read references/verification-defaults.md when selecting the smallest useful validation command for a stack.
Anti-patterns
Avoid:
- giant upfront context dumps
- broad refactors without a written plan
- keeping important state only in chat
- asking one session to investigate, design, implement, and validate many unrelated things at once
- using sub-agents just because they exist
Initialization
To set up a task workspace for medium or large work, run:
python3 /home/nick/.openclaw/workspace/skills/small-context-coding/scripts/init_task.py "\x3Ctask-name>" \x3Crepo-root>
This creates notes/\x3Ctask-slug>/plan.md, todo.md, and checkpoint.md if they do not already exist.
To verify the helper workflow end to end, run:
python3 /home/nick/.openclaw/workspace/skills/small-context-coding/scripts/smoke_test.py
Iteration guidance
Keep the skill lean. Improve it after real use by refining:
- task size thresholds
- sub-agent delegation patterns
- note templates
- verification defaults per language or framework
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install small-context-coding - 安装完成后,直接呼叫该 Skill 的名称或使用
/small-context-coding触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Small Context Coding 是什么?
Efficient coding workflow for small-context models working on medium or large codebases. Use when the user wants to develop, debug, refactor, or analyze code... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 65 次。
如何安装 Small Context Coding?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install small-context-coding」即可一键安装,无需额外配置。
Small Context Coding 是免费的吗?
是的,Small Context Coding 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Small Context Coding 支持哪些平台?
Small Context Coding 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Small Context Coding?
由 ambitioncn(@ambitioncn)开发并维护,当前版本 v1.0.1。