subconscious

subconscious is a skill for Claude Code from Square-Q/subconscious-skill. It costs 0 tokens per session (2,546 once invoked), scanned A, original, MIT.

A three-layer memory and reasoning setup for Claude Code, with conscious, preconscious, and subconscious parts. It stores project knowledge and past interactions, then can surface related memories during a session.

In plain words
What is it for?
Use it to index project knowledge, connect current questions with past memories, process session history, and manage memory with commands such as status, recall, dream, and forget.
Why use it?
It reduces the need to repeat context across sessions and can highlight links to earlier work or recurring problems. It also provides controls for recalling, pinning, forgetting, or disabling memories.

Skill for Claude Code

Written for Claude Code: SessionEnd hook event. Also seen: mentions Claude Code.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/square-q/subconscious-skill/subconscious
Any agent
npx skills add Square-Q/subconscious-skill --skill subconscious
Clone the repo
git clone --depth 1 https://github.com/Square-Q/subconscious-skill

Made for: Claude Code.

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 subconscious

README.md
[![agentmods](https://agentmods.dev/badge/skills/square-q/subconscious-skill/subconscious.svg)](https://agentmods.dev/skills/square-q/subconscious-skill/subconscious)
Your own site
<a href="https://agentmods.dev/skills/square-q/subconscious-skill/subconscious"><img src="https://agentmods.dev/badge/skills/square-q/subconscious-skill/subconscious.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,546 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.02546
Opus 5 $0.00000 $0.01273
Sonnet 5 $0.00000 $0.00509
Haiku 4.5 $0.00000 $0.00255

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

Security

Grade A, and why

subconscious scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/subconscious/SKILL.md · 237 lines

How it starts

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

Subconscious Agent Skill

概述

本 Skill 赋予 Claude Code 意识/潜意识/前意识三重结构,仿生人类认知架构。

它不是"带记忆的助手",而是带活潜意识的 Agent——潜意识层在后台持续处理联想、模式识别、记忆重整,通过 whisper 机制在适当时机影响意识层的决策。


核心架构

意识层 (Conscious)      ← 当前会话的主推理流程
   ├─ 接收用户指令、写代码、工具调用
   ├─ 直接查询前意识层(知识库/文档)
   └─ 接收潜意识 whisper 注入

前意识层 (Preconscious)  ← 静态知识仓库
   ├─ 代码库索引 / 项目文档
   ├─ 外部数据库 / API 文档
   └─ 意识层按需直接检索

潜意识层 (Subconscious)  ← 后台持续处理引擎
   ├─ 跨会话模式识别
   ├─ 记忆联想(当前→历史关联)
   ├─ 凝缩/压缩同类记忆
   ├─ 重要性加权与遗忘
   ├─ 梦境处理(空闲期重放+重整)
   └─ 输出:whisper 消息(不写用户文件,不阻塞主流程)

触发机制

自动激活

以下条件激活潜意识层:

  1. 会话开始 → 检查预注入包,如有则生成 whisper
  2. 会话进行中 → 以下场景触发即时联想:
    • 检测到当前问题和某段历史记忆的模式高度匹配
    • 用户重复踩同类型的坑
    • 出现已记录的重要概念/符号
  3. 会话结束 → 执行潜意识处理管道(编码→联想→凝缩→固化→预注入)
  4. 空闲定时 → 梦境处理 + 遗忘扫描

手动命令

直接操控潜意识层:

命令 效果
/subconscious status 查看潜意识状态、记忆统计
/subconscious recall <关键词> 强行召回关联记忆
/subconscious dream 触发一次梦境处理
/subconscious forget <条件> 显式标记某记忆可遗忘
/subconscious pin <记忆ID> 固定某条记忆防止衰减
/subconscious off 关闭潜意识层(当前会话)
/subconscious whisper 查看当前预注入包内容

潜意识处理管道

每一段会话结束后,按顺序执行以下五阶段:

Stage 1: 编码 (Encoding)

  • 读取当前会话的 transcript(或记录的关键事件)
  • 提取:决策点、问题、新知识、重复模式
  • 每条提取内容附重要性评分(0.0–1.0)
  • 输出:结构化记忆片段列表

Stage 2: 联想 (Association)

  • 对新记忆片段做语义匹配,关联已有历史记忆
  • 建立关联图:因果链、相似度、对比关系
  • 输出:记忆关联关系表

Stage 3: 凝缩 (Condensation)

  • 聚类同类事件(相同领域、相似问题、重复模式)
  • 聚类数 ≥ 3 的记忆群 → 压缩为一个抽象 insight
  • 细节丢弃规则:保留共性,舍弃个案特例
  • 输出:凝缩后的记忆 + 被压缩的冗余标记

Stage 4: 固化 (Consolidation)

  • 将处理后的记忆写入三种记忆类型
  • 更新记忆索引
  • 调整重要性分数:当前引用的 +0.1,未被引用的 -5%(衰减)
  • 低于阈值 0.1 的 → 归档(不删除)
  • 输出:记忆存储确认 + 索引变更日志

Stage 5: 预注入 (Pre-inject)

  • 选择与当前项目/语境最高相关度的记忆片段
  • 打包为 whisper 消息(≤3 条,每条 ≤80 字)
  • 存至预注入缓冲区,下次会话开始读取
  • 输出:预注入包

记忆系统

三种记忆类型

情景记忆 (Episodic)

  • 内容:具体会话事件、决策上下文
  • 结构:{time, project, context, key_decision, outcome, importance}
  • 用于:回忆特定场景、追溯决策原因

语义记忆 (Semantic)

  • 内容:抽象知识、概念定义、技术规则
  • 结构:{concept, domain, definition, related_semantic_ids, source_episodic_ids}
  • 用于:知识问答、概念关联、方案推理

Read the full file on GitHub · 237 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 · 237 lines · 0 tokens per session scan A 6dea1787b53c

Subscribe to this mod's changes

subconscious is a skill published in the GitHub repository Square-Q/subconscious-skill (48 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,546 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

media-ingest

Ingest video, audio, PDF, book, screenshot, and GitHub repo content into the brain. Multi-format handling with entity extraction and backlink propagation. Covers video-ingest, youtube-ingest, and book-ingest subtypes.

garrytan/gbrain · 52 tokens

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…

mem0ai/mem0 · 273 tokens

Cortex

Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…

danielmiessler/LifeOS · 196 tokens

agent-memory

../../../engineering/agent-memory/skills/agent-memory/SKILL.md.

alirezarezvani/claude-skills · 0 tokens

memory

Use when the user asks to remember, recall, forget, update, search, or inspect durable OpenSquilla memory, including profile facts in USER.md and long-term notes in MEMORY.md or memory//.md.

opensquilla/opensquilla · 44 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens