
Research
/Security News
Coruna Respawned: Compromised art-template npm Package Leads to iOS Browser Exploit Kit
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.
claude-context-optimizer
Advanced tools
Claude Code context optimization hooks — auto-records decisions, injects them into CLAUDE.md, and reduces forgetting risk in long sessions
Claude Code sessions tend to forget earlier decisions as conversations grow long.
This tool hooks into Claude Code's lifecycle to automatically record decisions, inject them back into context, and version-control them — so nothing gets lost.
SessionStart → Read decisions.json → Inject into CLAUDE.md (every session)
↓
Claude works...
↓
Stop → Parse transcript → Detect decisions → Append to decisions.json
↓
SessionEnd → Save versioned snapshot → Update context_summary.md
On every session start, your active decisions are injected into CLAUDE.md automatically, so Claude always knows what has been decided — even in a brand-new session.
# Set up in your current project
npx claude-context-optimizer
# Or for all projects at once (~/.claude)
npx claude-context-optimizer --global
That's it. Open Claude Code and the hooks are active.
.claude/
├── settings.json ← Hook registrations (merged if exists)
├── hooks/
│ ├── session_start.py ← Injects decisions → CLAUDE.md
│ ├── on_stop.py ← Auto-detects decisions from transcript
│ ├── session_end.py ← Snapshots + summary update
│ └── decision_manager.py ← Manual CLI
└── context/
├── decisions.json ← Versioned decision log
├── decisions_history/ ← Snapshots (latest 30 kept)
└── context_summary.md ← Human-readable summary
CLAUDE.md ← Optimizer section appended (merged if exists)
Existing files are never destroyed. settings.json hooks are merged, CLAUDE.md gets a new section appended.
Just speak naturally in your session. Patterns like these are auto-detected:
Detected decisions are saved to decisions.json with a version number and category.
# Add a decision
python3 .claude/hooks/decision_manager.py add "Use PostgreSQL" \
--content "RLS-based multi-tenancy" \
--category tech_stack
# List active decisions
python3 .claude/hooks/decision_manager.py list
python3 .claude/hooks/decision_manager.py list --category architecture
# Version-up an existing decision (old one becomes 'superseded')
python3 .claude/hooks/decision_manager.py update dec_0001 \
--title "Use PostgreSQL + PGVector" \
--content "Added vector search requirement"
# Mark a decision as no longer valid
python3 .claude/hooks/decision_manager.py supersede dec_0002 \
--reason "Requirements changed"
# View snapshot history
python3 .claude/hooks/decision_manager.py history
{
"version": "1.0.0",
"last_updated": "2026-03-25T12:00:00",
"decisions": [
{
"id": "dec_0001",
"version": "v1",
"title": "Use PostgreSQL",
"content": "RLS-based multi-tenancy",
"category": "tech_stack",
"status": "active",
"timestamp": "2026-03-25T12:00:00",
"supersedes": null,
"tags": []
}
]
}
| status | meaning |
|---|---|
active | Currently valid decision |
superseded | Replaced by a newer version |
archived | Manually retired |
architecture · tech_stack · api · ui_ux · infrastructure · policy · business · general
on_stop.py)DECISION_PATTERNS = [
(r"(.{5,80})(?:で行く|でいく)", "decision"), # add your own
...
]
session_start.py)Edit format_decisions_for_context() to control how decisions appear in every session.
npx)See CONTRIBUTING.md for ideas, dev setup, and test procedures.
MIT © 2026 gajumaru4444
FAQs
Claude Code context optimization hooks — auto-records decisions, injects them into CLAUDE.md, and reduces forgetting risk in long sessions
The npm package claude-context-optimizer receives a total of 13 weekly downloads. As such, claude-context-optimizer popularity was classified as not popular.
We found that claude-context-optimizer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Compromised npm package art-template delivered a Coruna-like iOS Safari exploit framework through a watering-hole attack.

Company News
As AI accelerates how code is written and shipped, Socket is scaling to protect the software supply chain from the growing wave of attacks targeting open source dependencies.

Company News
Socket is scaling to defend open source against supply chain attacks as AI accelerates software development.