Skip to content

DangQuangSE/team-development-skills / .agents/skills/session-memory

session-memory

Verified

Read and reuse AI coding session context across Claude Code, Codex, Antigravity/agent hooks, Cursor adapters, and compatible AI tools. Use this skill whenever the user asks to read, inspect, resume, compare, or continue another session by name or session ID, asks what happened in the previous session, or starts a new session that should inherit the nearest prior context. The paired provider adapter automatically loads the nearest previous project session at startup and resolves explicit session-read requests.

FileKindSize
SKILL.mdskill md3.8 KB
hooks/lib/ck_config_utils.pyscript3.7 KB
hooks/lib/hook_logger.pyscript1.4 KB
hooks/session_memory.pyscript25.7 KB

hooks/lib/hook_logger.py

View on GitHub
"""
Structured diagnostics logger for Claude Code hooks.

Usage:
    log = HookLogger("session-init")
    log.info("Session state loaded")
    log.warn("No .ck.json found — using defaults")
    log.perf()   # prints "[session-init] done (12ms)"

    clean = strip_ansi(raw_text)
"""
import re
import sys
import time

_ANSI_RE = re.compile(
    r"\x1b(?:\[[0-9;?]*[A-Za-z]|\][^\x07\x1b]*(?:\x07|\x1b\\)|\([A-Z]|[A-Z])"
)


def strip_ansi(s: str) -> str:
    """Remove ANSI escape sequences from a string."""
    return _ANSI_RE.sub("", s) if isinstance(s, str) else ""


class HookLogger:
    """Structured logger that writes to stderr with hook name prefix and timing."""

    def __init__(self, name: str):
        self.name = name
        self._t0 = time.perf_counter()

    def info(self, msg: str) -> None:
        print(f"[{self.name}] {msg}", file=sys.stderr, flush=True)

    def warn(self, msg: str) -> None:
        print(f"[{self.name}] WARN  {msg}", file=sys.stderr, flush=True)

    def error(self, msg: str) -> None:
        print(f"[{self.name}] ERROR {msg}", file=sys.stderr, flush=True)

    def perf(self, label: str = "done") -> None:
        ms = (time.perf_counter() - self._t0) * 1000
        print(f"[{self.name}] {label} ({ms:.0f}ms)", file=sys.stderr, flush=True)

    def __call__(self, msg: str) -> None:
        """Drop-in replacement for utils.log()."""
        self.info(msg)
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall