Skip to content

davidreko/spore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spore

An AI agent that starts empty and writes its own tools. Three files, two dependencies, one shell.

You talk to it. It builds what it needs - tools, memory, new behaviors - by editing its own source code and system prompt. Everything reloads every turn. No restart, no plugins, no config files.

Demo

spore demo

Quickstart

export ANTHROPIC_API_KEY=sk-...
bun install
bun grow

On first run you'll pick a model. Config saves to .spore/config.json - delete it to reconfigure.

Commands

Command Description
bun grow Start spore (dangerous commands require approval)
bun wild Start spore with no approval prompts
bun rollback Restore source files from last snapshot
bun reset Wipe all local state and start over

How it works

Spore ships with a system prompt that says "you are spore, you evolve" and a single shell tool. That's it.

Every turn, it re-reads its own prompt and tools from disk. So when it edits those files - which it can, through the shell - the changes take effect immediately. It can:

  • Rewrite its personality - edit .spore/prompt.md (live)
  • Create new tools - drop .ts files in .spore/tools/ (live)
  • Modify its own runtime - edit src/ (takes effect on restart)
  • Remember across sessions - memories are saved automatically on exit

Creating tools

Tools are .ts files in .spore/tools/ that export a SporeTool:

import { z } from "zod";
import type { SporeTool } from "../../src/types";

export default {
  name: "my_tool",
  description: "what it does",
  schema: z.object({ arg: z.string() }),
  execute: async ({ arg }) => { return "result"; }
} satisfies SporeTool;

Spore can create these itself. Ask it to.

Safety

Spore is a self-modifying agent with a real shell. There is no sandbox. It can do anything your user account can do.

Best-effort guardrails (not a security boundary):

  • Destructive-looking commands (rm, sudo, curl | sh, package installs, etc.) prompt for approval
  • Commands referencing paths outside the project root prompt for approval
  • bun wild skips all prompts - use in disposable environments
  • Environment variables matching common secret patterns are stripped from the shell
  • Source files are snapshotted on startup - bun rollback to restore

Run this in an environment you're comfortable losing.

API usage

Beyond the conversation itself, spore makes 1-2 small API calls on exit to extract and prune memories. These use Haiku regardless of your conversation model.

Switching providers

Model creation lives in src/brain.ts via createClient(). Swap it for any Anthropic SDK-compatible client.

License

MIT

About

An AI agent that starts empty and writes its own tools

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors