Skip to content
Skill

Session hardening

Guards agent sessions with pretool blocks, periodic test runs and startup context

Session hardening is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
311
Last commit
License
MIT
Listing updated

Similar skills

About Session hardening

This skill adds a set of safety and quality hooks to an AI coding agent session. A pretool guard inspects commands before they run and blocks or redirects risky ones, such as recursive deletes, unapproved package publishing, piping downloads straight into an interpreter, broad file permissions, hard git resets and uploading local env files. A continuous QA hook detects the project's test command from common manifest files like package.json, Makefile, Cargo.toml or pyproject.toml and runs it every N file writes, feeding failures back to the agent without stopping it.

At session start, a context hook gathers the current git branch, recent commits and modified files, along with a focus brief and any handoff notes left by a previous session. Behaviour is tuned through environment variables: continuous QA is off by default and is enabled with a flag, the write interval defaults to 10, and a context mode can be set for workflows such as TDD or debugging.

The skill is delivered as a Claude Code plugin from the lacp-plugins marketplace and relies on Claude Code hooks to activate automatically, so it is not a manual instruction file. The folder ships a single SKILL.md with no scripts listed in the facts provided.

When your agent uses it

Production hardening for agent sessions. Includes pretool guards (blocks rm -rf, co-author injection, publishing without approval, data exfiltration), continuous QA (runs tests every N file writes), and session context injection (git state, focus brief, handoff artifacts). Activates automatically via hooks.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (2 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the lacp-hardening plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add 0xNyk/lacp
/plugin install lacp-hardening@lacp-plugins

Or copy only this skill to ~/.claude/skills/session-hardening:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/0xNyk/lacp.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/session-hardening &&
cp -R "$tmp/plugin/skills/session-hardening" ~/.claude/skills/session-hardening &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/session-hardening inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/session-hardening to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/0xNyk/lacp.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/session-hardening &&
cp -R "$tmp/plugin/skills/session-hardening" ~/.agents/skills/session-hardening &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/session-hardening inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/session-hardening to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/0xNyk/lacp.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/session-hardening &&
cp -R "$tmp/plugin/skills/session-hardening" ~/.cursor/skills/session-hardening &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/session-hardening inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/0xNyk/lacp.git --path plugin/skills/session-hardening

Or copy the folder to ~/.gemini/skills/session-hardening yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/session-hardening:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/0xNyk/lacp.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/session-hardening &&
cp -R "$tmp/plugin/skills/session-hardening" ~/.copilot/skills/session-hardening &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/session-hardening inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/0xNyk/lacp.git

Then copy lacp/plugin/skills/session-hardening into your agent's skills folder as session-hardening. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Pretool command guard
Blocks or redirects destructive shell commands, unapproved publishing and suspicious data transfers before they execute.
Continuous test runs
Runs the detected project test command every set number of file writes and reports failures back to the agent.
Session context injection
Adds git state, recent commits, modified files and a focus brief when a session starts.
Handoff artifact loading
Brings in handoff notes from the previous session so work can resume with prior context.
Configurable via environment variables
Lets users toggle continuous QA, set the test interval and choose a context mode.

Good for

  • Stop the agent from running rm -rf or chmod 777 on project files
  • Run the test suite automatically every few edits during a feature build
  • Resume yesterday's work with git state and a handoff summary at session start
  • Prevent accidental pushes to main on a public repository

Session hardening FAQ

How does Session hardening activate?

It activates automatically through hooks in the Claude Code plugin, rather than when a task matches a description.

Are continuous tests on by default?

No. The LACP_EVAL_CHECKPOINT_ENABLED variable defaults to 0 and must be set to enable continuous QA; the interval defaults to every 10 writes.

Which test runners does Session hardening detect?

It looks for the test command in package.json, Makefile, Cargo.toml and pyproject.toml.

Does a failing test block the agent?

No. According to the content, failure feedback is injected without blocking the agent.

How do I install Session hardening in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/session-hardening to use it in all your projects, or to .claude/skills/session-hardening in one project. Or install the lacp-hardening plugin, which includes it: /plugin marketplace add 0xNyk/lacp, then /plugin install lacp-hardening@lacp-plugins.

Does Session hardening run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Session hardening?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to Session hardening?

The closest alternatives to Session hardening are Safe execution edho ferdian, Guardrail tester, Scan sessions and learn, Autonomous agent harness and Vibe pre commit audit.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from 0xNyk/lacp

  1. Switch an agent session into structured work modes like TDD, debugging or review

    • Open source
    • 311 GitHub stars
    • Developer tools
  2. Scores agent session work at stop, flags unverified test claims, and writes handoffs

    • Open source
    • 311 GitHub stars
    • Developer tools