### Data Flow Example: Changing max_tokens Source: https://github.com/itayinbarr/little-coder/blob/main/docs/architecture.md A step-by-step example illustrating the data flow when a user requests to change the max_tokens configuration. ```text 1. little_coder.py captures input, appends to message list 2. context.build_system_prompt(config) assembles: - base + git + memory index + CLAUDE.md 3. local/skill_augment selects tool skills: - intent prediction picks Read + Edit - injects read.md + edit.md under "## Tool Usage Guidance" 4. local/knowledge_augment scores knowledge files — no match, nothing injected 5. agent.run() streams the model response 6. Model emits: Read({file_path: "config.py"}) - read_only → auto-approve - tool_registry.execute_tool("Read", ...) → file content (truncated if >32K) 7. Tool result appended, next API turn 8. Model emits: Edit({file_path: "config.py", old_string: "max_tokens = 8192", new_string: "max_tokens = 16384"}) - not read_only → permission request (or auto in accept-all mode) - checkpoint.hooks fires, snapshots config.py - _edit() runs, generates unified diff 9. little_coder.py renders the diff with ANSI red/green 10. Tool result appended, next turn 11. Model responds: "Done — changed max_tokens from 8192 to 16384" 12. No tool_calls → loop ends, TurnDone yielded ``` -------------------------------- ### Local Development Setup Source: https://github.com/itayinbarr/little-coder/blob/main/README.md Steps to clone the repository, install dependencies, link the local checkout, and run Little Coder locally. ```bash git clone https://github.com/itayinbarr/little-coder.git cd little-coder npm install npm link # makes the local checkout available as `little-coder` little-coder --model llamacpp/qwen3.6-35b-a3b ``` -------------------------------- ### ShellSession Command with Timeout Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/shell_session.md Example of a ShellSession command with a specified timeout for operations like installations. ```tool {"name": "ShellSession", "input": {"command": "pip install -q requests", "timeout": 180}} ``` -------------------------------- ### BrowserNavigate Tool Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/browser_navigate.md Example of how to use the BrowserNavigate tool with a specific URL. ```tool {"name": "BrowserNavigate", "input": {"url": "https://en.wikipedia.org/wiki/Turing_machine"}} ``` -------------------------------- ### WebFetch Tool Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/webfetch.md Example of how to invoke the WebFetch tool with a URL. ```json {"name": "WebFetch", "input": {"url": "https://docs.python.org/3/library/json.html"}} ``` -------------------------------- ### Start Little Coder Source: https://github.com/itayinbarr/little-coder/blob/main/site/index.html Command to start the little-coder agent in a project directory. ```bash lc little-coder v1.5.1 · offline ``` -------------------------------- ### Write Tool Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/write.md Example of how to use the Write tool to create a new Python file. ```tool {"name": "Write", "input": {"path": "/tmp/example/new_module.py", "content": "def hello():\n return 'hi'\n"}} ``` -------------------------------- ### Install with bun Source: https://github.com/itayinbarr/little-coder/blob/main/README.md Install little-coder globally using bun. ```bash bun add -g little-coder ``` -------------------------------- ### Bash Tool Example with Timeout Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/bash.md Example of executing a shell command with a specified timeout using the Bash tool, suitable for operations like package installations. ```json { "name": "Bash", "input": {"command": "pip install requests", "timeout": 120 } } ``` -------------------------------- ### Serving from another machine on your LAN - Server (Ollama) Source: https://github.com/itayinbarr/little-coder/blob/main/README.md Example of starting Ollama server to be accessible on the local network. ```bash # Ollama: `OLLAMA_HOST=0.0.0.0:11434 ollama serve` (or set `OLLAMA_HOST=0.0.0.0` in the user systemd unit). ``` -------------------------------- ### Serving from another machine on your LAN - Server (llama.cpp) Source: https://github.com/itayinbarr/little-coder/blob/main/README.md Example of starting llama.cpp server to be accessible on the local network. ```bash # llama.cpp: start `llama-server` with `--host 0.0.0.0` (or your specific LAN interface) instead of `127.0.0.1`. Everything else from Option A unchanged. ``` -------------------------------- ### Install Little Coder Source: https://github.com/itayinbarr/little-coder/blob/main/site/index.html Command to install the little-coder agent globally using npm. ```bash npm install -g little-coder ``` -------------------------------- ### Grep Tool Example with Path Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/grep.md Example of using the Grep tool to find lines matching 'TODO' or 'FIXME' in a specific project path. ```json {"name": "Grep", "input": {"pattern": "TODO|FIXME", "path": "/path/to/project/"}} ``` -------------------------------- ### Bash Tool Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/bash.md Example of executing a shell command using the Bash tool. ```json { "name": "Bash", "input": {"command": "ls -la /path/to/project/" } } ``` -------------------------------- ### BrowserType Tool Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/browser_type.md Example of how to use the BrowserType tool to fill text into an input element and submit. ```tool {"name": "BrowserType", "input": {"selector": "input[name=\"q\"]", "text": "Alan Turing", "submit": true}} ``` -------------------------------- ### Glob Example with Path Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/glob.md Find all Markdown files in a specific directory. ```tool {"name": "Glob", "input": {"pattern": "*.md", "path": "/path/to/docs/"}} ``` -------------------------------- ### Basic Glob Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/glob.md Find all Python files recursively. ```tool {"name": "Glob", "input": {"pattern": "**/*.py"}} ``` -------------------------------- ### Single Change Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/edit.md An example of using the Edit tool to make a single text replacement in a file. ```json {"name": "Edit", "input": {"path": "/absolute/path/file.py", "edits": [{"oldText": "def hello():\n return 1", "newText": "def hello():\n return 2"}]}} ``` -------------------------------- ### Grep Tool Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/grep.md Example of using the Grep tool to find lines matching 'def main' in Python files. ```json {"name": "Grep", "input": {"pattern": "def main", "glob": "*.py"}} ``` -------------------------------- ### Two Changes Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/edit.md An example of using the Edit tool to make multiple text replacements in a single file within one call. ```json {"name": "Edit", "input": {"path": "/absolute/path/file.py", "edits": [{"oldText": "MAX = 10", "newText": "MAX = 20"}, {"oldText": "TIMEOUT = 5", "newText": "TIMEOUT = 30"}]}} ``` -------------------------------- ### Install with curl Source: https://github.com/itayinbarr/little-coder/blob/main/README.md One-line install script for little-coder using curl. ```bash curl -fsSL https://raw.githubusercontent.com/itayinbarr/little-coder/main/install.sh | bash ``` -------------------------------- ### Read Tool with Range Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/read.md Example of using the Read tool with 'path', 'limit', and 'offset' parameters to read a specific range of lines. ```tool {"name": "Read", "input": {"path": "/absolute/path/to/file.py", "limit": 50, "offset": 100}} ``` -------------------------------- ### BrowserExtract Tool Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/browser_extract.md Example of how to invoke the BrowserExtract tool with the cursor set to '0'. ```tool {"name": "BrowserExtract", "input": {"cursor": "0"}} ``` -------------------------------- ### Read Tool Basic Usage Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/read.md Example of using the Read tool with only the required 'path' parameter. ```tool {"name": "Read", "input": {"path": "/absolute/path/to/file.py"}} ``` -------------------------------- ### Bash permission examples Source: https://github.com/itayinbarr/little-coder/blob/main/README.md These bash commands show how to configure bash command permissions using environment variables, including adding custom allow-prefixes and skipping the permission gate. ```bash # Add 'make' (with word-boundary) and 'docker compose ps' on top of the defaults export LITTLE_CODER_BASH_ALLOW="make ,docker compose ps" ``` ```bash # Skip the gate entirely (use this only inside controlled environments) export LITTLE_CODER_PERMISSION_MODE=accept-all ``` -------------------------------- ### EvidenceAdd Tool Example Source: https://github.com/itayinbarr/little-coder/blob/main/skills/tools/evidence_add.md An example of how to use the EvidenceAdd tool to save a source, a note, and a verbatim snippet. ```tool {"name": "EvidenceAdd", "input": {"source": "https://en.wikipedia.org/wiki/Turing_machine", "note": "Turing machine introduced in 1936", "snippet": "The Turing machine was invented in 1936 by Alan Turing."}} ``` -------------------------------- ### Serve Local Model with Llama.cpp Source: https://github.com/itayinbarr/little-coder/blob/main/site/index.html Example command to serve a local model using llama.cpp, optimized for GPU usage. ```bash llama.cpp --n-cpu-moe ``` -------------------------------- ### Reproducing the paper (v0.0.2) Source: https://github.com/itayinbarr/little-coder/blob/main/README.md Steps to clone the repository, checkout a specific version, and set up the Python environment to reproduce the paper's results. ```bash git clone https://github.com/itayinbarr/little-coder.git cd little-coder git checkout v0.0.2 # Follow that version's README for its Python setup (pip install -e .) ```