aprende-enable-hooks

aprende-enable-hooks is a command for Claude Code from Hainrixz/aprende-skill. It costs 40 tokens per session (797 once invoked), scanned B, original, MIT.

A command that installs the aprende learning hooks into the user's global Claude settings so they can run after tools and when a session stops.

In plain words
What is it for?
Use it to enable automatic aprende hook behavior in all sessions, including checking whether the hooks are already installed.
Why use it?
It automates the settings change and creates a backup, while allowing the command to be run repeatedly without duplicating the hooks.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the aprende plugin — 2 skills, 3 commands, 2 hooks shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Hainrixz/aprende-skill
Claude Code
/plugin install aprende

Made for: Claude Code.

Or install aprende, the plugin that ships this one along with the rest of its 2 skills, 3 commands, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for aprende-enable-hooks

README.md
[![agentmods](https://agentmods.dev/badge/commands/hainrixz/aprende-skill/aprende-enable-hooks.svg)](https://agentmods.dev/commands/hainrixz/aprende-skill/aprende-enable-hooks)
Your own site
<a href="https://agentmods.dev/commands/hainrixz/aprende-skill/aprende-enable-hooks"><img src="https://agentmods.dev/badge/commands/hainrixz/aprende-skill/aprende-enable-hooks.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 797 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.00797
Opus 5 $0.00020 $0.00398
Sonnet 5 $0.00008 $0.00159
Haiku 4.5 $0.00004 $0.00080

Measured 6d ago against content hash ec4a1379baee, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

aprende-enable-hooks scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

2. **Read current settings.** `cat ~/.claude/settings.json` and parse it.
commands/aprende-enable-hooks.md · 99 lines

How it starts

The opening of the file, as written. The whole thing — 99 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/aprende-enable-hooks

When invoked, install (or confirm installation of) the aprende hooks into the user's global ~/.claude/settings.json. The hooks themselves ship in the plugin under ${CLAUDE_PLUGIN_ROOT}/hooks/hooks.json; this command splices their entries into the user-level settings so they run on every session.

Procedure

  1. Backup. Copy ~/.claude/settings.json to ~/.claude/settings.json.aprende-backup-<YYYY-MM-DD-HHMM> before any write. If the backup already exists for today's minute, skip (idempotent).

  2. Read current settings. cat ~/.claude/settings.json and parse it. If the file doesn't exist, create it with {}.

  3. Check for existing aprende hooks. Look for the marker comment "// aprende-hooks-installed": true inside the JSON (use a top-level field, since JSON has no comments).

    • If present, print:
      aprende hooks are already installed in ~/.claude/settings.json.
      To remove, run /aprende-disable-hooks.
      
      and exit.
  4. Splice the hooks. Add the following entries to the hooks key (create the key if missing). If hooks.PostToolUse or hooks.Stop arrays already exist with other entries, append — do not replace:

    {
      "aprende-hooks-installed": true,
      "hooks": {
        "PostToolUse": [
          {
            "matcher": "Bash|Edit|Write",
            "hooks": [
              {
                "type": "command",
                "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks-handlers/capture-signal.sh\""
              }
            ]
          }
        ],
        "Stop": [
          {
            "hooks": [
              {
                "type": "command",
                "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks-handlers/stop-suggest.sh\""
              }
            ]
          }
        ]
      }
    }
    

    Note: When installed via the plugin marketplace, the hooks are loaded automatically from ${CLAUDE_PLUGIN_ROOT}/hooks/hooks.json and this command becomes a no-op (just confirms installation). When installed manually by copying skills/aprende/ to ~/.claude/skills/, this command is the way to wire up the hooks — but the user must also copy hooks-handlers/*.sh somewhere and adjust the ${CLAUDE_PLUGIN_ROOT} reference to an absolute path. The README documents both paths.

Read the full file on GitHub · 99 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 99 lines · 40 tokens per session scan B ec4a1379baee

Subscribe to this mod's changes

aprende-enable-hooks is a command published in the GitHub repository Hainrixz/aprende-skill (23 stars, last pushed 1mo ago), licensed MIT. It adds 40 tokens to every session and 797 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.