This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools: add claude wrapper with MCP servers and CLAUDE.md setup

+68
+22
tools/claude/CLAUDE.md
··· 1 + # CLAUDE.md 2 + 3 + This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. 4 + 5 + ## Instructions 6 + 7 + - Use `--log-format bar-with-logs` with Nix for improved build log output. 8 + - Add new untracked files in Nix flakes with `git add`. 9 + - Format code with `nix fmt` if available. 10 + - Write shell scripts that pass ShellCheck. 11 + - Write Python code for 3.12 that conforms to `ruff format` and passes `ruff check`. 12 + - Always test/lint/format your code before committing. 13 + - Add debug output or unit tests when troubleshooting. 14 + - Avoid mocking in tests. 15 + - Use the `gh` tool to interact with GitHub. 16 + - Use `nix-locate` to find packages by file path. 17 + - Use `nix run` to execute applications that are not installed. 18 + - Do not include "claude" in commit messages. 19 + - Use `nix eval` instead of `nix flake show` to look up attributes in a flake. 20 + - Use tmux-mcp for long running tasks, use a session with a claude- prefix, create a session if you can't find any one that is idle 21 + - Use git-mcp for advanced git operations like interactive staging, stash management, and bisecting 22 + - Take extra care that we don't commit lines with trailing whitespaces
+46
tools/claude/flake-module.nix
··· 1 + { self, ... }: 2 + { 3 + perSystem = 4 + { pkgs, system, ... }: 5 + let 6 + # Get paths to MCP servers 7 + gitMcpPath = "${self.packages.${system}.git-mcp}/bin/git-mcp"; 8 + tmuxMcpPath = "${self.packages.${system}.tmux-mcp}/bin/tmux-mcp"; 9 + 10 + # Claude configuration 11 + claudeConfig = pkgs.writeText "claude-config.json" (builtins.toJSON { 12 + mcpServers = { 13 + "git-mcp" = { 14 + command = gitMcpPath; 15 + args = []; 16 + }; 17 + "tmux-mcp" = { 18 + command = tmuxMcpPath; 19 + args = []; 20 + }; 21 + }; 22 + }); 23 + 24 + # Path to CLAUDE.md 25 + claudeMd = ./CLAUDE.md; 26 + in 27 + { 28 + packages.claude = self.libWithPkgs.${system}.makeWrapper pkgs.claude { 29 + preHook = '' 30 + # Set up Claude config directory 31 + export CLAUDE_CONFIG_DIR="$HOME/Library/Application Support/Claude" 32 + mkdir -p "$CLAUDE_CONFIG_DIR" 33 + 34 + # Copy our config to Claude's config location 35 + cp ${claudeConfig} "$CLAUDE_CONFIG_DIR/claude_desktop_config.json" 36 + 37 + # Set up CLAUDE.md if it doesn't exist 38 + CLAUDE_MD_DIR="''${CLAUDE_MD_DIR:-$HOME/.claude}" 39 + mkdir -p "$CLAUDE_MD_DIR" 40 + if [[ ! -f "$CLAUDE_MD_DIR/CLAUDE.md" ]]; then 41 + cp ${claudeMd} "$CLAUDE_MD_DIR/CLAUDE.md" 42 + fi 43 + ''; 44 + }; 45 + }; 46 + }