adityakumar68

Context Discipline Skill — Development skill for Claude Code

Development community

Claude Code skill that keeps the main agent's context small and project state on disk across compactions and sessions: project-brain hook, subagent hand-back contract, agent brief templates, context a.

How to install Context Discipline Skill

This entry records only its repository, not the path inside it, so there is no exact command to give. Open adityakumar68/context-discipline-skill and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Context Discipline Skill does

Claude Code skill that keeps the main agent's context small and project state on disk across compactions and sessions: project-brain hook, subagent hand-back contract, agent brief templates, context audit.

Alternatives in Development

README

context-discipline

A [Claude Code](https://docs.anthropic.com/en/docs/claude-code) skill for long work: projects that run over many sessions, research surveys, design → spec → plan, and anything that dispatches subagents. It keeps the main agent's context small, and it keeps the project's state on disk where a compaction or a new session cannot lose it.

The problem

Everything the main agent reads, prints, writes or receives stays in its context and is paid for again on every later turn. When the context fills up, Claude Code compacts it into a summary, and detail is lost: the decision made an hour ago, the file that holds the plan, what was running.

One measured long session (about 1.39M tokens through the main thread, 5 compactions) broke down like this:

What filled the context Share
Bash output 19%
Subagent hand-backs 15%
Bash input (long heredocs; one login boilerplate retyped about 800 times) 14%
Write input (specs and plans the main agent wrote itself) 13%
Read output (whole files, images) 11%
Agent prompts 7%
Skill texts re-injected after compaction 6%

Most of it was work a subagent could have done, or reading and printing more than was needed.

What you get

  • The skill (context-discipline/SKILL.md): where each kind of information lives, the delegation contract, design → spec → plan with subagents, cheap reviews, main-agent hygiene, and what to do after a compaction.
  • A SessionStart hook (scripts/brain-hook.sh): on startup, resume, /clear and compaction it prints the project's STATUS file, so Claude Code puts the current state back into context automatically.
  • A project brain (scripts/init-brain.sh): sets up STATUS.md (current state), 00-Project-Overview.md (big picture and dated decision log) and the .claude/brain pointer the hook follows.
  • Agent brief templates (references/agent-briefs.md): copy-ready briefs for research, context gathering, spe