CodeShift is a lightweight coding agent for local repositories. It runs an iterative tool-using loop on top of the Responses API and ships with a dependency-aware Python type-hint migration orchestrator.
- Runs a Claude Code-style agent loop with file, search, edit, glob, and shell tools.
- Generates a compact repo map so the model can see project structure before editing.
- Supports general coding tasks against a target workspace.
- Includes a dedicated Python type-hint migration mode with automatic batching and dependency planning.
- Streams intermediate activity so you can watch the agent work in real time.
.
├── agent/
│ ├── loop.py # core tool-use loop
│ ├── orchestrator.py # type-hint migration runner
│ ├── planner.py # dependency analysis and batching
│ └── repomap.py # compact repo map generation
├── tools/
│ ├── definitions.py # tool schemas exposed to the model
│ └── executor.py # local tool execution
├── tests/
│ └── test_planner.py
├── config.py
└── run.py
- Python 3.12
- An API key for the Responses API or a compatible gateway
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .envSet CODESHIFT_API_KEY in .env. If you want to use a compatible endpoint instead of OpenAI, also set CODESHIFT_BASE_URL.
Run a general coding task:
python3.12 run.py \
--workspace /path/to/repo \
--task "fix the failing tests and explain the root cause"Read the task from a file:
python3.12 run.py \
--workspace /path/to/repo \
--task-file task.txtRun the Python type-hint migration workflow:
python3.12 run.py \
--workspace /path/to/repo \
--typehint-file src/module.py \
--migration-strategy auto \
--test-cmd "python3.12 -m pytest tests -x -q"CodeShift reads configuration from environment variables or a local .env file.
| Variable | Default | Purpose |
|---|---|---|
CODESHIFT_API_KEY |
empty | API key used for Responses API requests |
OPENAI_API_KEY |
empty | Fallback key if CODESHIFT_API_KEY is not set |
CODESHIFT_BASE_URL |
https://api.openai.com |
Base URL for the Responses API or a compatible gateway |
CODESHIFT_MODEL |
gpt-5.4 |
Model name |
CODESHIFT_MAX_OUTPUT_TOKENS |
64000 |
Max model output tokens per response |
CODESHIFT_MAX_ITERATIONS |
200 |
Max iterations for the general agent loop |
CODESHIFT_MAX_TOOL_OUTPUT |
50000 |
Max characters returned from tool execution |
python3.12 -m pytest tests -q- The built-in repo map skips heavy directories such as
.git,node_modules,dist,build, and__pycache__. - The type-hint planner chooses between direct batching and dependency-aware execution based on the call graph of the target file.
- This repository intentionally does not commit secrets. Use
.envor exported environment variables for credentials.