This project has been archived by its maintainers, and is no longer receiving any updates.
Nexus - Intelligent Agentic File Assistant
A powerful AI agent powered by Claude that plans and executes complex file operations step-by-step with built-in safety mechanisms.
🚀 Quick Start
pip install nexus-ai-agent
Windows: Use python -m cli "your task" (the nexus command requires PATH setup - see why)
Linux/Mac: Use nexus "your task"
Features
Agentic Planning
- Automatic Planning: Creates a TODO list before executing tasks
- Step-by-Step Execution: Executes each step methodically
- Loop Detection: Prevents infinite loops and repeated actions
- Adaptive Planning: Adjusts plan if something fails
- Progress Tracking: Shows thinking, progress, and stats
Smart File Operations
- Create/Read/Edit/Delete files with intelligent handling
- Smart Reading: Line ranges, previews, search within files
- Smart Search: Find files by name pattern or content
- Directory Exclusions: Automatically skips .git, node_modules, pycache, etc.
- Token Optimization: 10K character limit prevents token explosion
Safety Mechanisms
- Iteration Limits: Max 15 iterations to prevent runaway
- Loop Detection: Detects and warns about repeated actions
- Action Tracking: Prevents duplicate operations
- Error Handling: Graceful failure with helpful messages
Project Structure
agent/
├── agent.py # Core agentic logic with planning
├── tools.py # Tool definitions for Anthropic API
├── tool_functions.py # Tool implementations
├── examples.py # Usage examples
├── .env # Configuration (API key)
└── README.md # This file
Quick Start
1. Installation
pip install nexus-ai-agent
Source installation:
git clone https://github.com/Remote-Skills/nexus.git
cd nexus
pip install -e .
2. Configuration
Create a .env file in your working directory:
ANTHROPIC_API_KEY=your_api_key_here
ANTHROPIC_MODEL=claude-sonnet-4-5-20250929
ANTHROPIC_MAX_TOKENS=4096
3. Usage
⚠️ Windows Users: Use python -m cli instead of nexus
The nexus command requires Python's Scripts folder in your PATH. On Windows, use:
python -m cli "your task"
python -m cli # Interactive mode
To permanently enable the nexus command, see Windows Setup below.
CLI Mode (Recommended)
Linux/Mac:
nexus "Create a Python web app with Flask"
nexus # Interactive mode
Windows (or if nexus not found):
python -m cli "Create a Python web app with Flask"
python -m cli # Interactive mode
Python API - Agentic Mode
from agent import chat_with_tools_agentic
# Complex multi-step task with automatic planning
chat_with_tools_agentic(
"Create a Python project with main.py, requirements.txt, and README.md. "
"The main.py should have a hello world function."
)
Python API - Simple Mode
from agent import chat_with_tools
# Direct tool usage without planning
chat_with_tools("Create a file called test.txt with hello world")
How It Works
Agentic Mode Flow
User Request
↓
1. Agent analyzes task
↓
2. Creates TODO listi/plan
↓
3. Shows plan to user
↓
4. Executes step-by-step
↓
5. Checks results
↓
6. Adapts if needed
↓
7. Final summary
Safety Features
- Loop Detection: Tracks all actions and prevents repeats
- Iteration Limit: Max 15 iterations (configurable)
- Pattern Detection: Warns if same tools used 3+ times
- Action History: Remembers completed actions
Available Tools
| Tool | Description |
|---|---|
create_file |
Create files with content |
read_file |
Smart reading with line ranges, search, preview |
edit_file |
Replace or append content |
delete_file |
Delete files |
list_files |
List directory contents (excludes build dirs) |
smart_search |
Search by filename or content (recursive) |
Smart Reading Features
# Preview a large file
"Preview the file 'large_dataset.csv'"
# Read specific lines
"Read lines 100 to 200 from 'app.log'"
# Search within file
"Find all ERROR messages in 'debug.log'"
# Character limit
"Read config.json but limit to 5000 characters"
Example Tasks
Project Creation
chat_with_tools_agentic(
"Create a Flask web app with proper structure: "
"app.py, requirements.txt, README.md, and a templates folder"
)
Code Analysis
chat_with_tools_agentic(
"Analyze all Python files, find TODO comments, "
"and create a summary in todos.md"
)
Refactoring
chat_with_tools_agentic(
"Find all files with 'old_function_name' and create a plan "
"to refactor them to 'new_function_name'"
)
Best Practices
Do:
- Use agentic mode for complex multi-step tasks
- Let the agent create a plan first
- Provide clear, specific task descriptions
- Break down very large tasks into smaller ones
Don't:
- Request tasks that would require >15 iterations
- Ask for operations on extremely large files without using smart reading
- Request recursive operations without clear boundaries
Debugging
The agent shows detailed output:
- Agent Thinking: Planning and reasoning
- Tool Used: Which tool is being called
- Input: Tool parameters
- Result: Tool output
- Stats: Iterations and actions performed
Safety & Limitations
- Iteration Limit: 15 iterations maximum
- File Size: 50KB+ files trigger warnings
- Character Limit: 10K default for reads
- Loop Detection: Prevents infinite loops
- Excluded Dirs: Skips .git, node_modules, etc.
Windows Setup
Why nexus command doesn't work on Windows
After pip install nexus-ai-agent, the nexus command is installed to Python's Scripts folder (e.g., C:\Users\YourName\AppData\Local\Programs\Python\Python312\Scripts\). If this folder isn't in your Windows PATH, the command won't be recognized.
Solution 1: Use python -m cli (Easiest - Works Immediately)
python -m cli "your task"
This works without any setup! Just use this instead of nexus.
Solution 2: Add Scripts to PATH (One-time setup for nexus command)
Step 1: Find your Scripts folder
python -c "import os, sys; print(os.path.join(sys.prefix, 'Scripts'))"
Step 2: Add to PATH
- Press
Win + X→ Select "System" - Click "Advanced system settings"
- Click "Environment Variables"
- Under "User variables", select "Path" → Click "Edit"
- Click "New"
- Paste your Scripts folder path
- Click "OK" on all windows
- Restart PowerShell
Step 3: Test
nexus "test task"
Solution 3: Create PowerShell Alias
Add to your PowerShell profile (notepad $PROFILE):
function nexus { python -m cli $args }
Save, reload (. $PROFILE), and now nexus works!
For detailed troubleshooting, see: TROUBLESHOOTING.md | WINDOWS_CLI_FIX.md
Contributing
Feel free to add new tools or improve the planning logic!
License
MIT License - Feel free to use and modify!
Metadata
Release files for nexus-ai-agent 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nexus_ai_agent-1.0.2.tar.gz | 21.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nexus_ai_agent-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.5 kB
Release files / nexus_ai_agent-1.0.2.tar.gz
| Download URL | nexus_ai_agent-1.0.2.tar.gz |
|---|---|
| Size | 21.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ddd8758af73d06e7af7c9edfe29d2635ca7adc5aba848e449eb4c18b93955848
|
|
BLAKE2b-256 checksum How to use checksums |
cd00930af47ce2711b3135ced941bcedd25b27c785e82db12e0a683d24f998e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / nexus_ai_agent-1.0.2-py3-none-any.whl
| Download URL | nexus_ai_agent-1.0.2-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50eb09ad9752c1cbd961e5625b7cd95a4f116264d949da4832064d760c8ecd15
|
|
BLAKE2b-256 checksum How to use checksums |
397c1338aec6622cc4d0b777e7d56b13bfee84e17989ec7ccbe0ba2c19d3a4f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|