Skip to content

thatbeautifuldream/mini-claude-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mini-claude-code

AI coding assistant with direct filesystem access. Learning project.


Quick Start

bunx github:thatbeautifuldream/mini-claude-code
npx github:thatbeautifuldream/mini-claude-code
pnpm dlx github:thatbeautifuldream/mini-claude-code
yarn dlx github:thatbeautifuldream/mini-claude-code
export OPENAI_API_KEY=your-key-here

Local Dev

bun install
bun run dev

Screen.Recording.2026-02-26.at.10.51.10.PM.mov

How It Works

Uses ToolLoopAgent from ai SDK:

const agent = new ToolLoopAgent({
  model: openai("gpt-4o"),
  tools: bashToolkit.tools,
  instructions: INSTRUCTIONS,
  stopWhen: stepCountIs(50),
});

Each turn streams steps via onStepFinish:

agent.stream({
  messages: trimmed,
  onStepFinish(stepResult) {
    // Captures tool calls, results, token usage
  },
});

Bash tool wraps just-bash with safety hooks:

createBashTool({
  sandbox: customBash,
  onBeforeBashCall: blockDangerousCommands,
  onAfterBashCall: logFailures,
});

Direct filesystem via ReadWriteFs:

new ReadWriteFs({ root: rootPath });

Custom commands:

defineCommand("explain", readFile);
defineCommand("lint", suggestLinter);
defineCommand("deps", showDeps);

Commands

Command What
/help Show commands
/clear Clear history
/git Git status + commits
/exit Quit

Safety

Blocks DANGEROUS_COMMANDS via onBeforeBashCall:

  • rm -rf /, rm -rf *, rm -rf .
  • dd if=, mkfs, fdisk
  • git push --force, git reset --hard

Author

Milind Mishra


License

MIT

About

A coding agent that can run commands, read files, and write files.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors