Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By felimetv0.1.0MIT
claude-cogsec — Cognitive Security hardening pack for Claude Code. Derived from the cogsec / affaan-m guides (https://github.com/affaan-m/ECC#the-guides). Covers token optimization, memory persistence, evaluation, parallelization, and agentic security (CVEs, sandboxing, sanitization, AgentShield). Includes PostToolUse observability hook, deny-list templates, and the /cogsec-audit slash command.
Claude Code doesn't load everything this plugin declares
hooks/hooks.json has no top-level "hooks" object, so Claude Code runs none of its hooks. /plugin reports an error (hooks.json must have 'hooks' (the hook matchers) or 'modules' (hooks modules), or both).Checked against Claude Code 2.1.332.
You run one by typing its /name in Claude Code.
No risk signals detected
Nothing flagged in this plugin's hooks, MCP servers or commands. Other components are not analyzed.
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
claude-code, cogsec, agentic-security, observability, hooks, rules, token-optimization, memory-persistence ·
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude Code Cognitive Security — a hardening pack for Claude Code, packaged as both a Claude Code plugin and a manual install script.
Implements the configuration prescribed by the cogsec / affaan-m guides:
This plugin codifies the configuration prescribed by:
affaan-m/ECC — The GuidesThe name cogsec = cognitive security: defending the model's reasoning surface against prompt injection, memory poisoning, supply-chain payloads, and agent-identity abuse — distinct from classical infosec which defends the network/host surface.
.claude-plugin/plugin.json # plugin manifest
hooks/
hooks.json # PostToolUse observability binding
log-tool-call.js # JSONL logger -> ~/.claude/logs/tool-calls.jsonl
commands/
cogsec-audit.md # /cogsec-audit slash command
skills/
cogsec-hardening/SKILL.md # consolidated reference
rules/common/
token-optimization.md
memory-persistence.md
evaluation.md
parallelization.md
agentic-security.md
templates/
settings.deny-list.json
settings.full-example.json
install.sh / install.ps1
claude-cogsec builds on top of affaan-m/ECC (Everything Claude Code). Install ECC before claude-cogsec — it provides the rule pack layout, agent definitions, and the GateGuard hook that claude-cogsec extends.
# Add the ECC marketplace
/plugin marketplace add https://github.com/affaan-m/ECC
# Install the ECC plugin
/plugin install ecc@ecc
Then proceed to install claude-cogsec below.
claude /plugin marketplace add felimet/claude-cogsec
claude /plugin install cogsec-hardening@claude-cogsec
The plugin registers the PostToolUse hook, installs /cogsec-audit, exposes the cogsec-hardening skill. Rule files are copied via the install script (rules are not yet plugin-distributable in Claude Code).
./install.sh # Linux / macOS / WSL / Git Bash
./install.ps1 # Native Windows PowerShell
Then merge templates/settings.deny-list.json into ~/.claude/settings.json and add the hooks.PostToolUse block shown in templates/settings.full-example.json.
~/.claude/logs/tool-calls.jsonl (timestamp, session id, tool, command, files touched)./cogsec-audit - one-shot hygiene scan.cogsec-hardening skill - consolidated reference..env*, blocks curl|bash, wget|bash, raw ssh|scp|nc.{
"autoApproveTools": false,
"hooks": { /* templates/settings.full-example.json */ },
"permissions": {
"deny": [ /* templates/settings.deny-list.json */ ]
}
}
ls -la ~/.claude/logs/tool-calls.jsonl
tail -1 ~/.claude/logs/tool-calls.jsonl
ls ~/.claude/rules/common/
claude --version # >= v2.0.65
claude /cogsec-audit --deep # after plugin enabled
| CVE | CVSS | Required version |
|---|---|---|
| CVE-2025-59536 | 8.7 | Claude Code >= v1.0.111 |
| CVE-2026-21852 | n/a | Claude Code >= v2.0.65 |
rules/ mirrors affaan-m/everything-claude-code rule pack layout, mergeable with existing ECC installs.hooks/hooks.json uses ${CLAUDE_PLUGIN_ROOT} so plugin path resolves regardless of install location.skills/ uses Anthropic skill frontmatter so it loads via standard Skill tool.ECC ships a GateGuard hook (pre:edit-write:gateguard-fact-force) that intercepts the agent before any new file is created and forces it to answer four questions. claude-cogsec cooperates with this gate — the questions are reproduced here so you understand what they enforce.
Name the file(s) and line(s) that will call this new file.
The agent must name the files and line numbers that will import, require, read, or reference the new file. Ensures the new file is not an orphan and is actually consumed somewhere.
Confirm no existing file serves the same purpose (use Glob).
Generated from the plugin's indexed repository (felimet/claude-cogsec) — no native marketplace selected
npx claudepluginhub p/felimet-cogsec-hardeningBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground