Skip to content
KemalauPublic

About

Lightweight coding agent with repo maps and dependency-aware Python type-hint migration.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

CodeShift

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.

What it does

  • 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.

Project layout

.
├── 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

Requirements

  • Python 3.12
  • An API key for the Responses API or a compatible gateway

Quick start

python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env

Set CODESHIFT_API_KEY in .env. If you want to use a compatible endpoint instead of OpenAI, also set CODESHIFT_BASE_URL.

Usage

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.txt

Run 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"

Configuration

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

Tests

python3.12 -m pytest tests -q

Notes

  • 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 .env or exported environment variables for credentials.

About

Lightweight coding agent with repo maps and dependency-aware Python type-hint migration.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages