Skip to content

feat(claude): max-context configuration + Heady-optimal hooks/permissions#1

Open
HeadyMe wants to merge 1 commit into
mainfrom
claude/code-context-heady-optimize-gfl0f4
Open

feat(claude): max-context configuration + Heady-optimal hooks/permissions#1
HeadyMe wants to merge 1 commit into
mainfrom
claude/code-context-heady-optimize-gfl0f4

Conversation

@HeadyMe

@HeadyMe HeadyMe commented Jun 16, 2026

Copy link
Copy Markdown

Summary

Adds a Claude Code configuration (.claude/) tuned for the full 1M-token context window and Heady-optimal operation. This repo previously had no .claude/ config at all.

Maximum context

  • autoCompactWindow: 1000000 + env.ANTHROPIC_BETAS=context-1m-2025-08-07 — the whole 1M window is used before any summarization (pair with a 1M-capable model, e.g. claude-opus-4-8[1m]).
  • autoCompactEnabled: true — long sessions summarize at the boundary instead of hard-failing.
  • Raised token budgets via env: CLAUDE_CODE_MAX_OUTPUT_TOKENS=64000, MAX_THINKING_TOKENS=32000, MAX_MCP_OUTPUT_TOKENS=50000.
  • effortLevel=xhigh, always-thinking + thinking summaries, file checkpointing, 90-day transcript retention.

Heady-optimal operation

  • enableAllProjectMcpServers: true — auto-approves the Heady MCP toolchain.
  • Permissions — allow the Heady dev toolchain (git, npm/pnpm, node, python, gitleaks); deny-read secrets (.env, .heady/**, keys, *.pem); block/gate destructive commands.
  • SessionStart hook (hooks/session-context.sh) — injects live repo context (branch, HEAD, present canonical configs, Stop Rule) at session start.
  • PreToolUse(Bash) hook (hooks/guard-bash.sh) — hard-denies catastrophic commands (rm -rf /, force-push, mkfs, fork-bombs); asks before destructive-but-legitimate ones (DROP TABLE, gcloud … delete, wrangler … delete). Enforces the governance rule that irreversible actions need human confirmation.

Verification

Both hooks were pipe-tested with realistic stdin payloads:

  • SessionStart emits valid SessionStart additionalContext JSON.
  • Guard passes benign commands silently, denies rm -rf / and force-push, and asks on DROP TABLE.
  • settings.json validated with jq.

.claude/README.md documents every knob.

Notes

The 1M window requires a 1M-capable model; it is intentionally not pinned in committed settings so the team isn't forced onto one model/tier — select per session or in personal .claude/settings.local.json.

https://claude.ai/code/session_016WqBXQGJkjhG9RdAFiL2MZ


Generated by Claude Code

Configure Claude Code for the full 1M-token context window and optimal
operation in the Heady ecosystem:

- autoCompactWindow=1000000 + ANTHROPIC_BETAS=context-1m-2025-08-07 so the
  whole context window is used before summarization
- raised output/thinking/MCP token budgets (env)
- effortLevel=xhigh, always-thinking, file checkpointing, 90d retention
- enableAllProjectMcpServers for the Heady MCP toolchain
- permissions: allow Heady dev toolchain; deny-read secrets (.env/.heady/keys);
  block/gate destructive commands
- SessionStart hook injects live repo context each session
- PreToolUse(Bash) hook denies catastrophic commands, asks before destructive
  ones (DROP TABLE, gcloud delete, wrangler delete)
- README documenting every knob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants