Skip to content

sshaaf/nanocode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nanocode

Minimal Claude Code alternative. Single Java file, runnable with jbang, zero..eh..1 json dependency, ~260 lines.

Built using Claude Code, then used to build itself.

screenshot

Features

  • Full agentic loop with tool use
  • Tools: read, write, edit, glob, grep, bash
  • Conversation history
  • Colored terminal output

Usage

export ANTHROPIC_API_KEY="your-key"
jbang nanocode.java

OpenRouter

Use OpenRouter to access any model:

export OPENROUTER_API_KEY="your-key"
jbang nanocode.java

To use a different model:

export OPENROUTER_API_KEY="your-key"
export MODEL="openai/gpt-5.2"
jbang nanocode.java

Commands

  • /c - Clear conversation
  • /q or exit - Quit

Tools

Tool Description
read Read file with line numbers, offset/limit
write Write content to file
edit Replace string in file (must be unique)
glob Find files by pattern, sorted by mtime
grep Search files for regex
bash Run shell command

Example

────────────────────────────────────────
❯ what files are here?
────────────────────────────────────────

⏺ Glob(**/*.java)
  ⎿  nanocode.java

⏺ There's one Java file: nanocode.java

License

MIT

About

Minimal Claude Code alternative. Single Java file, runnable with jbang, zero..eh..1 json dependency, ~260 lines.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%