Show HN: CoreTex – An Open-Source, Unix-like, biomimetic, flat-file AI Harness Daniel Casper released CoreTex, an open-source AI agent harness that combines Unix-like flat-file architecture with biomimetic design based on human neuroanatomy. The tool operates as an always-on daemon with a five-tier memory stack, zero-token code execution through "cerebellar muscle memory," and sandboxed code execution in a Deno-hosted V8 jail. CoreTex aims to provide safe, cost-effective AI integration by processing text files locally before spending API tokens and supporting composability through standard Unix pipes and redirects. Note to Systems Engineers:I took the biomimicry domain-driven design quite far e.g., the master daemon is the Medulla , short-term memory is the Hippocampus . It is eccentric, but underneath is arguably a highly optimized, concurrent, lock-safe, and execution engine that runs purely on flat files. CoreTex is a UNIX-inspired, biomimetic agent harness and knowledge engine intended to help you use AI safely, cost-effectively, and in a way that helps you integrate the whole of your life. Borrowing deeply from human neuroanatomy /mrdanielcasper/CoreTex/blob/main/docs/Biomimesis.md , CoreTex lets you organize and synthesize information supercharging Obsidian Vaults , write and execute code in a hardened environment, and utilize peripherals camera, mic, etc. alongside webhooks and headless web browsing to observe and react to the outside world. CoreTex is also intended to be an always-on daemon, understanding your goals and helping you achieve them over time. UNIX Philosophy: Everything is a file like it's the 1970s State, IPC, data, and queue files are guarded by OS-level locks. Databases are banished to the shadow realm excluding the SQLite FTS5 DB which reads the flat files for performance . Composability with standard operators is supported - pipe, redirect, etc. Cerebellar Muscle Memory Zero-Token Execution : When CoreTex successfully completes writing code, e.g. setting up a project, the Cerebellum can make it an engram to rerun at 0-cost. Highly experimental and will need improvements. Roadmap item /mrdanielcasper/CoreTex/blob/main/ROADMAP.md to enable engram sharing. Token economics /mrdanielcasper/CoreTex/blob/main/docs/Token-Economics.md is a major concern for CoreTex. 5-Tier Biomimetic Memory Stack /mrdanielcasper/CoreTex/blob/main/docs/Memory.md : Working Memory - token aware compression inserted between active head and tail for infinite task continuity without amnesia. Short-Term Recall Vectorless Search : Replace the DB with a local SQLite FTS5 index and BM25 ranking. Snippet truncation finds code matches without bloating the context window. Relation Knowledge - maps dependencies and markdown connections to a serialized graph, protected by the Anterior Cingulate Cortex circuit breaker if a loop is detected. Episodic Memory - keeps a ledger of its objectives and actions in a thread safe WAL JSONL stream. Long Term Memory - when CoreTex sleeps, it rotates logs and extracts key memories from them which are used to align the system to you Safe-by-Default: The default "Cognitive Mode" is strictly for reading/writing/working on an Obsidian vault or files. Code execution requires explicit user opt-in and is isolated inside an offline Deno-hosted V8 + WebAssembly jail with strict resource limits. CoreTex operates on text files and local indexing, meaning you can parse your entire codebase before spending a single API token. 1. Absorb data 0 Token Cost - Local SQLite Indexing ./ctx absorb ./my old project -d Studio/MyProject -t "legacy, python" ./ctx absorb ./journal -d Personal/Journal -t "journal, writing" 2. Execute a sandboxed agentic task ./ctx task "Audit ./my project for concurrency race conditions and output to audit.md" 3. Native Unix Piping cat error.log | grep "Timeout" | ./ctx task "Explain this failure cascade" 4. Daydreaming ./ctx daydream NOTE: CURRENTLY ONLY DAYDREAMS ABOUT ITSELF, SELFISH MACHINE. TOPIC-BASED DREAMING IS AN IMMEDIATE TO-DO CoreTex features a unified setup script to automatically handle prerequisites, virtual environments, and container architectures. chmod +x setup.sh ./setup.sh --check Optional: run preflight diagnostics ./setup.sh Interactive setup use --local or --docker to bypass prompts powershell -ExecutionPolicy Bypass -File .\setup.ps1 -Check powershell -ExecutionPolicy Bypass -File .\setup.ps1 Use -Local or -Docker to bypass prompts Note: CoreTex natively supports routing via Enterprise API Gateways Cloudflare, Portkey, Helicone for observability. Select Gateway during setup. The setup utility offers two distinct runtime architectures: Local Recommended : Uses Astral's hyper-fast uv and the deno secure runtime. Isolated Container: Uses Docker Compose with strict UID/GID mapping to prevent root-owned file pollution. Both paths launch the Synaptic Genesis wizard to configure your nervous system: Operating Profile: Cognitive Mode safe advisory or Agentic Mode sandboxed execution . Sensory Innervation: Toggle vision scrapers Playwright or local hardware mic/speakers. Synapses & Workspace: Link your LLMs OpenAI, Anthropic, local Ollama and bind CoreTex to a target directory. Once complete, restart your terminal and command the swarm: ./ctx status ./ctx task "Summarize this repository in five bullets" ./ctx status health check ./ctx live engage main daemon ./ctx task "do a thing" executes along route + domain ./ctx absorb examples/show-hn-mini-project --domain Professional --tags show-hn,demo ./ctx daydream Declarative configs via YAML these will be cleaned up . After setup, you can freely customize your agents, tools, and models without touching code: : Change default cloud models e.g. swap System/config/system.yaml gpt-4o-mini for claude-3-5-sonnet-latest , set maximum daily token limits, or tweak system behavioral conditions like dopamine increases temperature and cortisol ignores token budgets .: Definitions of system prompts, execution routes, agents like System/config/agents.yaml fast responder or qa auditor , and tool calling lives here.: The physical capability registry. Expose new bash commands, define webhooks, or add JSON schemas for entirely new sensory organs. System/config/tools.yaml Note: The setup script will automatically map your preferred default AI model to system.yaml during installation 🔐 Security /mrdanielcasper/CoreTex/blob/main/docs/Security.md & Sandboxing Safe-by-Default Running LLM-generated code locally is inherently dangerous. CoreTex ships in Cognitive Mode by default—it can write code and plan tasks, but it cannot execute scripts. If you explicitly opt-in CORETEX ENABLE CODE EXECUTION=true in your .env , CoreTex activates a strict containment matrix: The Deno + WASM Jail: CoreTex does not run generated code in your native Python or Bash environment. It forces the LLM to write code executed inside an ephemeral, unprivileged Deno + WebAssembly instance.- Firecracker support is on the horizon The Volume Mask: The agent is physically incapable of seeing files outside the specific directory bound during setup. Cognitive Fallback: If Deno is missing or unreachable, the system safely degrades back to Cognitive Mode , immediately stripping the agent's subprocess execution tools entirely. Obsidian is a first class citizen in CoreTex. CoreTex will automatically detect the .obsidian configuration folder and atomically configure native hotkeys Ctrl+Alt+S . Note: To map active shell commands directly to these hotkey bindings from within the graphic editor interface, please ensure the standard obsidian-shellcommands community plugin is active in your vault. You may struggle with these. Commands /mrdanielcasper/CoreTex/blob/main/docs/Commands.md include: ./ctx setup : Boot the interactive onboarding wizard to configure API keys, LLM routing, and workspace bindings. ./ctx task "