Setting Up Your Local Agentic Workspace

Before you can run local coding agents, you need to configure your machine to balance the compute needs of local LLMs with the memory needs of your compiler, IDE, and development tools. This chapter guides you through setting up Ollama, installing Little-Coder skills, and optimizing your macOS workspace for a 32GB memory footprint.

Note: Dear reader, the most common configuration problem I have seen people have (and it has hit me also!) is forgetting to manually configure Ollama with a large enough context size. Be warned that I will keep mentioning this!

* * *

1. Installing Ollama & Downloading Gemma 4

Ollama is the standard runtime for running open LLMs locally on macOS. It utilizes Apple’s Metal API to run model weights directly on the Mac’s unified GPU. Ollama uses an up to date llama.cpp core that supports the QAT model format we use here.

Step 1: Install Ollama

Download and install the native macOS application from the official site, or use Homebrew:

1 brew install ollama

Step 2: Launch the Ollama Service

Ensure Ollama is not running in the background (if on macOS you see the Ollama icon in your menubar, please use the drop down menu to quit the application. You should use Ollama via a terminal shell:

1 OLLAMA_CONTEXT_LENGTH=32768 ollama serve

You must run with a larger than the default 4K context. Here I set the context length to 32768 when running on my 32GB Mac and sometimes I use a smaller 16786 context size on my 16GB Mac but I prefer a full 32768 context size. In several experiments, problems like errors in writing files were fixed when increasing the context size to 32768, even on a 16GB memory computer.

Step 3: Pull the Gemma 4 MoE Model

For a 32GB Mac, we pull the 26B Mixture-of-Experts variant with 4-bit Quantization-Aware Training (QAT). This model provides the best speed and headroom:

1 ollama pull gemma4:26b-a4b-it-qat

Note: If you have a Mac with 64GB or more of unified memory, you can optionally pull the dense variant ollama pull gemma4:31b-it-qat for peak reasoning. On a 16GB Mac pull the gemma4:12b-it-qat model.

You might be wondering what -it- in model names refers to. There models are instruction trained (not base models).

Step 4: Install little-coder/pi

1 brew install node
2 npm config set ignore-scripts true

The second command is something I use to prevent install scripts from running when installing rpm libraries.

Use one of these two installation methods:

1 curl -fsSL https://raw.githubusercontent.com/itayinbarr/little-coder/main/install.sh | bash # method 1
2 npm install -g little-coder # method 2

I also define in my ``/.profile`:

1 alias lc='little-coder --model ollama/gemma4:26b-a4b-it-qat'
2 alias lcf='little-coder --model ollama/gemma4:12b-it-qat'
3 # Append functional programming tools to little-coder's bash whitelist
4 export LITTLE_CODER_BASH_ALLOW="sbcl ,clojure ,clj ,npx "
* * *

2. Deploying Little-Coder Skills

Little-Coder configures the agent’s behavior by loading structured instruction templates called skills from the user’s home directory.

To install the skills from the repository https://github.com/mark-watson/little-coder_Local_Coding_Book, copy the .pi/agent/skills folder to your home directory:

1 # Copy the skills to your home folder config path
2 cp -R .pi/agent/skills ~/.pi/agent

After a first time install of pi and little-coder the directory will not contain a ~/.pi/agent/skills folder. The last copy command copies in the skill files I wrote for my own use.

Verify the structure is set up correctly:

1 ls -R ~/.pi

You should see a directory layout matching this:

1 ~/.pi/
2 └── agent/
3     └── skills/
4         ├── clojure.md
5         ├── common-lisp.md
6         ├── typescript.md
7         └── write-temp-strategy.md

Each markdown file inside ~/.pi/agent/skills/ contains critical system instructions, CLI tool invariants, and execution rules that the agent loads when working on projects of that language type.

Verifying That Our New Little-Coder Skills Are Loaded and Available

little-coder is built on top of pi. However little-coder strips the substrate down to a hyper-lean, non-interactive execution setup (purely loading the files directly into the system prompt context at launch), it doesn’t process slash commands like /skills inside the chat terminal.

Since little-coder treats skills purely as filesystem assets, you manage and inspect them entirely using standard shell commands outside the agent interface.

Fortunately we can simply ask what skills are available:

 1  > What skills or runtime rules are currently loaded in your system prompt for Lisp or temp file creation?                   
 2                                                                                                                            
 3 
 4  The user is asking about specific "skills" or "runtime rules" mentioned in my system prompt.                              
 5  Specifically, they want to know what's loaded regarding:                                                                  
 6  1. Lisp (Common Lisp and Clojure).                                                                                        
 7  2. Temp file creation (no-edit-create-new-files).                                                                         
 8                                                                                                                            
 9  I need to look at the <available_skills> section of my system prompt provided in the initial message.                     
10                                                                                                                            
11  Looking at the available_skills block:                                                                                    
12  - clojure: Optimizations for headless Clojure tool execution. Location: /Users/markw/.pi/agent/skills/clojure.md.         
13  - common-lisp: Optimizations for headless SBCL tool execution. Location: /Users/markw/.pi/agent/skills/common-lisp.md.    
14  - no-edit-create-new-files: Don't edit files, create a new temporary file. Location:                                      
15    /Users/markw/.pi/agent/skills/write-temp-strategy.md.                                                                   
16                                                                                                                            
17  I should also check if there are any "runtime invariants" or other rules related to these.                                
18  The prompt mentions:                                                                                                      
19  - Write refuses on existing files. (This is a runtime invariant).                                                         
20  - Edit must be used for modifications.                                                                                    
21                                                                                                                            
22  The user's question specifically asks about the skills and rules loaded in my system prompt for those topics.             
23                                                                                                                            
24  Plan:                                                                                                                     
25  1. List the Clojure skill details.                                                                                        
26  2. List the Common Lisp skill details.                                                                                    
27  3. List the no-edit-create-new-files skill details.                                                                       
28  4. Mention any relevant runtime invariants if they apply (like the Write refusal).                                        
29 
30  Based on my system prompt, here are the specific skills and rules currently loaded for those topics:                      
31                                                                                                                            
32  ### 1. Lisp Skills                                                                                                        
33                                                                                                                            
34  I have two specialized optimization skills available for Lisp development:                                                
35                                                                                                                            
36  - clojure: Optimized for headless Clojure tool execution. (Located at /Users/markw/.pi/agent/skills/clojure.md)           
37  - common-lisp: Optimized for headless SBCL (Steel Bank Common Lisp) tool execution. (Located at                           
38    /Users/markw/.pi/agent/skills/common-lisp.md)                                                                           
39                                                                                                                            
40  ### 2. Temporary File Creation Skill                                                                                      
41                                                                                                                            
42  I have a specific strategy loaded for handling file creation when editing is not the preferred approach:                  
43                                                                                                                            
44  - no-edit-create-new-files: This skill instructs me to avoid modifying existing files directly and instead create new     
45    temporary files. (Located at /Users/markw/.pi/agent/skills/write-temp-strategy.md)                                      
46                                                                                                                            
47  ### 3. Relevant Runtime Invariants                                                                                        
48                                                                                                                            
49  In addition to the skills above, I am governed by a critical runtime invariant regarding file modification:               
50                                                                                                                            
51  - Write Refusal: The Write tool will refuse to execute if the target file already exists. To modify an existing file, I   
52    must use the Edit tool with exact old_string and new_string matches.

Similarly I can ask what skills are available for TypeScript:

 1 > What skills or runtime rules are currently loaded in your system prompt for TypeScript?                                   
 2                                                                                                                            
 3 
 4  The user is asking about "skills" or "runtime rules" related to "TypeScript" that are currently loaded in my system       
 5  prompt.                                                                                                                   
 6  
 7    *   I need to look at the `<available_skills>` section of the system prompt provided in the initial message.            
 8    *   Looking through the list:                                                                                           
 9        *   `clojure` (Lisp)                                                                                                
10        *   `common-lisp` (Lisp)                                                                                            
11        *   `typescript` (TypeScript) - This is one of them!                                                                
12        *   `no-edit-create-new-files` (Temp files)                                                                         
13        *   `find-skills` (Discovery)                                                                                       
14        *   `gemini-api-dev` (Gemini API)                                                                                   
15                                                                                                                            
16    *   Name: `typescript`                                                                                                  
17    *   Description: "Optimizations for headless typescript tool execution."                                                
18    *   Location: `/Users/markw/.pi/agent/skills/typescript.md`                                                             
19                                                                                                                            
20    *   The system prompt also mentions "Runtime invariants" which apply generally to all tasks (like the `Write` refusal   
21  rule).                                                                                                                    
22    *   It also mentions how skill cards are injected into the context per turn based on error-recovery, recency, or intent 
23  priority.                                                                                                                 
24                                                                                                                            
25    *   State that I have a specific skill for TypeScript.                                                                  
26    *   Provide its name and description as listed in my prompt.                                                            
27    *   Mention that it is used to optimize headless TypeScript tool execution.                                                                                                                                                                    
28 
29  I have one specialized skill currently loaded in my system prompt specifically for TypeScript:                            
30                                                                                                                            
31  ### 🛠️ TypeScript Skill                                                                                                   
32                                                                                                                            
33  - Name: typescript                                                                                                        
34  - Description: Optimizations for headless typescript tool execution.                                                      
35  - Location: /Users/markw/.pi/agent/skills/typescript.md                                                                   
36                                                                                                                            
37  This skill is automatically injected into my context when I am working on tasks involving TypeScript to ensure that       
38  commands (like running tests or compiling code) are executed efficiently and correctly in a headless environment.

As a test of this setup I used the prompt (I show only the first part of the agent’s output here):

 1 > write a library file web-scraper.ts that has APIs for 1. get plain text from a URI 2. get Markdown from a URI 3. get      
 2  links from URI 4. get H1, H2, H3 section head text fro URI                                                                
 3                                                                                                                            
 4 
 5  The user wants a TypeScript library file web-scraper.ts that provides four specific APIs:                                 
 6  1. Get plain text from a URI.                                                                                             
 7  2. Get Markdown from a URI.                                                                                               
 8  3. Get links from a URI.                                                                                                  
 9  4. Get H1, H2, H3 section head text from a URI.                                                                           
10                                                                                                                            
11  I should use popular and reliable libraries for this in the TypeScript/Node.js ecosystem:                                 
12  - axios or fetch (native fetch is available in Node 18+) for HTTP requests.                                               
13  - cheerio for parsing HTML and extracting data.                                                                           
14  - turndown for converting HTML to Markdown.                                                                               
15                                                                                                                            
16  Plan:                                                                                                                     
17  1. Check the environment to see if I need to install any dependencies (axios, cheerio, turndown).                         
18  2. Write the web-scraper.ts file using these libraries.                                                                   
19  3. Provide an example of how to use it (optional but good practice).                                                      

Using the model gemma4:26b-a4b-it-qat this prompt one-shotted the following working system:

1 package.json test-scraper.ts web-scraper.ts package-lock.json

I used a second prompt to generate a README.md file:

1 > Write a README.md file that documents the code and shows how to run the test code: npm tsx test-scraper.ts

This prompt created a quality README.md file.

* * *

3. Optimizing Your Developer Environment (VRAM & RAM Conservation)

On a 32GB Mac, running a 15GB model leaves 17GB of unified memory. Since macOS, WindowServer, and display buffers consume 4GB–6GB, you have roughly 11GB–13GB of physical RAM remaining for your developer environment.

To prevent macOS from resorting to disk-swapping (which drastically slows down LLM token generation), adopt a low-memory dev setup:

Terminal-Based Editors (Emacs)

Avoid heavy graphical IDEs when running large local models. A lightweight terminal text editor is ideal. For instance, running Emacs in non-windowed (terminal) mode uses a fraction of the RAM of a GUI instance. For Vi/Vim users, of course use your favorite editor.

[!TIP] Add this alias to your shell configuration file (~/.zshrc or ~/.bashrc) to make terminal editing instant and zero-overhead:

1 alias e="emacs -nw"

Now, typing e filename opens your files directly inside your terminal, bypassing GUI rendering caches.

Other Optimization Rules

  • Limit Browser Tabs: Web browsers are notorious RAM hogs. Keep development tabs focused.
  • Stop Unused Docker Containers: Run docker system prune and stop any database or application containers not actively needed for the current debug loop.
  • Disable Heavy File Indexers: IDEs that constantly re-index the entire disk in the background will compete with Ollama for CPU cycles and memory.