gitwtfhub

wtf is cognitive-substrate?

damiansire/cognitive-substrate — explained in plain English

Analysis updated 2026-05-18

28TypeScriptAudience · developerLicense

TL;DR

A local AI task runner where every piece of state is a plain file, and an AI agent works through goals inside a sandboxed workspace.

Mindmap

mindmap
  root((Cognitive Substrate))
    What it does
      Goal to task decomposition
      Sandboxed AI agent
      File based state
    Tech stack
      TypeScript
      Gemini
      Docker
    Use cases
      Autonomous task execution
      Multi workspace daemon
      Self improvement loop
    Safety
      Approval gate
      Container sandbox
      Path containment

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Give an AI agent a written goal and let it break it into tasks it executes and verifies on its own.

REASON 2

Run multiple AI-driven workspaces in parallel with a shared dashboard to monitor them.

REASON 3

Let an agent make file edits and shell changes safely inside a sandboxed or containerized workspace.

What's in the stack?

TypeScriptNode.jsGeminiDockerAngular

How it stacks up

damiansire/cognitive-substrateajr-khll/ghostty-config-cliaudemodo/audemodo-responsive-keepalive
Stars282828
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyeasy
Complexity2/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

Wtf does this do

Cognitive Substrate is a local task runner that uses an AI model, Google Gemini, to work through goals you give it. You are not chatting with a bot here. Instead you write down a goal in a plain text file, and the system breaks that goal into a queue of smaller tasks, then works through them one at a time using an AI agent that can read and write files and run shell commands, but only inside its own workspace folder. Everything the system knows or has done lives as ordinary files you can open and edit yourself: the goal, the task list, a knowledge file, a dashboard, and a folder of evidence from past runs. Nothing is marked complete until it passes checks, and often a second, more skeptical AI review as well. The project also keeps a separate memory of immediate context versus longer term lessons learned, adding one distilled lesson after each run. The system can run multiple separate workspaces at the same time without blocking each other, and it can run continuously as a background process. It supports custom skill files that get offered to the agent when relevant. There is an evaluation harness for testing how well the system performs, a self improvement loop that turns failures into concrete proposed fixes, and governance features like spending budgets and an approval step that blocks dangerous commands when running autonomously. For safety, native shell commands are not treated as fully isolated. There is an optional container mode that runs commands inside Docker for real isolation, and a separate sandbox for running JavaScript snippets safely without Docker. The project is honest that without the container mode, a native shell can still reach outside the workspace, so it advises against running untrusted prompts on a machine you care about. You can also interact with the system through a few different interfaces: a command line tool, a terminal based visual interface, and a web dashboard, all sharing the same underlying data. Getting started requires Node.js version 18 or newer, and a Gemini API key is optional, since the system can run in a simulation mode without one. The project is released under the MIT license.

Yoink these prompts

Prompt 1
Explain how Cognitive Substrate breaks a goal.md file into a task queue for the agent to execute.
Prompt 2
Help me set up a Gemini API key and run this project's simulation mode without one.
Prompt 3
Walk me through enabling the container sandbox mode so shell commands run inside Docker.
Prompt 4
Show me how the approval gate blocks dangerous commands when the agent runs autonomously.

Frequently asked questions

wtf is cognitive-substrate?

A local AI task runner where every piece of state is a plain file, and an AI agent works through goals inside a sandboxed workspace.

What language is cognitive-substrate written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, Gemini.

Who is cognitive-substrate for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.